You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by "Siman, Aleksandr" <AS...@luxoft.com> on 2013/12/18 15:04:23 UTC

Server addresses in a cluster

Hello!

How to get list of server addresses in a cluster in runtime, the one that can be found in config file, like:
server.1=localhost:2888:3888
server.2=localhost:2889:3889
server.3=localhost:2890:3890

Thank you!


________________________________

This e-mail and any attachment(s) are intended only for the recipient(s) named above and others who have been specifically authorized to receive them. They may contain confidential information. If you are not the intended recipient, please do not read this email or its attachment(s). Furthermore, you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and then delete this e-mail and any attachment(s) or copies thereof from your system. Thank you.

Re: Server addresses in a cluster

Posted by Alexander Shraer <sh...@gmail.com>.
there's a Java API (getConfig), Its basically a wrapper around get
/zookeeper/config. But only in trunk, not 3.4.5.



On Wed, Dec 18, 2013 at 11:32 AM, Marshall McMullen <
marshall.mcmullen@gmail.com> wrote:

> I wrongly assumed there was a corresponding Java API for this but perhaps
> not. Worst case you can just "get /zookeeper/config".
>
> Here's the draft documentation:
>
> https://docs.google.com/a/zentire.com/document/d/1AF8pIfQbN5cKxe0c4cQ4_DW6ZjBJqSkyANcTGUwkzjc/edit
>
>
>
> On Wed, Dec 18, 2013 at 7:57 AM, Siman, Aleksandr <AS...@luxoft.com>
> wrote:
>
> > I am interested in Java API so I have looked into sources of `
> > org.apache.zookeeper` v3.4.5 and have not found any `GetConfig`.
> > What I have found is only `
> > javax.security.auth.login.Configuration.getConfiguration() `.
> >
> > -----Original Message-----
> > From: Marshall McMullen [mailto:marshall.mcmullen@gmail.com]
> > Sent: Wednesday, December 18, 2013 4:32 PM
> > To: UserZooKeeper
> > Subject: Re: Server addresses in a cluster
> >
> > There is a programmatic API to get the dynamic config:
> >
> > C: zoo_getconfig
> > Java: GetConfig
> >
> >
> > On Wed, Dec 18, 2013 at 7:04 AM, Siman, Aleksandr <AS...@luxoft.com>
> > wrote:
> >
> > > Hello!
> > >
> > > How to get list of server addresses in a cluster in runtime, the one
> > > that can be found in config file, like:
> > > server.1=localhost:2888:3888
> > > server.2=localhost:2889:3889
> > > server.3=localhost:2890:3890
> > >
> > > Thank you!
> > >
> > >
> > > ________________________________
> > >
> > > This e-mail and any attachment(s) are intended only for the
> > > recipient(s) named above and others who have been specifically
> > > authorized to receive them. They may contain confidential information.
> > > If you are not the intended recipient, please do not read this email or
> > its attachment(s).
> > > Furthermore, you are hereby notified that any dissemination,
> > > distribution or copying of this e-mail and any attachment(s) is
> > > strictly prohibited. If you have received this e-mail in error, please
> > > immediately notify the sender by replying to this e-mail and then
> > > delete this e-mail and any
> > > attachment(s) or copies thereof from your system. Thank you.
> > >
> >
> > ________________________________
> >
> > This e-mail and any attachment(s) are intended only for the recipient(s)
> > named above and others who have been specifically authorized to receive
> > them. They may contain confidential information. If you are not the
> > intended recipient, please do not read this email or its attachment(s).
> > Furthermore, you are hereby notified that any dissemination, distribution
> > or copying of this e-mail and any attachment(s) is strictly prohibited.
> If
> > you have received this e-mail in error, please immediately notify the
> > sender by replying to this e-mail and then delete this e-mail and any
> > attachment(s) or copies thereof from your system. Thank you.
> >
>

Re: Server addresses in a cluster

Posted by Marshall McMullen <ma...@gmail.com>.
My bad... this is only in the current unreleased 3.5.0 (trunk) version of
zookeeper. For 3.4.6, you can simply read the static configuration file on
the node to get the ensemble since it never changes.


On Wed, Dec 18, 2013 at 12:32 PM, Marshall McMullen <
marshall.mcmullen@gmail.com> wrote:

