Backup, Recovery and Replication
Recovery
This section provides a comprehensive guide for setting up recovery between two ZS3Servers.
This setup uses the Blimp UI for deployment, Visual Studio Code for configuration, and MinIO Client (mc) for management.
Whether you're new to ZS3Server or an experienced user, this guide offers detailed instructions for every stage of the process.
Step 1: Deploy ZS3Server1
Go to "Manage Allocations" and select "S3 Setup." and click on create new allocation


Now add blobbers and Click on "Confirm" to add blobbers. Review and confirm the details and pay from the existing balance. Create an allocation and the S3 server setup will open automatically. You will have to create your server instance by adding IP address.

You need to obtain the IP address of your server, which can be provided by your hosting provider or retrieved using the
ifconfigcommand in the terminal. For example, in the server logs, you may see an IP address such as65.109.152.43.

Now add your IP address and click on generate script in Blimp UI. Then enter the password for S3 deployment.


Now copy the script and run it in your server terminal.


Step 2: Deploy ZS3Server2
Go to "Standard Allocation" in the Blimp UI. Create a new allocation and name it
allocation22.

Click on "Confirm" and select the blobbers, then confirm again. This will create a standard allocation.

In the Blimp UI, copy the newly created standard allocation ID.

Go to your server, create a new
.zcn2folder in your home directory ($HOME), and navigate to theblimpfolder. Inside theblimpfolder, create theallocation.txtfile and paste the allocation ID.

Copy the
docker-compose.yml,config.yaml,wallet.jsonandz3server.jsonfiles from the.zcnfolder to the.zcn2folder.


Edit the ports in
docker-compose.yml.Go to line 55 in the.zcn2/docker-compose.ymlfile and note the ports9002:9000. Copy these ports to the.zcn/docker-compose.ymlfile.Now run the following commands to start the Docker containers for
.zcn2folder defined in thedocker-compose.yml:

Change the first port in
.zcnfrom9002to9000in docker-compose.yml file, making it9000:9000.

Now run the following commands to start the Docker containers defined in the docker-compose.yml:

Step 3: Install MinIO Client (mc)
Follow the installation guide provided in the ZS3Server documentation.
1. macOS Homebrew
Install mc packages using Homebrew
2. GNU/Linux
Binary Download
3. Microsoft Windows
Binary Download
Step 4: Create Alias for ZS3Server1
Run the following command to create an alias for zs3server1:

Step 5: Create Alias for ZS3Server2
Run the following command to create an alias for zs3server2:

Step 6: Create Bucket and Copy Data in ZS3Server1
Create a bucket in
zs3server1withallocation21:Verify the bucket:
Copy data to the created bucket:

Step 7: Create Bucket and Copy Data in ZS3Server2
Create a bucket in
zs3server2withallocation22:Verify the bucket:

Step 8: Set Up Replication
Run the following command to create replication between the buckets:

Any deletions in bucket1 will automatically replicate in bucket2.
Step 9: Perform Disaster Recovery
Shut down
zs3server1and clean up its deployment.Create a new allocation (
allocation23) using the Blimp UI with a standard allocation.Update the
allocation.txtfile in.zcnwith the newallocation23ID.Set up an alias for the new server:
Create a new bucket:
Restore data to the new allocation:

Step 10: Verify Recovery
Check that the files have been recovered to the new allocation:
Replication
This section outlines the steps to set up replication between two ZS3Servers.
Replication ensures that data from one server is mirrored to another for backup and redundancy.
Follow the steps below to configure and initiate replication.
Prerequisites
For running two ZS3Servers on the same machine:
Copy the contents of the
.zcnfolder to.zcn2.Update
allocation.txtandzs3server.jsonin.zcn2.Update the
docker-compose.ymlfile to use unique ports.
Ensure both ZS3Servers are configured using MinIO Client aliases:
Alias for the first server (
zcn):Alias for the second server (
zcn2):
Step 1: Verify Configuration
Navigate to the
.zcn2folder:Open the terminal and run:
Verify the ports are correctly set to
9002:9000.

Check the standard allocation ID:
Compare this ID with the allocation ID in the Blimp dashboard to ensure consistency.

Step 2: Configure Aliases
Use the MinIO Client (mc) to configure aliases for both servers:
Format:
Example:
Run the alias commands:
Step 3: Initiate Replication
Use the following command to start replication:
Replace
<BUCKET_PREFIX>with the appropriate bucket names.
Example:
test2-s3is a folder in the S3 allocation.

mbtest2will be created in the standard allocation onzcn2.

All data from
test2-s3will be replicated intombtest2.
Step 4: Verify Replication
Check the contents of the buckets:
Create new buckets if necessary:
Confirm that the data is mirrored correctly:
Backup and Restore with Restic
Use Restic for lightweight, versioned, and secure backups to your ZS3 bucket.
Step 1: Install Restic
Step 2: Set Environment Variables
Step 3: Initialize the Repository
Step 4: Run a Backup
Step 5: List Snapshots
Step 6: Restore Snapshot
Step 7: Automate via Crontab (Optional)
Use crontab -e to add periodic backup jobs.
Last updated