Snapshots create and apply draft
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
Research direction
The issue describes creating and applying snapshots for sharder and miner nodes. Start by examining the repository structure to locate existing scripts in the zcnwebappscripts project. Look for any related scripts in the codebase that handle docker commands or data backup. Verify the folder paths mentioned (/var/0chain/sharder/ssd, etc.) against the project's documentation or configuration files. The task is to document these steps, so ensure the final documentation is placed in an appropriate location, such as a README or a docs folder.
Written by the indexing model from the issue text.
Description
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:
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:
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:
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
tar -xzvf sharder-ssd.tar.gz -C /var/0chain/sharder/ssd/docker.local/sharder1/data/
Extract the hdd sharder data
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:
tar -xzvf miner-ssd.tar.gz -C /var/0chain/miner/ssd/docker.local/miner1/data/
Start the miner and redis containers
- Dominant language
- Shell
- Stars
- 1
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 0chain/zcnwebappscripts
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
0chain/zcnwebappscripts#121 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
0chain/zcnwebappscripts#120 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 20/100
0chain/zcnwebappscripts#169 · 1 assignee ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
0chain/zcnwebappscripts#123 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
0chain/zcnwebappscripts#114 ·
All issues in 0chain/zcnwebappscripts
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·
-
docs(agents): strengthen the no-backslash-escaped-backticks rule with an issue-creation example Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
oSoWoSo/vOid_Community_repOsitory#148 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 91/100
alunduil/alunduil-chezmoi#792 ·