You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Florian Leibert <fl...@leibert.de> on 2011/12/06 18:39:06 UTC
Determine if the distributed mode of ZK functions correctly
Hi -
I was wondering if there was an easy way to check if a given zookeeper
server has joined an ensemble successfully and how many nodes of the
ensemble are alive. Of course I could create a test-node on one of the
servers and check the existence on the other ones but wanted to check first
if there was another way.
I looked at the client bindings in the python project as well as the ones
in the ruby project but didn't see that there really was one. I
specifically want to ensure that the servers are communicating with each
other and not form "separate" ensembles.
Thanks,
Florian
Re: Determine if the distributed mode of ZK functions correctly
Posted by Patrick Hunt <ph...@apache.org>.
http://zookeeper.apache.org/doc/r3.3.4/zookeeperAdmin.html#sc_zkCommands
On Tue, Dec 6, 2011 at 1:30 PM, Neha Narkhede <ne...@gmail.com> wrote:
>>> Where can I find this "srsr" command?
>
> It is actually the 4 letter command - "srvr". You can run it like any other
> 4 letter zk command -
>
> echo srvr | nc zk-server zk-port
>
> Thanks,
> Neha
>
> On Tue, Dec 6, 2011 at 1:26 PM, Florian Leibert <fl...@leibert.de> wrote:
>
>> Where can I find this "srsr" command? It's not part of the zkCli syntax nor
>> can I find a reference to it...
>>
>> Thanks,
>> Florian
>>
>> On Tue, Dec 6, 2011 at 11:51 AM, Neha Narkhede <neha.narkhede@gmail.com
>> >wrote:
>>
>> > >> I was wondering if there was an easy way to check if a given zookeeper
>> > server has joined an ensemble successfully and how many nodes of the
>> > ensemble are alive.
>> >
>> > Today, we do this by relying on the Mode reported by the srvr command. If
>> > the value is anything other than leader/follower, it is not participating
>> > in the quorum.
>> > We simply count the total of leader/follower nodes and ensure that they
>> are
>> > higher than a threshold.
>> >
>> > The downside of this approach is having to run srvr periodically.
>> >
>> > Thanks,
>> > Neha
>> >
>> > On Tue, Dec 6, 2011 at 11:44 AM, Florian Leibert <fl...@leibert.de> wrote:
>> >
>> > > Thanks - though I'll have to have knowledge of the other servers and
>> have
>> > > to maintain yet another copy of the server-addresses - I wanted to use
>> it
>> > > within monit to determine if the server is functioning correctly -
>> while
>> > I
>> > > of course have to always change the zoo.cnf in case of topology
>> changes,
>> > I
>> > > now also have to update my monit scripts to add/remove any servers to
>> use
>> > > with the smoketest.
>> > >
>> > > Too bad ZK doesn't expose via the API a get_ensemble_size ~ that would
>> > > allow me to alert in case the ensemble is less than X...
>> > >
>> > > But this helps!
>> > >
>> > > Thanks!
>> > >
>> > > On Tue, Dec 6, 2011 at 11:39 AM, Patrick Hunt <ph...@apache.org>
>> wrote:
>> > >
>> > > > I created the zk-smoketest project explicitly to help ops with this
>> > > > problem:
>> > > > https://github.com/phunt/zk-smoketest
>> > > >
>> > > > Patrick
>> > > >
>> > > > On Tue, Dec 6, 2011 at 9:39 AM, Florian Leibert <fl...@leibert.de>
>> > wrote:
>> > > > > Hi -
>> > > > > I was wondering if there was an easy way to check if a given
>> > zookeeper
>> > > > > server has joined an ensemble successfully and how many nodes of
>> the
>> > > > > ensemble are alive. Of course I could create a test-node on one of
>> > the
>> > > > > servers and check the existence on the other ones but wanted to
>> check
>> > > > first
>> > > > > if there was another way.
>> > > > >
>> > > > > I looked at the client bindings in the python project as well as
>> the
>> > > ones
>> > > > > in the ruby project but didn't see that there really was one. I
>> > > > > specifically want to ensure that the servers are communicating with
>> > > each
>> > > > > other and not form "separate" ensembles.
>> > > > >
>> > > > > Thanks,
>> > > > > Florian
>> > > >
>> > >
>> > >
>> > >
>> > > --
>> > > Best regards,
>> > >
>> > > Florian
>> > > http://twitter.com/flo <http://twitter.com/floleibert>
>> > > http://flori.posterous.com/
>> > >
>> >
>>
>>
>>
>> --
>> Best regards,
>>
>> Florian
>> http://twitter.com/flo <http://twitter.com/floleibert>
>> http://flori.posterous.com/
>>
Re: Determine if the distributed mode of ZK functions correctly
Posted by Neha Narkhede <ne...@gmail.com>.
>> Where can I find this "srsr" command?
It is actually the 4 letter command - "srvr". You can run it like any other
4 letter zk command -
echo srvr | nc zk-server zk-port
Thanks,
Neha
On Tue, Dec 6, 2011 at 1:26 PM, Florian Leibert <fl...@leibert.de> wrote:
> Where can I find this "srsr" command? It's not part of the zkCli syntax nor
> can I find a reference to it...
>
> Thanks,
> Florian
>
> On Tue, Dec 6, 2011 at 11:51 AM, Neha Narkhede <neha.narkhede@gmail.com
> >wrote:
>
> > >> I was wondering if there was an easy way to check if a given zookeeper
> > server has joined an ensemble successfully and how many nodes of the
> > ensemble are alive.
> >
> > Today, we do this by relying on the Mode reported by the srvr command. If
> > the value is anything other than leader/follower, it is not participating
> > in the quorum.
> > We simply count the total of leader/follower nodes and ensure that they
> are
> > higher than a threshold.
> >
> > The downside of this approach is having to run srvr periodically.
> >
> > Thanks,
> > Neha
> >
> > On Tue, Dec 6, 2011 at 11:44 AM, Florian Leibert <fl...@leibert.de> wrote:
> >
> > > Thanks - though I'll have to have knowledge of the other servers and
> have
> > > to maintain yet another copy of the server-addresses - I wanted to use
> it
> > > within monit to determine if the server is functioning correctly -
> while
> > I
> > > of course have to always change the zoo.cnf in case of topology
> changes,
> > I
> > > now also have to update my monit scripts to add/remove any servers to
> use
> > > with the smoketest.
> > >
> > > Too bad ZK doesn't expose via the API a get_ensemble_size ~ that would
> > > allow me to alert in case the ensemble is less than X...
> > >
> > > But this helps!
> > >
> > > Thanks!
> > >
> > > On Tue, Dec 6, 2011 at 11:39 AM, Patrick Hunt <ph...@apache.org>
> wrote:
> > >
> > > > I created the zk-smoketest project explicitly to help ops with this
> > > > problem:
> > > > https://github.com/phunt/zk-smoketest
> > > >
> > > > Patrick
> > > >
> > > > On Tue, Dec 6, 2011 at 9:39 AM, Florian Leibert <fl...@leibert.de>
> > wrote:
> > > > > Hi -
> > > > > I was wondering if there was an easy way to check if a given
> > zookeeper
> > > > > server has joined an ensemble successfully and how many nodes of
> the
> > > > > ensemble are alive. Of course I could create a test-node on one of
> > the
> > > > > servers and check the existence on the other ones but wanted to
> check
> > > > first
> > > > > if there was another way.
> > > > >
> > > > > I looked at the client bindings in the python project as well as
> the
> > > ones
> > > > > in the ruby project but didn't see that there really was one. I
> > > > > specifically want to ensure that the servers are communicating with
> > > each
> > > > > other and not form "separate" ensembles.
> > > > >
> > > > > Thanks,
> > > > > Florian
> > > >
> > >
> > >
> > >
> > > --
> > > Best regards,
> > >
> > > Florian
> > > http://twitter.com/flo <http://twitter.com/floleibert>
> > > http://flori.posterous.com/
> > >
> >
>
>
>
> --
> Best regards,
>
> Florian
> http://twitter.com/flo <http://twitter.com/floleibert>
> http://flori.posterous.com/
>
Re: Determine if the distributed mode of ZK functions correctly
Posted by Florian Leibert <fl...@leibert.de>.
Where can I find this "srsr" command? It's not part of the zkCli syntax nor
can I find a reference to it...
Thanks,
Florian
On Tue, Dec 6, 2011 at 11:51 AM, Neha Narkhede <ne...@gmail.com>wrote:
> >> I was wondering if there was an easy way to check if a given zookeeper
> server has joined an ensemble successfully and how many nodes of the
> ensemble are alive.
>
> Today, we do this by relying on the Mode reported by the srvr command. If
> the value is anything other than leader/follower, it is not participating
> in the quorum.
> We simply count the total of leader/follower nodes and ensure that they are
> higher than a threshold.
>
> The downside of this approach is having to run srvr periodically.
>
> Thanks,
> Neha
>
> On Tue, Dec 6, 2011 at 11:44 AM, Florian Leibert <fl...@leibert.de> wrote:
>
> > Thanks - though I'll have to have knowledge of the other servers and have
> > to maintain yet another copy of the server-addresses - I wanted to use it
> > within monit to determine if the server is functioning correctly - while
> I
> > of course have to always change the zoo.cnf in case of topology changes,
> I
> > now also have to update my monit scripts to add/remove any servers to use
> > with the smoketest.
> >
> > Too bad ZK doesn't expose via the API a get_ensemble_size ~ that would
> > allow me to alert in case the ensemble is less than X...
> >
> > But this helps!
> >
> > Thanks!
> >
> > On Tue, Dec 6, 2011 at 11:39 AM, Patrick Hunt <ph...@apache.org> wrote:
> >
> > > I created the zk-smoketest project explicitly to help ops with this
> > > problem:
> > > https://github.com/phunt/zk-smoketest
> > >
> > > Patrick
> > >
> > > On Tue, Dec 6, 2011 at 9:39 AM, Florian Leibert <fl...@leibert.de>
> wrote:
> > > > Hi -
> > > > I was wondering if there was an easy way to check if a given
> zookeeper
> > > > server has joined an ensemble successfully and how many nodes of the
> > > > ensemble are alive. Of course I could create a test-node on one of
> the
> > > > servers and check the existence on the other ones but wanted to check
> > > first
> > > > if there was another way.
> > > >
> > > > I looked at the client bindings in the python project as well as the
> > ones
> > > > in the ruby project but didn't see that there really was one. I
> > > > specifically want to ensure that the servers are communicating with
> > each
> > > > other and not form "separate" ensembles.
> > > >
> > > > Thanks,
> > > > Florian
> > >
> >
> >
> >
> > --
> > Best regards,
> >
> > Florian
> > http://twitter.com/flo <http://twitter.com/floleibert>
> > http://flori.posterous.com/
> >
>
--
Best regards,
Florian
http://twitter.com/flo <http://twitter.com/floleibert>
http://flori.posterous.com/
Re: Determine if the distributed mode of ZK functions correctly
Posted by Neha Narkhede <ne...@gmail.com>.
>> I was wondering if there was an easy way to check if a given zookeeper
server has joined an ensemble successfully and how many nodes of the
ensemble are alive.
Today, we do this by relying on the Mode reported by the srvr command. If
the value is anything other than leader/follower, it is not participating
in the quorum.
We simply count the total of leader/follower nodes and ensure that they are
higher than a threshold.
The downside of this approach is having to run srvr periodically.
Thanks,
Neha
On Tue, Dec 6, 2011 at 11:44 AM, Florian Leibert <fl...@leibert.de> wrote:
> Thanks - though I'll have to have knowledge of the other servers and have
> to maintain yet another copy of the server-addresses - I wanted to use it
> within monit to determine if the server is functioning correctly - while I
> of course have to always change the zoo.cnf in case of topology changes, I
> now also have to update my monit scripts to add/remove any servers to use
> with the smoketest.
>
> Too bad ZK doesn't expose via the API a get_ensemble_size ~ that would
> allow me to alert in case the ensemble is less than X...
>
> But this helps!
>
> Thanks!
>
> On Tue, Dec 6, 2011 at 11:39 AM, Patrick Hunt <ph...@apache.org> wrote:
>
> > I created the zk-smoketest project explicitly to help ops with this
> > problem:
> > https://github.com/phunt/zk-smoketest
> >
> > Patrick
> >
> > On Tue, Dec 6, 2011 at 9:39 AM, Florian Leibert <fl...@leibert.de> wrote:
> > > Hi -
> > > I was wondering if there was an easy way to check if a given zookeeper
> > > server has joined an ensemble successfully and how many nodes of the
> > > ensemble are alive. Of course I could create a test-node on one of the
> > > servers and check the existence on the other ones but wanted to check
> > first
> > > if there was another way.
> > >
> > > I looked at the client bindings in the python project as well as the
> ones
> > > in the ruby project but didn't see that there really was one. I
> > > specifically want to ensure that the servers are communicating with
> each
> > > other and not form "separate" ensembles.
> > >
> > > Thanks,
> > > Florian
> >
>
>
>
> --
> Best regards,
>
> Florian
> http://twitter.com/flo <http://twitter.com/floleibert>
> http://flori.posterous.com/
>
Re: Determine if the distributed mode of ZK functions correctly
Posted by Florian Leibert <fl...@leibert.de>.
Thanks - though I'll have to have knowledge of the other servers and have
to maintain yet another copy of the server-addresses - I wanted to use it
within monit to determine if the server is functioning correctly - while I
of course have to always change the zoo.cnf in case of topology changes, I
now also have to update my monit scripts to add/remove any servers to use
with the smoketest.
Too bad ZK doesn't expose via the API a get_ensemble_size ~ that would
allow me to alert in case the ensemble is less than X...
But this helps!
Thanks!
On Tue, Dec 6, 2011 at 11:39 AM, Patrick Hunt <ph...@apache.org> wrote:
> I created the zk-smoketest project explicitly to help ops with this
> problem:
> https://github.com/phunt/zk-smoketest
>
> Patrick
>
> On Tue, Dec 6, 2011 at 9:39 AM, Florian Leibert <fl...@leibert.de> wrote:
> > Hi -
> > I was wondering if there was an easy way to check if a given zookeeper
> > server has joined an ensemble successfully and how many nodes of the
> > ensemble are alive. Of course I could create a test-node on one of the
> > servers and check the existence on the other ones but wanted to check
> first
> > if there was another way.
> >
> > I looked at the client bindings in the python project as well as the ones
> > in the ruby project but didn't see that there really was one. I
> > specifically want to ensure that the servers are communicating with each
> > other and not form "separate" ensembles.
> >
> > Thanks,
> > Florian
>
--
Best regards,
Florian
http://twitter.com/flo <http://twitter.com/floleibert>
http://flori.posterous.com/
Re: Determine if the distributed mode of ZK functions correctly
Posted by Patrick Hunt <ph...@apache.org>.
I created the zk-smoketest project explicitly to help ops with this problem:
https://github.com/phunt/zk-smoketest
Patrick
On Tue, Dec 6, 2011 at 9:39 AM, Florian Leibert <fl...@leibert.de> wrote:
> Hi -
> I was wondering if there was an easy way to check if a given zookeeper
> server has joined an ensemble successfully and how many nodes of the
> ensemble are alive. Of course I could create a test-node on one of the
> servers and check the existence on the other ones but wanted to check first
> if there was another way.
>
> I looked at the client bindings in the python project as well as the ones
> in the ruby project but didn't see that there really was one. I
> specifically want to ensure that the servers are communicating with each
> other and not form "separate" ensembles.
>
> Thanks,
> Florian