-
Notifications
You must be signed in to change notification settings - Fork 280
Archiving
Plotman's (optional) archiving feature can be used to move plots from your plotter's dst
directories to a remote destination (plot storage).
Instructions and comments are based on Standard Ubuntu Server installation. Commands and file locations may differ for other Linux distributions.
In order to set up archiving you need two machines:
- Plot Storage, a remote machine where all your plots should be sent to
- Plotter, local machine running plotman where your plots are created
We will start by setting up the Plot Storage and then configure everything on the Plotter.
On your Plot Storage
machine, make sure that all the storage drives are mounted, rsync daemon is running and SSH is set up to accept incoming connections from your Plotter.
Mount your drive's as you desire. In this tutorial the following mount points will be used:
/mnt/plots1
/mnt/plots2
The Plot Storage
machine needs the rsync daemon running and correctly configured using these steps:
-
Install rsync (Ubuntu Server already comes with it installed)
-
Create
etc/rsyncd.conf
:
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
# don't change the port, plotman (as of version 0.2) has the port hard coded
port = 12000
# rsync module name
[chia]
# Path with your mounted drives
path = /mnt
comment = Chia
# Use the username that you log into Ubuntu with or create a new one
uid = username
# User group (by default same as username)
gid = username
read only = no
list = yes
# dont uncomment this,
#auth users = none
# plotman does not work with authentication
#secrets file = none
# since we dont use auth only accept connections from plotter's ip
hosts allow = plotter.ip.address
-
Start rsync daemon by typing
sudo systemctl start rsync
-
If you automatically want the daemon to start after a reboot type:
sudo systemctl enable rsync
The path
variable represents a path where all your storage drives are mount.
So in our example in /mnt
we have two drives mounted, namely plots1
and plots2
.
Plotman will use any drive with available space mounted inside the path
(e.g. /mnt
). So if you have drives there that you don't want to put your plots on, you should put your plot drives inside a subfolder. Let's say we have
/mnt/plots1
/mnt/plots2
/mnt/usbthumbdrive
on our Plot Storage
machine and we only want plotman to archive to plots1 and plots2, but not usbthumbdrive. In that case we need to move our mount points like this
/mnt/subdir/plots1
/mnt/subdir/plots2
/mnt/usbthumbdrive
and change the path
variable to /mnt/subdir
If you only have a single drive mounted for archiving (e.g. /media/username/plots
) your path should not point to /media/username/plots
, but rather to /media/username
Make sure you configure ssh in a way that you can connect from your Plotter without having to use a password or keyfile passphrase.
The best way to do this is to create a ssh-key without a passphrase on the Plotter and copy the public key to your Plot Storage.
Update the archive section of your plotman.yaml
(Default Configuration File) file. In our example the config would look as follows:
archive:
rsyncd_module: chia # Module name specified in the Plot Storage's rsyncd.conf
rsyncd_path: /mnt # Path where your storage drives are mounted (same as in rsyncd.conf)
rsyncd_bwlimit: 100000 # Bandwidth limit in KB/s
rsyncd_host: plot.storage.ip # IP address or hostname of your Plot Storage
rsyncd_user: username # Username that can ssh into your Plot Storage
Before starting plotman
you should make sure that both SSH and rsync is set up correctly. If you can't successfully run the tests below, plotman's archiving will not work.
The machines should be set up in such a way that you can SSH from your Plotter to your Plot Storage without having to enter a password. In order to do this you should use a ssh public/private keypair that doesn't require entering a passphrase.
To test if you set this up correctly type the following command on your Plotter: ssh [email protected] df -aBK | grep /mnt
The command above should give you a list of all the mounted drives of your Plot Storage. If it doesn't, or if it asks for a password or a passphrase then SSH is not set up as required by plotman and archiving will not work.
- Create a testfile on your Plotter using
echo "testing" > testfile.test
- Enter the following on your Plotter:
rsync -P testfile.test rsync://[email protected]:12000/chia/plots1
- Check your Plot Storage and make sure testfile.test exists in
/mnt/plots1
If both of the tests above pass but archiving still doesn't work, you can look at the rsync output in your console.
- Start
plotman interactive
- Locate the rsync line in the Log section at the bottom of the screen, e.g.:
05-03 08:37:46 Starting archive: rsync --bwlimit=80000 --remove-source-files -P /mnt/dst1/plot-k32-2021-05-03-01-50-b4271f88a74b36b516c242151e00fdda20e3f31ce1f8624465bf05a195009ecd.plot rsync://[email protected]:12000/chia/plots2
- Copy the part after
05-03 08:37:46 Starting archive:
. In our example that would be:
rsync --bwlimit=80000 --remove-source-files -P /mnt/plots1/plot-k32-2021-05-03-01-50-b4271f88a74b36b516c242151e00fdda20e3f31ce1f8624465bf05a195009ecd.plot rsync://[email protected]:12000/chia/plots2
- Run the command in your terminal and use the output for finding any errors you may have in your configuration.
In order to disable archiving just completely comment out the corresponding archive:
section in your .config/plotman/plotman.yaml