0chain / 0chain/zcnwebappscripts
Snapshots create and apply draft
- Langage dominant
- Shell
- Étoiles
- 1
- Forks
- 2
- Métriques de merge des PR
- Aucune PR mergée en 30 j
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:
```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
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Le problème décrit la création et l'application de snapshots pour les nœuds sharder et miner. Commencez par examiner la structure du dépôt pour localiser les scripts existants dans le projet zcnwebappscripts. Recherchez tout script connexe dans la base de code qui gère les commandes docker ou la sauvegarde des données. Vérifiez les chemins de dossiers mentionnés (/var/0chain/sharder/ssd, etc.) par rapport à la documentation ou aux fichiers de configuration du projet. La tâche consiste à documenter ces étapes, assurez-vous donc que la documentation finale est placée dans un emplacement approprié, tel qu'un README ou un dossier docs.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- docker, shell
- Domaine
- devops, tooling
- Type d'issue
- Documentation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 65/100