Hi, I''m thinking about the following situation and I know there are some things I have to understand: I want to use two SUN-Servers with the same amount of storage capacity on both of them and I want to replicate the filesystem ( zfs ) incrementally two times a day from the first to the second one. I know that the zfs send/receive commands will do the job, but I don''t understand exactly how zfs will know what have to be transferred.. Is it the difference to the last snapshot? If yes, does that mean that I have to keep all snapshots to achieve an "incremental-forever" configuration? --> That''s my goal! regards, Tobias Exner
Hi Tobias, I did this for a large lab we had last month, I have it setup something like this. zfs snapshot pool at new_inc zfs send -i pool at current pool at new_inc | ssh server2 zfs recv rep_pool ssh zfs destroy rep_pool at current ssh zfs rename rep_pool at new_inc rep_pool at current zfs destroy pool at current zfs rename pool at new_inc pool at current I was using this for a set up with on master systems and 100 system that I replicated the zpool to, and I had scripts that was used when a student logged out to do a zfs rollback pool at current to reset it to known state to be ready for a new student. I don''t have the actual script I used here right now, so I might have missed some flags, but you see that basic flow of it. /peter On Jun 6, 2008, at 14:07, Tobias Exner wrote:> Hi, > > I''m thinking about the following situation and I know there are some > things I have to understand: > > I want to use two SUN-Servers with the same amount of storage capacity > on both of them and I want to replicate the filesystem ( zfs ) > incrementally two times a day from the first to the second one. > > I know that the zfs send/receive commands will do the job, but I don''t > understand exactly how zfs will know what have to be transferred.. > Is it > the difference to the last snapshot? > > If yes, does that mean that I have to keep all snapshots to achieve an > "incremental-forever" configuration? --> That''s my goal! > > > > > regards, > > Tobias Exner > > > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Or you could use Tim Fosters ZFS snapshot service http://blogs.sun.com/timf/entry/zfs_automatic_snapshots_now_with /peter On Jun 6, 2008, at 14:07, Tobias Exner wrote:> Hi, > > I''m thinking about the following situation and I know there are some > things I have to understand: > > I want to use two SUN-Servers with the same amount of storage capacity > on both of them and I want to replicate the filesystem ( zfs ) > incrementally two times a day from the first to the second one. > > I know that the zfs send/receive commands will do the job, but I don''t > understand exactly how zfs will know what have to be transferred.. > Is it > the difference to the last snapshot? > > If yes, does that mean that I have to keep all snapshots to achieve an > "incremental-forever" configuration? --> That''s my goal! > > > > > regards, > > Tobias Exner > > > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
If I read the man page right, you might only have to keep a minimum of two on each side (maybe even just one on the receiving side), although I might be tempted to keep an extra just in case; say near current, 24 hours old, and a week old (space permitting for the larger interval of the last one). Adjust frequency, spacing, and number according to available space, keeping in mind that the more COW-ing between snapshots (the longer interval if activity is more or less constant), the more space required. (assuming my head is more or less on straight right now...) Of course if you get messed up, you can always resync with a non-incremental transfer, so if you could live with that occasionally, there may be no need for more than two. Your script would certainly have to be careful to check for successful send _and_ receive before removing old snapshots on either side. ssh remotehost exit 1 seems to have a return code of 1 (cool). rsh does _not_ have that desirable property. But that still leaves the problem of how to check the exit status of the commands on both ends of a pipeline; maybe someone has solved that? Anyway, correctly verifying successful completion of the commands on both ends might be a bit tricky, but is critical if you don''t want failures or the need for frequent non-incremental transfers. This message posted from opensolaris.org