Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Zookeeper >> mail # user >> Zookeeper ensemble backup questions?

Copy link to this message
Re: Zookeeper ensemble backup questions?
If you back up the entire data/snap dir at any given time on one of the
machine.  You can restore the system using the backup.  It will include
all the committed txn and some inf-light txn up to that point

If you need to be able to optimize the size of backup then you will have
to understand how the server load the snapshot and txnlog. In short, you
don't need the whole dir but just the most recently files

If you really need to be specific about which txns are included in the
backup, one easy way is to make the system idle before doing backup.
Otherwise, you need to write a tool to process the txnlog and snapshot
So there is nothing prevent you from doing a zookeeper backup on the
current release (although it might not be convenient and require some
knowledge about zookeeper)

Thawan Kooburat

On 7/19/13 11:42 AM, "jack ma" <[EMAIL PROTECTED]> wrote:

>Thanks Sergei.
>That is great improvement idea for the zookeeper. I think that zookeeper
>planning to add a new 4lrt command "snap", but it is not ready yet.
>My original questions is based on the current version of zookeeper
>do you have any answers for them?
>Appreciate for the help.
>On Fri, Jul 19, 2013 at 11:19 AM, Sergey Maslyakov
>> Jack,
>> Here is how I see the backup process happening.
>> 1. Zookeeper server can be changed to support a new 4lw that will write
>> the current state of the DataTree into a snapshot file with the path and
>> name provided as an argument to this new command (barring all the
>> permissions, disk space, and other system-level restrictions).
>>Probably, I
>> would ask Zookeeper to save the snapshot in a directory outside of the
>> standard "dataLog" for the sake of cleanliness.
>> 2. When Zookeeper server responds to the new "snapshot" command with
>> success indication, the requesting process knows that the file has been
>> written out and it can go and process it. It can add some metadata and
>> create an archive to store it somewhere, for example. Alternatively,
>> Zookeeper server could stream the data it would have written into a
>> snapshot as the response to the new "snapshot" command. This way, the
>> client becomes responsible for persistence and this lifts a number of
>> permission-related issues (but raises some other issues too). Oh, and by
>> the way, it looks like snapshot files are rather compressible. I did see
>> the factor of 20 and more on the data that I have.
>> 3. Disk cleanups are performed.
>> With this backup procedure the restore would turn into:
>> 1. Stopping all ensemble mebers
>> 2. Wiping out dataDir/version-2 and dataLogDir/version-2
>> 3. Restoring the snapshot taken by the above backup procedure on one of
>> servers into dataDir/version-2
>> 4. Bringing this server online
>> 5. Allowing some time for it to load the snapshot. You could send "isro"
>> 4lw command to it to see when it stops responding with "null". When the
>> response becomes "ro" or "rw", this is when it is ready to populate
>> with its own data
>> 6. Bring up other servers one-by-one, to allow them form a quorum with
>> populated server
>> Hope, this helps! I'd be glad to hear from people who know the
>>internals of
>> Zookeeper server better whether this approach is flawed or robust.
>> Regards,
>> /Sergey
>> On Fri, Jul 19, 2013 at 1:00 PM, jack ma <[EMAIL PROTECTED]> wrote:
>> > I asked those question in the thread
>> >
>> >
>>B+cfdwhOV0JfB04=MpO_+i-4ou=VbL=EG2XS557+j+[EMAIL PROTECTED]%3e
>> > ,
>> > but there is no response for that.
>> >
>> > So I posted those questions again here, hopefully I could get helps
>> > from the community.
>> >
>> > I want to make sure I am fully understanding the procedures of
>> > backup and disaster recovery:
>> >
>> > For the backup procedures at zookeeper assemble: