From 48b5aab22869a60aa3b8f1d19169b44d53136b30 Mon Sep 17 00:00:00 2001 From: John Martin Date: Tue, 9 Jan 2024 19:04:17 -0800 Subject: [PATCH] clarify docs with new snapshot download modes --- docs/content/guides/operator/snapshots.mdx | 32 ++++++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/docs/content/guides/operator/snapshots.mdx b/docs/content/guides/operator/snapshots.mdx index 5929c29e5b0888..05c9d5ef546035 100644 --- a/docs/content/guides/operator/snapshots.mdx +++ b/docs/content/guides/operator/snapshots.mdx @@ -80,9 +80,25 @@ To restore from a RocksDB snapshot, follow these steps: 1. Download the snapshot for the epoch you want to restore to your local disk. There is one snapshot per epoch in s3 bucket. 1. Place the snapshot into the directory that the `db-config` value points to in your fullnode.yaml file. For example, if the `db-config` value points to `/opt/sui/db/authorities_db/full_node_db` and you want to restore from epoch 10, then copy the snapshot to the directory with this command: + You can use the aws cli (provided you have credentials to associate with the download): `aws s3 cp s3:///epoch_10 /opt/sui/db/authorities_db/full_node_db/live --recursive`. - Use `--no-sign-request` to bypass setting AWS credentials for the CLI. + A alternative is to use `sui-tool` to copy the files: + ``` + sui-tool download-db-snapshot --epoch "" --genesis "" \ + --formal --network --snapshot-bucket --snapshot-bucket-type --path --num-parallel-downloads 50 --no-sign-request --snapshot-bucket-type=s3 + ``` + - `--epoch`: The epoch that you want to download, for example `200`. Mysten Labs hosted buckets will only keep the last 90 epochs. + - `--network`: Network to download snapshot for. Defaults to "mainnet". + - `--path`: Path to snapshot directory on local filesystem. + - `--no-sign-request`: If set, `--snapshot-bucket` and `--snapshot-bucket-type` are ignored, and Cloudflare R2 is used. + - `--snapshot-bucket`: Source snapshot bucket name, eg `mysten-mainnet-snapshots`. + - `--snapshot-bucket-type`: Snapshot bucket type. GCS and S3 currently supported. + + The following environment variables are used if `--no-sign-request` is not set: + * *AWS*: `AWS_SNAPSHOT_ACCESS_KEY_ID`, `AWS_SNAPSHOT_SECRET_ACCESS_KEY`, `AWS_SNAPSHOT_REGION` + * *GCS*: `GCS_SNAPSHOT_SERVICE_ACCOUNT_FILE_PATH` + * *AZURE*: `AZURE_SNAPSHOT_STORAGE_ACCOUNT`, `AZURE_SNAPSHOT_STORAGE_ACCESS_KEY` 1. Make sure you update the ownership of the downloaded directory to the sui user (whichever linux user you run `sui-node` as) `sudo chown -R sui:sui /opt/sui/db/authorities_db/full_node_db/live`. @@ -104,17 +120,21 @@ The following steps can be used to restore a node from a Formal snapshot: 1. If it's running, stop the node. 2. Run the command: ``` - sui-tool download-db-snapshot --epoch "" --genesis "" \ - --formal --network --snapshot-bucket --snapshot-bucket-type --path --num-parallel-downloads 50 --no-sign-request --snapshot-bucket-type=s3 + sui-tool download-formal-snapshot --epoch "" --genesis "" \ + --network --snapshot-bucket --snapshot-bucket-type --path --num-parallel-downloads 50 --no-sign-request --snapshot-bucket-type=s3 ``` - `--epoch`: The epoch that you want to download, for example `200`. Mysten Labs hosted buckets will only keep the last 90 epochs. - `--genesis`: The path to the location of the network's `genesis.blob`. - - `--formal`: If set, restore from formal (slim, DB agnostic) snapshot. - `--network`: Network to download snapshot for. Defaults to "mainnet". + - `--path`: Path to snapshot directory on local filesystem. + - `--no-sign-request`: If set, `--snapshot-bucket` and `--snapshot-bucket-type` are ignored, and Cloudflare R2 is used. - `--snapshot-bucket`: Source snapshot bucket name, eg `mysten-mainnet-snapshots`. - `--snapshot-bucket-type`: Snapshot bucket type. GCS and S3 currently supported. - - `--path`: Path to snapshot directory on local filesystem. - - `--no-sign-request`: If true, no authentication is needed for snapshot restores. + + The following environment variables are used if `--no-sign-request` is not set: + * *AWS*: `AWS_SNAPSHOT_ACCESS_KEY_ID`, `AWS_SNAPSHOT_SECRET_ACCESS_KEY`, `AWS_SNAPSHOT_REGION` + * *GCS*: `GCS_SNAPSHOT_SERVICE_ACCOUNT_FILE_PATH` + * *AZURE*: `AZURE_SNAPSHOT_STORAGE_ACCOUNT`, `AZURE_SNAPSHOT_STORAGE_ACCESS_KEY` ## Mysten Labs managed snapshots