Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshots create and apply draft #116

Open
peterlimg opened this issue Jan 13, 2024 · 0 comments
Open

Snapshots create and apply draft #116

peterlimg opened this issue Jan 13, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@peterlimg
Copy link
Member

peterlimg commented Jan 13, 2024

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

@peterlimg peterlimg added the documentation Improvements or additions to documentation label Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant