n00b question about snapshots

Status
Not open for further replies.

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
Hi,

I have one volume that consists of 4 X 4 TB drives.
It's in "stripped mirrors" (aka Raid 10) so I have 8 TB available.
Let's call this volume DATA

Then I have another volume 2 X 4 TB, stripped.
So I also have 8 TB available.
Let's call this volume BACKUP
My goal was to make snapshots of the DATA volume, on the BACKUP volume.

Is that something you can do or that's just impossible?

Everytime I try to play with snapshots, it doesn't tell me WHERE i want to put the snapshot, so I'm starting to wonder if that can be an option?


Thanks !
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
I think you don't understand what a snapshot is.

I think what you want to do is BACKUP the entire filesystem to the other pool, right? A SNAPSHOT is something else entirely, and has nothing to do with backups. What you want to do is replicate pool #1 onto pool #2, not make a snapshot, right?
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
Well I guess so...

That's why it was a n00b question !!!

I'm new to FreeNAS and I'm used to using scripts to make incremental RSync backups.

I kinda got the idea that Snapshots were pretty much the same thing... and judging by your answer, it is not?

So I guess I have to look into replication then, but is replication also incremental?

Thanks!
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
I'm probably mis-speaking somewhat, and making matters worse. Ignore me. You need to replicate, and yes, replication is done on "snapshots". So I am probably confusing issues.

Let me just direct you to this part of the documentation. This is what you need to set up.
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
Thanks for your help!

But it seems to me that replication is used to replicate to a distant system.

What I'm trying to do is replicate the data to a local, but different volume.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Check this out. Pretty much the same thing as sending it to a distant fileserver.
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
Ok so I realize now my initial post was incomplete.

I've read this latest link and I can see how you you could copy one volume to another, by using a recursive snapshot and using commandes to send and receive.

However, i would like to know how you can program regular replications.

BUT, instead of replicating to a distant system, it would be to a different volume.

Replication seems to be very well built but I don't see how I can use that for just a local, different volume.

Is there a way to do that? I can't be the only one looking to do that?

Or maybe I should simply use RSync for such a task?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
See the chapter of the manual on snapshots and replication. Everything you need to know is in there.
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
Is this the chapter you're referring to:
http://doc.freenas.org/index.php/Replication_Tasks
??

Because I've been reading it over and over, and it's very well explained how to do distant replications.

But how can I do LOCAL ones ????

Remember... I have two LOCAL volumes (A and B)

I want to make periodic replications of A on B

For example, what should I input in these :

Remote hostname:
Remote port:
Remote hostkey:

Thanks!
 

alexg

Contributor
Joined
Nov 29, 2013
Messages
197
Here you go. You will need to follow few steps to set this up. Search forums for local replication, that's how I figured it out.

You will need to mount root filesystem in "w" mode.

Then you need to follow ssh example under Troubleshooting Replication paragraph in documentation. This will test your SSH connectivity and will establish authorized_keys and known hosts under root user id.

Once this is done, you can remount your root filesystem in read mode.

Also, make sure you paste correct SSH-RSA key in GUI replication setup. I don't remember off top of my head which one I pasted, but I know it could be confusing and it took few more googling to figure it out.

And make sure you pick correct remote volume/dataset. Be VERY CAREFUL or you could make an mistake and overwrite your source volume.
 

Attachments

  • Capture.PNG
    Capture.PNG
    22.8 KB · Views: 205

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
Thank you very much for this, I think I'll figure it out with this capture you posted!

I'm still puzzled about this though: in order to do local replication (local as in : SAME SERVER just different volume) you really have to go through SSH ?
If that's the way to go, then that's the way to go!
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
Well I tried and it won't work work...

SSH service are active

I created a dedicated user "LocalR"

Then got the public Key for replication from the "View Public Key" button in the ZFS Replication Tab.

Then pasted the Key in the dedicated user LocalR

Then inspired myself of the screenshot from ALEXG and did this (see attached)

BUT I wasn't sure about the Remote Host Key...
From this : http://doc.freenas.org/index.php/Replication_Tasks
Is says
use the SSH Key Scan button to retrieve the public key of PULL

Well I have no such thing as a "SSH Key Scan button...

So I tried using the same public Key for replication...

Now I get an ALERT saying:
CRITICAL: Replication Data -> locahost failed: None

Anyone has an idea?
 

Attachments

  • Snapshot.png
    Snapshot.png
    65.9 KB · Views: 188

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
this might not be best for all, but I'd just right a script to do the replication and run it from cron.
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
Thanks Joshua, but I'm really trying to have it working from the GUI just like alexg

Well, I'm back again...

I've been trying to dig in the forum and also Google around... yet I still cannot make "local" replication work.

I'm stuck at this point...

I made a dedicated user and give it SUDO priv...

I think everything in my setup seems to be correct the only thing I'm wondering about is the "REMOTE HOSTKEY" (in the Replication Task setup...
I did not find any indication anywhere about that
For now I'm using the key I copy and pasted from the result from
Code:
ssh-keyscan localhost
in console...

Maybe that's where my problem comes from ??
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
By the way, I keep getting this "alert" but I'm not sure what it means...

Code:
Replication Data -> locahost failed: None


maybe it's because you can't use "localhost" as a remote host?

But alexg's snapshot would suggest otherwise!
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
I changed local host for the actual internal IP (for me: 10.0.3.20) of the server and things started working a little better!

I finally understood what alexg meant by mounting in write mode to do some changes.

I followed this:
http://forums.freenas.org/index.php...setting-up-ssh-key-based-authentication.2480/

And everything worked, even the "test"
Code:
ssh -i /data/ssh/replication 10.0.3.20


But still, the replication fails with this error code :
Code:
common.pipesubr: Permission denied (publickey,password).


Now I'm really puzzled... the issued command is the following

Code:
Executing: /usr/bin/ssh -i /data/ssh/replication -o BatchMode=yes -o StrictHostKeyChecking=yes -o ConnectTimeout=7 -l LocalR -p 22 10.0.3.20 /sbin/zfs destroy -rRf Backup/Replication


I'm not sure where to go from there... any idea?
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
Well... I was obsessed so I played with the parameters...

No change until I stop trying to use a dedicated user, and I used ROOT.

Then everything works.

For some reason, I could never get local replication to work with a dedicated user (and I really tried) but now, with ROOT, it works perfect.

So case closed everyone, if someone is running through similar problems, just drop the dedicated user and use ROOT.

With a dedicated user, I kept getting errors, and kept solving them with consol commands or configs.

With ROOT, everything worked from the GUI... almost magical!


Thanks everyone who posted :)
 

alexg

Contributor
Joined
Nov 29, 2013
Messages
197
I'm glad you figured it out. I'm using root as well. Be aware that I encountered some issues with 9.2.1.3 version and had to manually patch autorepl.py. I believe my issue was fixed in newer releases.
 
Status
Not open for further replies.
Top