> I wrongly assumed there was a corresponding Java API for this but perhaps
> not. Worst case you can just "get /zookeeper/config".
>
> Here's the draft documentation:
>
> https://docs.google.com/a/zentire.com/document/d/1AF8pIfQbN5cKxe0c4cQ4_DW6ZjBJqSkyANcTGUwkzjc/edit
>
>
>
> On Wed, Dec 18, 2013 at 7:57 AM, Siman, Aleksandr <AS...@luxoft.com>wrote:
>
>> I am interested in Java API so I have looked into sources of `
>> org.apache.zookeeper` v3.4.5 and have not found any `GetConfig`.
>> What I have found is only `
>> javax.security.auth.login.Configuration.getConfiguration() `.
>>
>> -----Original Message-----
>> From: Marshall McMullen [mailto:marshall.mcmullen@gmail.com]
>> Sent: Wednesday, December 18, 2013 4:32 PM
>> To: UserZooKeeper
>> Subject: Re: Server addresses in a cluster
>>
>> There is a programmatic API to get the dynamic config:
>>
>> C: zoo_getconfig
>> Java: GetConfig
>>
>>
>> On Wed, Dec 18, 2013 at 7:04 AM, Siman, Aleksandr <AS...@luxoft.com>
>> wrote:
>>
>> > Hello!
>> >
>> > How to get list of server addresses in a cluster in runtime, the one
>> > that can be found in config file, like:
>> > server.1=localhost:2888:3888
>> > server.2=localhost:2889:3889
>> > server.3=localhost:2890:3890
>> >
>> > Thank you!
>> >
>> >
>> > ________________________________
>> >
>> > This e-mail and any attachment(s) are intended only for the
>> > recipient(s) named above and others who have been specifically
>> > authorized to receive them. They may contain confidential information.
>> > If you are not the intended recipient, please do not read this email or
>> its attachment(s).
>> > Furthermore, you are hereby notified that any dissemination,
>> > distribution or copying of this e-mail and any attachment(s) is
>> > strictly prohibited. If you have received this e-mail in error, please
>> > immediately notify the sender by replying to this e-mail and then
>> > delete this e-mail and any
>> > attachment(s) or copies thereof from your system. Thank you.
>> >
>>
>> ________________________________
>>
>> This e-mail and any attachment(s) are intended only for the recipient(s)
>> named above and others who have been specifically authorized to receive
>> them. They may contain confidential information. If you are not the
>> intended recipient, please do not read this email or its attachment(s).
>> Furthermore, you are hereby notified that any dissemination, distribution
>> or copying of this e-mail and any attachment(s) is strictly prohibited. If
>> you have received this e-mail in error, please immediately notify the
>> sender by replying to this e-mail and then delete this e-mail and any
>> attachment(s) or copies thereof from your system. Thank you.
>>
>
>

Re: Server addresses in a cluster

Posted by Marshall McMullen <ma...@gmail.com>.
I wrongly assumed there was a corresponding Java API for this but perhaps
not. Worst case you can just "get /zookeeper/config".

Here's the draft documentation:
https://docs.google.com/a/zentire.com/document/d/1AF8pIfQbN5cKxe0c4cQ4_DW6ZjBJqSkyANcTGUwkzjc/edit



On Wed, Dec 18, 2013 at 7:57 AM, Siman, Aleksandr <AS...@luxoft.com> wrote:

