Re: Synchronising jails

2012-04-28 Thread Wojciech Puchar

/usr/ports/net/rsync

On Fri, 27 Apr 2012, Frank Staals wrote:



Hey Everyone,

I'm looking for a way to synchronise two jails. More specifically, I
would like to keep/maintain an exact copy of a given jail. As an
example: Suppose I build a jail A on some system (in my particular case
build with ezjail) , and I copy the jail
into jail B on some other system (using tar, as is mentioned
here: http://forums.freebsd.org/showthread.php?t=17813). Now stuff
happens in Jail A, e.g. files change, new stuff is installed etc. I
would like to propagate these changes to jail B, but since the transfer
is over WAN I would like not to have to copy the entire jail again, just
the stuff that has changed since the last backup. It is safe to assume
nothing in Jail B changes: I basically want to maintain the exact copy
so if something would happen to the system running Jail A I can
immediately switch to jail B without much hassle.

Normally I would say this a perfect use case for rsync. But as the
aforementioned thread mentions ``scp or similar wont work to copy a
jail'', and I consider rsync similar to scp, I am under the impression
that rsync would not be usable in this situation. Can anyone shed some
light on this, or suggest an alternative to synchronise the jails?


Regards,

--

- Frank
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Synchronising jails

2012-04-27 Thread Frank Staals

Hey Everyone,

I'm looking for a way to synchronise two jails. More specifically, I
would like to keep/maintain an exact copy of a given jail. As an
example: Suppose I build a jail A on some system (in my particular case
build with ezjail) , and I copy the jail
into jail B on some other system (using tar, as is mentioned
here: http://forums.freebsd.org/showthread.php?t=17813). Now stuff
happens in Jail A, e.g. files change, new stuff is installed etc. I
would like to propagate these changes to jail B, but since the transfer
is over WAN I would like not to have to copy the entire jail again, just
the stuff that has changed since the last backup. It is safe to assume
nothing in Jail B changes: I basically want to maintain the exact copy
so if something would happen to the system running Jail A I can
immediately switch to jail B without much hassle. 

Normally I would say this a perfect use case for rsync. But as the
aforementioned thread mentions ``scp or similar wont work to copy a
jail'', and I consider rsync similar to scp, I am under the impression
that rsync would not be usable in this situation. Can anyone shed some
light on this, or suggest an alternative to synchronise the jails?  


Regards, 

-- 

- Frank
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Synchronising jails

2012-04-27 Thread Eric Schuele
On 04/27/2012 09:35, Frank Staals wrote:
 
 Hey Everyone,
 
 I'm looking for a way to synchronise two jails. More specifically, I
 would like to keep/maintain an exact copy of a given jail. As an
 example: Suppose I build a jail A on some system (in my particular case
 build with ezjail) , and I copy the jail
 into jail B on some other system (using tar, as is mentioned
 here: http://forums.freebsd.org/showthread.php?t=17813). Now stuff
 happens in Jail A, e.g. files change, new stuff is installed etc. I
 would like to propagate these changes to jail B, but since the transfer
 is over WAN I would like not to have to copy the entire jail again, just
 the stuff that has changed since the last backup. It is safe to assume
 nothing in Jail B changes: I basically want to maintain the exact copy
 so if something would happen to the system running Jail A I can
 immediately switch to jail B without much hassle. 
 
 Normally I would say this a perfect use case for rsync. But as the
 aforementioned thread mentions ``scp or similar wont work to copy a
 jail'', and I consider rsync similar to scp,

rsync is dissimilar in that it is capable of preserving links.  It may
likely do the job?

 I am under the impression
 that rsync would not be usable in this situation. Can anyone shed some
 light on this, or suggest an alternative to synchronise the jails?  
 
 
 Regards, 
 




signature.asc
Description: OpenPGP digital signature


Re: Synchronising jails

2012-04-27 Thread Lowell Gilbert
Frank Staals fr...@fstaals.net writes:

 Hey Everyone,

 I'm looking for a way to synchronise two jails. More specifically, I
 would like to keep/maintain an exact copy of a given jail. As an
 example: Suppose I build a jail A on some system (in my particular case
 build with ezjail) , and I copy the jail
 into jail B on some other system (using tar, as is mentioned
 here: http://forums.freebsd.org/showthread.php?t=17813). Now stuff
 happens in Jail A, e.g. files change, new stuff is installed etc. I
 would like to propagate these changes to jail B, but since the transfer
 is over WAN I would like not to have to copy the entire jail again, just
 the stuff that has changed since the last backup. It is safe to assume
 nothing in Jail B changes: I basically want to maintain the exact copy
 so if something would happen to the system running Jail A I can
 immediately switch to jail B without much hassle. 

 Normally I would say this a perfect use case for rsync. But as the
 aforementioned thread mentions ``scp or similar wont work to copy a
 jail'', and I consider rsync similar to scp, I am under the impression
 that rsync would not be usable in this situation. Can anyone shed some
 light on this, or suggest an alternative to synchronise the jails?  

I didn't don't know of any problem with using rsync (over ssh) for this,
and after reading the thread to which you refer, I still don't.

Set up a testbed using rsync and see if it works for you. If it doesn't,
*then* you'll have something we can try to solve.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Synchronising jails

2012-04-27 Thread Johan Hendriks


 
 Hey Everyone,
 
 I'm looking for a way to synchronise two jails. More specifically, I
 would like to keep/maintain an exact copy of a given jail. As an
 example: Suppose I build a jail A on some system (in my particular case
 build with ezjail) , and I copy the jail
 into jail B on some other system (using tar, as is mentioned
 here: http://forums.freebsd.org/showthread.php?t=17813). Now stuff
 happens in Jail A, e.g. files change, new stuff is installed etc. I
 would like to propagate these changes to jail B, but since the transfer
 is over WAN I would like not to have to copy the entire jail again, just
 the stuff that has changed since the last backup. It is safe to assume
 nothing in Jail B changes: I basically want to maintain the exact copy
 so if something would happen to the system running Jail A I can
 immediately switch to jail B without much hassle. 
 
 Normally I would say this a perfect use case for rsync. But as the
 aforementioned thread mentions ``scp or similar wont work to copy a
 jail'', and I consider rsync similar to scp, I am under the impression
 that rsync would not be usable in this situation. Can anyone shed some
 light on this, or suggest an alternative to synchronise the jails?  
 
 
 Regards, 
 
 -- 
 
 - Frank
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

Maybe you can store your jails on a per jail zfs filesystem.
Then use zfs send/receive to send the incremental changes to the remote machine.

Regards,
Johan Hendriks___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Synchronising jails

2012-04-27 Thread Fbsd8

Frank Staals wrote:

Hey Everyone,

I'm looking for a way to synchronise two jails. More specifically, I
would like to keep/maintain an exact copy of a given jail. As an
example: Suppose I build a jail A on some system (in my particular case
build with ezjail) , and I copy the jail
into jail B on some other system (using tar, as is mentioned
here: http://forums.freebsd.org/showthread.php?t=17813). Now stuff
happens in Jail A, e.g. files change, new stuff is installed etc. I
would like to propagate these changes to jail B, but since the transfer
is over WAN I would like not to have to copy the entire jail again, just
the stuff that has changed since the last backup. It is safe to assume
nothing in Jail B changes: I basically want to maintain the exact copy
so if something would happen to the system running Jail A I can
immediately switch to jail B without much hassle. 


Normally I would say this a perfect use case for rsync. But as the
aforementioned thread mentions ``scp or similar wont work to copy a
jail'', and I consider rsync similar to scp, I am under the impression
that rsync would not be usable in this situation. Can anyone shed some
light on this, or suggest an alternative to synchronise the jails?  



Regards, 


I have 3 different ideas that would work.

Method 1. move changes to basejail. Use qjail to create your hosta-jaila 
and hostb-jaila. Qjail has a bkup function that you can backup the 
hosta-jaila basejail in compressed dump format and move that file to 
hostb any way you want and then use qjail restore function to restore 
that dump file to hostb-jaila basejail. bkuping up basejail takes less 
than one minute.


method 2. move user data changes to jaila. create hosta-jaila and 
hosta-jailb both being the same. After changes to hosta-jaila run diff 
on hosta-jaila, hosta-jailb and them move the diff file to hostb and 
apply the diff to hostb-jaila.


method 3. move user data changes to jaila. Use qjail to backup 
hosta-jaila and restore it to hostb-jaila. Backing up a jail takes less 
than 15 seconds.


Note, Both hosta and hostb must be at same operating system version 
level. Ezjail also has function to bkup a jail but no way to bkup 
basejail. You can issue a dump command on the command line to create 
one after all jails are stopped.


In my book rsync is the automated way to keep two live system in sync 
real time. Maybe overkill in something that is pretty much stable. If 
say hosta/jaila is running a mail server or a website that remote users 
enter info into, then rsync is the only solution.



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org