You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Tim Molter <ti...@gmail.com> on 2015/06/20 14:47:59 UTC

Purge zookeeper data best method?

I found two methods for purging zookeeper data

1) Using PurgeTxnLog

2) Setting zoo.cfg with:

# Enable regular purging of old data and transaction logs every 24 hours
autopurge.purgeInterval=24
autopurge.snapRetainCount=5

Do both do the same thing? Which one should I use?

Re: Purge zookeeper data best method?

Posted by Tim Molter <ti...@gmail.com>.
Hi Rakesk,

Thank you very much. One key piece of info I missed in the docs was:
"Automatic purging of the snapshots and corresponding transaction logs
was introduced in version 3.4.0 and can be enabled via the following
configuration parameters autopurge.snapRetainCount and
autopurge.purgeInterval."

I understand now. I'll try the automatic way via the config first.

Cheers, Tim

On 2015_06_20 4:22 PM, Rakesh Radhakrishnan wrote:
> Hi Tim,
> 
>>>>> (1) Using PurgeTxnLog
> a utility exposed by ZooKeeper. Administrator can run 'cronjob' on the
> Zookeeper server machine.
> 
>>>>> (2) Setting zoo.cfg with:
> Its automatic purging of snapshots and corresponding transaction logs.
> 
> Probably you can visit this section for more understanding.
> http://zookeeper.apache.org/doc/trunk/zookeeperAdmin.html#Ongoing+Data+Directory+Cleanup
> 
> You will be able to achieve the desired functionality using both the
> options. Anyway internally both are doing the cleanups using PurgeTxnLog
> utility. Only the difference is, (1) is a kind of external scheduling and
> (2) is automatic way.
> 
> IMHO, you can go for automatic purging and admins not required to take
> effort on making cronjob.
> 
> Best Regards,
> Rakesh
> 
> On Sat, Jun 20, 2015 at 6:17 PM, Tim Molter <ti...@gmail.com> wrote:
> 
>> I found two methods for purging zookeeper data
>>
>> 1) Using PurgeTxnLog
>>
>> 2) Setting zoo.cfg with:
>>
>> # Enable regular purging of old data and transaction logs every 24 hours
>> autopurge.purgeInterval=24
>> autopurge.snapRetainCount=5
>>
>> Do both do the same thing? Which one should I use?
>>
> 

Re: Purge zookeeper data best method?

Posted by Rakesh Radhakrishnan <ra...@gmail.com>.
Hi Tim,

>>>> (1) Using PurgeTxnLog
a utility exposed by ZooKeeper. Administrator can run 'cronjob' on the
Zookeeper server machine.

>>>> (2) Setting zoo.cfg with:
Its automatic purging of snapshots and corresponding transaction logs.

Probably you can visit this section for more understanding.
http://zookeeper.apache.org/doc/trunk/zookeeperAdmin.html#Ongoing+Data+Directory+Cleanup

You will be able to achieve the desired functionality using both the
options. Anyway internally both are doing the cleanups using PurgeTxnLog
utility. Only the difference is, (1) is a kind of external scheduling and
(2) is automatic way.

IMHO, you can go for automatic purging and admins not required to take
effort on making cronjob.

Best Regards,
Rakesh

On Sat, Jun 20, 2015 at 6:17 PM, Tim Molter <ti...@gmail.com> wrote:

> I found two methods for purging zookeeper data
>
> 1) Using PurgeTxnLog
>
> 2) Setting zoo.cfg with:
>
> # Enable regular purging of old data and transaction logs every 24 hours
> autopurge.purgeInterval=24
> autopurge.snapRetainCount=5
>
> Do both do the same thing? Which one should I use?
>