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
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
該問題描述了為分片節點和礦工節點建立與應用快照。首先檢查儲存庫結構,找到 zcnwebappscripts 專案中的現有腳本。在程式碼庫中搜尋任何處理 docker 指令或資料備份的相關腳本。根據專案文件或設定檔驗證提到的資料夾路徑(/var/0chain/sharder/ssd 等)。任務是記錄這些步驟,因此請確保最終文件放置在適當的位置,例如 README 或 docs 資料夾中。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- docker, shell
- 領域
- devops, tooling
- Issue 類型
- 文件
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 活躍度
- 停滯
- 描述清晰度
- 描述清楚
- 新手友好度
- 65/100