add example scripts for manually copying docker volumes

This commit is contained in:
Jack Robison 2022-07-06 15:50:45 -04:00
parent a10beac943
commit 78e9d7b50b
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
3 changed files with 29 additions and 0 deletions

View file

@ -196,3 +196,6 @@ services:
``` ```
- Start the hub services by running `docker-compose up -d` - Start the hub services by running `docker-compose up -d`
- Check the status with `docker-compose logs -f --tail 100` - Check the status with `docker-compose logs -f --tail 100`
### Manual setup of docker volumes from snapshots
For an example of copying and configuring permissions for a hub docker volume, see [this](https://github.com/lbryio/hub/blob/master/scripts/initialize_rocksdb_snapshot_dev.sh). For an example for the elasticsearch volume, see [this](https://github.com/lbryio/hub/blob/master/scripts/initialize_es_snapshot_dev.sh). **Read these scripts before running them** to avoid overwriting the wrong volume, they are more of a guide on how to set the permissions and where files go than setup scripts.

View file

@ -0,0 +1,13 @@
#!/bin/bash
ES_NAME="es01"
SNAPSHOT_HEIGHT="1188203"
SNAPSHOT_NODES="snapshot_es_${SNAPSHOT_HEIGHT}/snapshot/nodes"
ES_VOLUME_PATH="/var/lib/docker/volumes/${USER}_${ES_NAME}"
sudo rm -rf "${ES_VOLUME_PATH}/_data"
sudo mkdir -p "${ES_VOLUME_PATH}/_data"
sudo cp -r "${SNAPSHOT_NODES}" "${ES_VOLUME_PATH}/_data/"
sudo chown -R $USER:root "${ES_VOLUME_PATH}/_data"
sudo chmod -R 775 "${ES_VOLUME_PATH}/_data"

View file

@ -0,0 +1,13 @@
#!/bin/bash
SNAPSHOT_HEIGHT="1188203"
HUB_VOLUME_PATH="/var/lib/docker/volumes/${USER}_lbry_rocksdb"
sudo rm -rf "${HUB_VOLUME_PATH}/_data"
sudo mkdir -p "${HUB_VOLUME_PATH}/_data"
sudo cp -r "snapshot_${SNAPSHOT_HEIGHT}/lbry-rocksdb" "${HUB_VOLUME_PATH}/_data/"
sudo touch "${HUB_VOLUME_PATH}/_data/scribe.log"
sudo touch "${HUB_VOLUME_PATH}/_data/scribe-elastic-sync.log"
sudo touch "${HUB_VOLUME_PATH}/_data/herald.log"
sudo cp "snapshot_${SNAPSHOT_HEIGHT}/es_info" "${HUB_VOLUME_PATH}/_data/"
sudo chown -R 999:999 "${HUB_VOLUME_PATH}/_data"