0chain / 0chain/zcnwebappscripts
Snapshots create and apply draft
- 主要言語
- Shell
- スター
- 1
- フォーク
- 2
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
# Create snapshorts
## Create sharder snapshots
Use sharder1 on mainnet as an example, we need to stop both the sharder and postgres docker containers first. Then find all the data folders, compress them and upload to the snapshots server.
get data in `/var/0chain/sharder/ssd` folder and compress:
```sh
tar -czvf sharder-ssd.tar.gz /var/0chain/sharder/ssd/docker.local/data
# upload the ssharder-ssd.tar.gz to snapshots server
```
get data in `/var/0chain/sharder/hdd` folder and compress:
```sh
tar -czvf sharder-hdd.tar.gz /var/0chain/sharder/hdd/docker.local/sharder1/data
# upload the sharder-hdd.tar.gz to snapshots server
```
# Create miner snapshot
Stop the miner docker container, then compress the data folder:
```sh
tar -czvf miner-ssd.tar.gz /var/0chain/miner/ssd/docker.local/miner1/data
# upload the miner-ssd.tar.gz to snapshots server
```
# Apply snapshots
## Sharder
The first step is ensure both sharder and postgres are not running, stop them otherwise.
Download the snapshots from the snapshots server, get both `sharder-ssd.tar.gz` and `sharder-hdd.tar.gz` . Suppose the sharder has the same folder structure, before applying the snapshots, please backup the existing data if any.
Extract the ssd sharder data
```sh
tar -xzvf sharder-ssd.tar.gz -C /var/0chain/sharder/ssd/docker.local/sharder1/data/
```
Extract the hdd sharder data
```sh
tar -xzvf sharder-hdd.tar.gz -C /var/0chain/sharder/hdd/docker.local/sharder1/data/
```
Once extracted, we can start the sharder and postgres docker containers.
### Miner
Stop the miner and redis if they are running. There are 2 redis instances, `miner*_redis_1` and `miner*_redis_txns_1`. So make sure they are both stopped.
Download the snapshot from server.
Backup the data if any.
Extract the snapshot to the miner's data folder, for our miner server, we can do:
```sh
tar -xzvf miner-ssd.tar.gz -C /var/0chain/miner/ssd/docker.local/miner1/data/
```
Start the miner and redis containers
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
このissueは、sharderノードとminerノードのスナップショットの作成と適用について説明しています。まず、リポジトリの構造を調べて、zcnwebappscriptsプロジェクト内の既存のスクリプトを探します。コードベース内で、Dockerコマンドやデータバックアップを扱う関連スクリプトを探します。記載されているフォルダパス(/var/0chain/sharder/ssdなど)を、プロジェクトのドキュメントや設定ファイルと照らし合わせて確認します。タスクはこれらの手順を文書化することなので、最終的なドキュメントはREADMEやdocsフォルダなど適切な場所に配置してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- docker, shell
- 領域
- devops, tooling
- issue の種類
- ドキュメント
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 65/100