Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Zookeeper >> mail # user >> Zookeeper Coodination Service


+
Saurabh Dutta 2013-01-17, 14:02
+
Edward Ribeiro 2013-01-17, 17:06
+
Asta, Greg 2013-01-17, 17:13
+
Saurabh Dutta 2013-01-17, 20:46
+
Asta, Greg 2013-01-17, 21:12
+
Saurabh Dutta 2013-01-17, 21:20
Copy link to this message
-
Re: Zookeeper Coodination Service
The resources below should help you get started with leader election in ZK:

https://github.com/apache/zookeeper/tree/trunk/src/recipes/election (code)

http://zookeeper.apache.org/doc/trunk/recipes.html#sc_leaderElection (docs)

Cheers,
Edward

On Thu, Jan 17, 2013 at 8:46 PM, Saurabh Dutta <[EMAIL PROTECTED]> wrote:

> Thanks Edward and Greg.
>
> Can you help me with a small java code snippet to achieve the same?
>
> Thanks
>
> On Thu, Jan 17, 2013 at 10:43 PM, Asta, Greg <[EMAIL PROTECTED]>
> wrote:
>
> > Yeah, we achieved something similar using a simple "VIP".  Once the
> leader
> > election switches, the new leader can activate the VIP, while the old one
> > deactivates it.  DNS with a very short TTL is another way to achieve
> this.
> >
> > -Greg
> >
> > -----Original Message-----
> > From: Edward Ribeiro [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, January 17, 2013 12:06 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Zookeeper Coodination Service
> >
> > Yes, what you have just described is a sweet spot for Zookeeper.
> >
> > Based on your description, you want one of the servers as the leader and
> > while having  the others waiting. Take a look at "Leader Election Recipe"
> > in ZK Tutorials for how to implement this. If the leader goes offline
> then
> > the other machines use ZK to run the election procedure and elect a new
> > leader to serve requests. Of course, you will also need a "router"
> service
> > that also listens to ZK so that it can redirect the requests to the right
> > machine.
> >
> > Edward
> >
> > On Thu, Jan 17, 2013 at 2:02 PM, Saurabh Dutta <[EMAIL PROTECTED]>
> > wrote:
> >
> > > Hi,
> > >
> > > I've a a simple tcp service which will listen on a port for incoming
> > > requests from client. I'd like to have this same service run on
> > > multiple servers in a failsafe manner.
> > >
> > > There will be a client which will initially write to server1 and if it
> > > goes down i want the requests to be directed to server2.
> > >
> > > I'm tyring to write a a zookeeper coordinator which will keep my
> > > services up and if one service goes down i want the other service to
> > > take over and replace it.
> > >
> > > Please help me to explore if this can be done through zookeeper and if
> > > yes how this can be achieved.
> > >
> > > Thanks,
> > > Saurabh
> > >
> >
> > -----
> > No virus found in this message.
> > Checked by AVG - www.avg.com
> > Version: 2012.0.2221 / Virus Database: 2638/5539 - Release Date: 01/17/13
> >
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB