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 C18919254 for ; Tue, 3 Jul 2012 19:48:39 +0000 (UTC) Received: (qmail 10793 invoked by uid 500); 3 Jul 2012 19:48:39 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 10752 invoked by uid 500); 3 Jul 2012 19:48:39 -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 10741 invoked by uid 99); 3 Jul 2012 19:48:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jul 2012 19:48:39 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of raj.cassandra@gmail.com designates 209.85.213.170 as permitted sender) Received: from [209.85.213.170] (HELO mail-yx0-f170.google.com) (209.85.213.170) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jul 2012 19:48:31 +0000 Received: by yenl12 with SMTP id l12so5230747yen.15 for ; Tue, 03 Jul 2012 12:48:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=w7nJytXPfCFlTii0XEMAAk77TT+7/3JLBE87BSnTz1g=; b=S25gIQZwrY6TDze0IXciV4rRYSgxji3Yo8mDYpKPeBJ8tWkUKQPULkntrENYmhh/x6 RS3w1f7snc3i6HF8Jr5tS/XL6KtydOtyUp0pCaSGqoRWxaRLR6mqWeHEs19wKG3gFFpa uP/4Ykei7WLZp958irE+wuXXNB1gVpnuQei1qlXqgM+41TBY37QVsUy0dRiIXsGfxKsP DmKJDj9vKhP3rCQQc1OU6dzC4NYIHk+zSwz3dpMoX9mNAOZyq7Qc8ap7Ufk+qqhKB/dT cFpPAyn931BesQDfaU3akj9isk3zsJzkp/W0c3xK9FtO6Ogmre2SImp8rD+UZ2BOnGMm 9ggQ== MIME-Version: 1.0 Received: by 10.60.8.8 with SMTP id n8mr20147867oea.38.1341344890647; Tue, 03 Jul 2012 12:48:10 -0700 (PDT) Received: by 10.76.4.19 with HTTP; Tue, 3 Jul 2012 12:48:10 -0700 (PDT) In-Reply-To: References: Date: Tue, 3 Jul 2012 15:48:10 -0400 Message-ID: Subject: Re: Zookeeper Leader Election Preference From: Raj N To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=e89a8ff1c6d4ba734f04c3f2315f --e89a8ff1c6d4ba734f04c3f2315f Content-Type: text/plain; charset=ISO-8859-1 Thanks Camille. I was thinking about the same approach. But I was hoping something could be built into Zookeeper to give a hint. Thanks -Raj On Tue, Jul 3, 2012 at 3:28 PM, Camille Fournier wrote: > When I was doing a similar thing, we would start the 2 nodes in the primary > first (which will get a leader elected), then start the 3rd in the backup. > We also had a script set up to monitor the 3rd ZK and restart it if it > became leader. Hacky but it works. > > The challenge is that some of the monitoring commands can timeout across > data centers because our monitoring network connection logic is broken, so > use the most lightweight monitor possible for this. stat is probably it. > > C > > On Tue, Jul 3, 2012 at 3:16 PM, Raj N wrote: > > > Hi experts, > > I am trying to setup a Zookeeper ensemble of 3 nodes across 2 DCs. 2 > > of the 3 will run in the primary. And 1 will run in the secondary DC. Is > > there a way to hint that the leader should be selected from the 2 nodes > in > > the primary DC. I am trying to avoid the case where the node in the > > secondary DC is the leader since that means I will have to pay for the > WAN > > latency for every write request. > > > > Thanks > > -Raj > > > --e89a8ff1c6d4ba734f04c3f2315f--