"Periodic replication" to 2nd volume on same box = cron only?

guermantes

Patron
Joined
Sep 27, 2017
Messages
213
I'm looking but cant find a way in the GUI (11.0 U4) to make periodic replication/send-recieve to another volume in the same Freenas system? Is my only option to set up a cron job to do the replication?

This is my situation and why I ask:
Until now I only had my 6x4 TB RaidZ2 volume, but today I installed a 10 TB drive that I want to use for storing snapshot backups. I have offsite backup as well, but this drive is intended to provide a means to make frequent snapshots to have as backup in case my main volume crashes or becomes unusable during re-silvering or something and I need to get on working presto.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I'm looking but can't find a way in the GUI (11.0 U4) to make periodic replication/send-recieve to another volume in the same Freenas system? Is my only option to set up a cron job to do the replication?
That is what I ended up doing. In my main FreeNAS system at home, I have a backup pool that is setup with gzip9 compression. I have a rsync task that runs through cron to keep it updated. I save about 1.5TB of space vs my main pool by using the more aggressive compression on the backup pool. I share it to the network as read-only. That way if someone deletes something by mistake, they can get it from the backup without needing to bug me for it. If it goes beyond the rsync interval, then they have to see me to pull it from a snapshot. I keep the snapshots in the main pool.

PS. I have a second server with another full backup of everything in the main server.
 

guermantes

Patron
Joined
Sep 27, 2017
Messages
213
Is it just a personal preference for rsync or are you gaining something in particular as opposed to sending/receiving snapshots?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Is it just a personal preference for rsync or are you gaining something in particular as opposed to sending/receiving snapshots?
I have more experience with rsync, so I probably just have a preference for it. The thing I like about rsync is that it will look at all the files and just transfer the ones that have changed, but I think something similar can be done with snapshots. I usually use zfs send | zfs receive when I am doing a full pool copy from one system to another, but for keeping it updated, I use rsync.
 
Joined
Jan 18, 2017
Messages
525
I'm just doing a local replication task that I enable and disable, as long as you do not let the snapshots get too out of sync it only copies what has changed.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I'm just doing a local replication task that I enable and disable, as long as you do not let the snapshots get too out of sync it only copies what has changed.
How do you set that up?
 
Joined
Jul 3, 2015
Messages
926
Remote hostname: localhost
 
Joined
Jan 18, 2017
Messages
525

Foggrinder

Cadet
Joined
Dec 17, 2018
Messages
4
I tried a local pool to pool replication as described above and got an error.
Code:
Failed to connect to remote host ws://192.168.0.102:80/websocket with following exception timed out 


During adding replication task it asked for a token even though encryption is disabled so I gave it one. It's fresh. System host name is "freenas" at 192.168.0.102, static. I tried using hostname "freenas" with same result.
Source pool: Tank1
Destination pool: Backup1
Destination dataset: SnapshotBU
What am I doing wrong? Here is a pic if it helps.
System description is in my signature.

Replication Task Setup Error.jpg
 
Joined
Jul 3, 2015
Messages
926
Try replacing your Remote Hotsname IP with the word localhost
 

Foggrinder

Cadet
Joined
Dec 17, 2018
Messages
4
Try replacing your Remote Hotsname IP with the word localhost
I tried that already. No love.

However I did come across another thread where several forum users where running into this issue.
11.2 semi-automatic replication connection timeout
So I tried using an IP address and Manual method which requires a Replication Key rather than a Replication Token after inserting a SSH key in for root user under accounts. I got passed the network issue but now have a problem with the authentication. The error I get is:
"Failed: No ECDSA host key is known for 192.168.0.102 and you have requested strict checking. Host key verification failed. "

This is all new to me. I tried twice and with same result so far.

Is there any portion of the key text generated that should not be copied (header or footer portion)?

Seems like the developers should grey out all of this if "localhost" is inserted under remote host.
 
Joined
Jan 18, 2017
Messages
525
I just tested it on a 11.2u1 vm in the legacy GUI
I copied the public key exactly (everything it shows in the dialog box) to the root user, then added the replication task disabling compression and encryption using localhost as the remotehost then copied the exact same publickey into the remotehost key dialog box and hit the scan ssh key. If ssh is not enable you get a connection refused error if it connect correctly the content of the remotehost key dialog box will change.
 
Last edited:

Foggrinder

Cadet
Joined
Dec 17, 2018
Messages
4
Thanks. Got it working.
Not sure what the problem was. I turned compression OFF in the replication task and inserted a new public key, again being sure to insert everything as before. Also checked the box for Dedicated User Enable and specified root user in replication task. It's currently using the IP address rather than "localhost". But it may work with "localhost' as well?
 
Last edited:

guermantes

Patron
Joined
Sep 27, 2017
Messages
213
Oops, I should have kept a closer eye on this thread. Could have saved me one day of writing a bash script to take care of replication to the second pool (I'm a beginner scripter).
 
Top