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 69807ED7C for ; Thu, 17 Jan 2013 20:46:54 +0000 (UTC) Received: (qmail 19921 invoked by uid 500); 17 Jan 2013 20:46:53 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 19869 invoked by uid 500); 17 Jan 2013 20:46:53 -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 19826 invoked by uid 99); 17 Jan 2013 20:46:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jan 2013 20:46:53 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of saurabh113@gmail.com designates 209.85.220.173 as permitted sender) Received: from [209.85.220.173] (HELO mail-vc0-f173.google.com) (209.85.220.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jan 2013 20:46:47 +0000 Received: by mail-vc0-f173.google.com with SMTP id fl15so2992755vcb.32 for ; Thu, 17 Jan 2013 12:46:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=+xU3JSyV/tje3ch+fF9a6nfY6oZSDyHAIOsWKDu59zY=; b=KEkF/qlGmx9m3VPm35Km3yYCGuLMOJlaPKlkoXFoxefgLYNRwQHOgf6FxgB+bdS8Kk SazlqJRDMcvK8TrxOoBn8i37hjx17CArYG/6FQaaTw0ei3sLpZghKyBrAes25d0UGtNQ 3Vifmfrojan6En6CYrmgaYm72XcFjklyAlZo2vZviUh7ziWNSmEoS6GoEiopOhtqPJqk XHdnKtz5x5TXV+HuJs91iq5kGGJhREsUeCu7XCN9JT/fQMgzwEdmGdyop26Nnb4mcDF/ hVi0HrNyeIHHId3r+1owCCUVEvCzp4qVs1UesDwpajk1yEuJVAeNBDPLAn6N2PujVjJy 3brg== MIME-Version: 1.0 X-Received: by 10.220.228.1 with SMTP id jc1mr6882116vcb.74.1358455586429; Thu, 17 Jan 2013 12:46:26 -0800 (PST) Received: by 10.52.181.6 with HTTP; Thu, 17 Jan 2013 12:46:26 -0800 (PST) In-Reply-To: <8CCCA394C6A14E468D2595453C693AAF0B06693D07@mse19be2.mse19.exchange.ms> References: <8CCCA394C6A14E468D2595453C693AAF0B06693D07@mse19be2.mse19.exchange.ms> Date: Fri, 18 Jan 2013 02:16:26 +0530 Message-ID: Subject: Re: Zookeeper Coodination Service From: Saurabh Dutta To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=14dae9cdc6bdac1c8504d38216d4 X-Virus-Checked: Checked by ClamAV on apache.org --14dae9cdc6bdac1c8504d38216d4 Content-Type: text/plain; charset=ISO-8859-1 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 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:edward.ribeiro@gmail.com] > Sent: Thursday, January 17, 2013 12:06 PM > To: user@zookeeper.apache.org > 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 > 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 > --14dae9cdc6bdac1c8504d38216d4--