Hello,

I asume I have found the answer on question:
"How to determine that a newly added node is already in sync with the
cluster (all data files are transferred to node's tx/data dirs)"

A:
The node doesn't accept the connection until it is synced with the
leader. (according the the source code: in Learner.syncWithLeader(...)
zk.startup() is called at the very end of the method)

So, it is possible to use:
java -cp ... org.apache.zookeeper.ZooKeeperMain -server
newNodeHost:newNodePort stat /knownNode 
And grep the output if there is ConnectException.
If it is then wait for some time and repeat until success (or other
threshold).

Please correct me if you know that this solution doesn't work.

Regards,
Semyon


-----Original Message-----
From: Mathias Herberts [mailto:[email protected]] 
Sent: Wednesday, August 03, 2011 5:37 PM
To: [email protected]
Subject: Re: Upgrade of the cluster. Data completion check

I guess checking the number of znodes via JMX could work no ?
On Aug 3, 2011 6:14 PM, <[email protected]> wrote:
>
> Hello,
>
> We have the project built on zookeeper-3.3.3 which starts the cluster,

> just simple wrapper on zk lib.
>
> Every version of the project has its own path to zookeeper's data/tx 
> folders. But all configs (number of nodes, client ports, etc) - the 
> same.
>
> We release a new version and want to deploy it without stopping the 
> cluster.
> Let's say we change from version A to B
>
> We are executing:
>
> 1. stop node 1 of cluster (v. A)
> 2. start node 1 of cluster (v. B)
> 3. stop node 2 of cluster (v. A)
> 4. start node 2 of cluster (v. B)
> And so on.
>
> The data is automatically transferred to the data/tx directories of 
> the newly started nodes from the still running nodes of project
version A.
>
> The question is: is it possinble to check that the transfer of data 
> completed? Is it correct that it starts automatically?
>
> Action 1, 2, 3, 4, ... can be automated but if they are executed too 
> fast I suppose it's possible to get the incompleted data on the nodes 
> of project's B.
>
> Thank you
> Semyon
>
Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mails are not encrypted and cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The sender
therefore does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.
If verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities
or related financial instruments.

UBS Limited is a company limited by shares incorporated in the United
Kingdom registered in England and Wales with number 2035362.
Registered office: 1 Finsbury Avenue, London EC2M 2PP.  UBS Limited
is authorised and regulated by the Financial Services Authority.

UBS AG is a public company incorporated with limited liability in
Switzerland domiciled in the Canton of Basel-City and the Canton of
Zurich respectively registered at the Commercial Registry offices in
those Cantons with Identification No: CH-270.3.004.646-4 and having
respective head offices at Aeschenvorstadt 1, 4051 Basel and
Bahnhofstrasse 45, 8001 Zurich, Switzerland.  Registered in the
United Kingdom as a foreign company with No: FC021146 and having a
UK Establishment registered at Companies House, Cardiff, with No:
BR 004507.  The principal office of UK Establishment: 1 Finsbury Avenue,
London EC2M 2PP.  In the United Kingdom, UBS AG is authorised and
regulated by the Financial Services Authority.

UBS reserves the right to retain all messages. Messages are protected
and accessed only in legally justified cases.

Reply via email to