> I am interested in Java API so I have looked into sources of `
> org.apache.zookeeper` v3.4.5 and have not found any `GetConfig`.
> What I have found is only `
> javax.security.auth.login.Configuration.getConfiguration() `.
>
> -----Original Message-----
> From: Marshall McMullen [mailto:marshall.mcmullen@gmail.com]
> Sent: Wednesday, December 18, 2013 4:32 PM
> To: UserZooKeeper
> Subject: Re: Server addresses in a cluster
>
> There is a programmatic API to get the dynamic config:
>
> C: zoo_getconfig
> Java: GetConfig
>
>
> On Wed, Dec 18, 2013 at 7:04 AM, Siman, Aleksandr <AS...@luxoft.com>
> wrote:
>
> > Hello!
> >
> > How to get list of server addresses in a cluster in runtime, the one
> > that can be found in config file, like:
> > server.1=localhost:2888:3888
> > server.2=localhost:2889:3889
> > server.3=localhost:2890:3890
> >
> > Thank you!
> >
> >
> > ________________________________
> >
> > This e-mail and any attachment(s) are intended only for the
> > recipient(s) named above and others who have been specifically
> > authorized to receive them. They may contain confidential information.
> > If you are not the intended recipient, please do not read this email or
> its attachment(s).
> > Furthermore, you are hereby notified that any dissemination,
> > distribution or copying of this e-mail and any attachment(s) is
> > strictly prohibited. If you have received this e-mail in error, please
> > immediately notify the sender by replying to this e-mail and then
> > delete this e-mail and any
> > attachment(s) or copies thereof from your system. Thank you.
> >
>
> ________________________________
>
> This e-mail and any attachment(s) are intended only for the recipient(s)
> named above and others who have been specifically authorized to receive
> them. They may contain confidential information. If you are not the
> intended recipient, please do not read this email or its attachment(s).
> Furthermore, you are hereby notified that any dissemination, distribution
> or copying of this e-mail and any attachment(s) is strictly prohibited. If
> you have received this e-mail in error, please immediately notify the
> sender by replying to this e-mail and then delete this e-mail and any
> attachment(s) or copies thereof from your system. Thank you.
>

RE: Server addresses in a cluster

Posted by "Siman, Aleksandr" <AS...@luxoft.com>.
I am interested in Java API so I have looked into sources of ` org.apache.zookeeper` v3.4.5 and have not found any `GetConfig`.
What I have found is only ` javax.security.auth.login.Configuration.getConfiguration() `.

-----Original Message-----
From: Marshall McMullen [mailto:marshall.mcmullen@gmail.com]
Sent: Wednesday, December 18, 2013 4:32 PM
To: UserZooKeeper
Subject: Re: Server addresses in a cluster

There is a programmatic API to get the dynamic config:

C: zoo_getconfig
Java: GetConfig


On Wed, Dec 18, 2013 at 7:04 AM, Siman, Aleksandr <AS...@luxoft.com> wrote:

> Hello!
>
> How to get list of server addresses in a cluster in runtime, the one
> that can be found in config file, like:
> server.1=localhost:2888:3888
> server.2=localhost:2889:3889
> server.3=localhost:2890:3890
>
> Thank you!
>
>
> ________________________________
>
> This e-mail and any attachment(s) are intended only for the
> recipient(s) named above and others who have been specifically
> authorized to receive them. They may contain confidential information.
> If you are not the intended recipient, please do not read this email or its attachment(s).
> Furthermore, you are hereby notified that any dissemination,
> distribution or copying of this e-mail and any attachment(s) is
> strictly prohibited. If you have received this e-mail in error, please
> immediately notify the sender by replying to this e-mail and then
> delete this e-mail and any
> attachment(s) or copies thereof from your system. Thank you.
>

________________________________

This e-mail and any attachment(s) are intended only for the recipient(s) named above and others who have been specifically authorized to receive them. They may contain confidential information. If you are not the intended recipient, please do not read this email or its attachment(s). Furthermore, you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and then delete this e-mail and any attachment(s) or copies thereof from your system. Thank you.

Re: Server addresses in a cluster

Posted by Marshall McMullen <ma...@gmail.com>.
There is a programmatic API to get the dynamic config:

C: zoo_getconfig
Java: GetConfig


On Wed, Dec 18, 2013 at 7:04 AM, Siman, Aleksandr <AS...@luxoft.com> wrote:

> Hello!
>
> How to get list of server addresses in a cluster in runtime, the one that
> can be found in config file, like:
> server.1=localhost:2888:3888
> server.2=localhost:2889:3889
> server.3=localhost:2890:3890
>
> Thank you!
>
>
> ________________________________
>
> This e-mail and any attachment(s) are intended only for the recipient(s)
> named above and others who have been specifically authorized to receive
> them. They may contain confidential information. If you are not the
> intended recipient, please do not read this email or its attachment(s).
> Furthermore, you are hereby notified that any dissemination, distribution
> or copying of this e-mail and any attachment(s) is strictly prohibited. If
> you have received this e-mail in error, please immediately notify the
> sender by replying to this e-mail and then delete this e-mail and any
> attachment(s) or copies thereof from your system. Thank you.
>