Return-Path: X-Original-To: apmail-zookeeper-user-archive@www.apache.org Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EFBCF10A49 for ; Fri, 6 Sep 2013 05:30:43 +0000 (UTC) Received: (qmail 95781 invoked by uid 500); 6 Sep 2013 05:30:40 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 95604 invoked by uid 500); 6 Sep 2013 05:30:39 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 95559 invoked by uid 500); 6 Sep 2013 05:30:37 -0000 Delivered-To: apmail-hadoop-zookeeper-user@hadoop.apache.org Received: (qmail 95554 invoked by uid 99); 6 Sep 2013 05:30:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Sep 2013 05:30:37 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rakeshr@huawei.com designates 119.145.14.65 as permitted sender) Received: from [119.145.14.65] (HELO szxga02-in.huawei.com) (119.145.14.65) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Sep 2013 05:30:30 +0000 Received: from 172.24.2.119 (EHLO szxeml205-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id BHD44867; Fri, 06 Sep 2013 13:30:08 +0800 (CST) Received: from SZXEML455-HUB.china.huawei.com (10.82.67.198) by szxeml205-edg.china.huawei.com (172.24.2.58) with Microsoft SMTP Server (TLS) id 14.1.323.7; Fri, 6 Sep 2013 13:30:06 +0800 Received: from szxeml561-mbx.china.huawei.com ([169.254.5.50]) by SZXEML455-HUB.china.huawei.com ([10.82.67.198]) with mapi id 14.01.0323.007; Fri, 6 Sep 2013 13:30:06 +0800 From: Rakesh R To: "user@zookeeper.apache.org" CC: "zookeeper-user@hadoop.apache.org" Subject: RE: Can ZK be used for my use case? Thread-Topic: Can ZK be used for my use case? Thread-Index: AQHOqlfBPj3FkgxQ8UqDN0i24tlM5Zm3jnWAgACeMpA= Date: Fri, 6 Sep 2013 05:30:05 +0000 Message-ID: References: <1378391817809-7579049.post@n2.nabble.com> <228CE998-4320-46D7-AE06-64CEF06CBD4D@gmail.com> In-Reply-To: <228CE998-4320-46D7-AE06-64CEF06CBD4D@gmail.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.18.170.130] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Virus-Checked: Checked by ClamAV on apache.org Hi Tavi, If I understood the usecase correctly, you have different types of files wh= ich is present on a FTP server. There are 300 clients which would be intere= sted on the file modifications and watching these files, when there is a ve= rsion change they would access those files and will act upon. If this is the case, you can create set of zNodes which will be representin= g each files like /parentNode/file1, /parentNode/file2, /parentNode/file3..= . etc. Interested Clients can add DataWatchers to these files and write your clien= t side logic on recieving the watches notification. For example,=20 Client1 -> /parentNode/file1, /parentNode/file2 Client2 -> /parentNode/file2, /parentNode/file3 Client3 -> /parentNode/file4, /parentNode/file1 Say Client1 wants to modify /parentNode/file2, first he should acquire a lo= ck(please see distributed lock recipe using zookeeper) on the file and afte= r modification should add metadata (host:port, or any other unique key to g= et the trace, who has done the changes) on the zNode /parentNode/file2 and = release the lock. After updating the metadata of /parentNode/file2, Client1= and Client3 would get the data watches notification and can act accordingl= y. All your clients can add child watches to the /parentNode to know the file = addition/creation on the FTPServer and decide whether to add DataWatchers o= r not. Always keep this in mind: Default zNode data size is 1MB and recommended to= keep lesser data on zNode(its tunable/configurable parameter, user can dec= ide). ZooKeeper is designed as a high read, high throughput system for small data= . It is not designed as a large data store to hold very large data values. = As such this 1MB value is a default config option and can be overridden. I= t is not advised to do so - but increasing the size a little bit will proba= bly not damage your system (it all depends on your unique access patterns a= nd these changes should be made with care and at your own risk). Also, network fluctuations could affect the watch notifications, there coul= d be high chance of missing watch notification when it involves network flu= ctuations and should have better handling of ZooKeeper connection events. BTW, How many files would be present in the FTPServer?. Is 300 clients fix= ed always or dynamically grows? What if, the client missed one of the version change notification and would= like to know the frequency of changing the same file again and again? -Rakesh -----Original Message----- From: Martin Kou [mailto:bitanarch@gmail.com]=20 Sent: 06 September 2013 09:23 To: user@zookeeper.apache.org Cc: zookeeper-user@hadoop.apache.org Subject: Re: Can ZK be used for my use case? How large are your files? ZooKeeper is generally not designed for large siz= e storage. Also, it doesn't provide guarantees of watchers being called whe= n network outage is involved. Sent from my iPhone > On Sep 5, 2013, at 7:36 AM, Tavi wrote: >=20 > Hi everyone, >=20 > I have a web application who generates different types of files (at=20 > different version) on the server. Those files must be transferred at=20 > 300 clients (watchers) and, after transfer, each client must modify=20 > every file for his purpose. The "client" is a simple java stand alone=20 > application installed on my user PC. > Today my users must download manually their files from an FTP server=20 > and they must use a java library to convert their files. Of course, I=20 > don't know if they do this when the file version changes, I don't have=20 > any trace who did it ... >=20 > My idea is to use a ZK server with 300 clients, each client will be=20 > monitoring a specific namespace for changes (for example : client 1=20 > will monitor /app1 and app2, client 2 -> app 2 only ...). Every=20 > namespace will contain the name of the file, his location, his version=20 > ... When the file version will change, the java client will use the=20 > information to retrieve and to modify the file from my central FTP.=20 > "My leader" needs to know which user is connected and he must=20 > synchronize the downloads to avoid network bottlenecks. >=20 > Does ZK fits in this scenario? >=20 > Thanks for your time, > Tavi >=20 >=20 >=20 >=20 > -- > View this message in context:=20 > http://zookeeper-user.578899.n2.nabble.com/Can-ZK-be-used-for-my-use-c > ase-tp7579049.html Sent from the zookeeper-user mailing list archive=20 > at Nabble.com.