0chain / 0chain/zcnwebappscripts

Snapshots create and apply draft

Aperta Adatta ai principianti
#116 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
documentation
Lingua principale
Shell
Stelle
1
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

# 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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

L'issue descrive la creazione e l'applicazione di snapshot per i nodi sharder e miner. Inizia esaminando la struttura del repository per individuare gli script esistenti nel progetto zcnwebappscripts. Cerca eventuali script correlati nella codebase che gestiscano comandi docker o backup dei dati. Verifica i percorsi delle cartelle menzionati (/var/0chain/sharder/ssd, ecc.) rispetto alla documentazione o ai file di configurazione del progetto. Il compito è documentare questi passaggi, quindi assicurati che la documentazione finale sia posizionata in una posizione appropriata, come un README o una cartella docs.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker, shell
Ambito
devops, tooling
Tipo di issue
Documentazione
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
65/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.