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 3E79C1191A for ; Fri, 18 Apr 2014 16:55:10 +0000 (UTC) Received: (qmail 21659 invoked by uid 500); 18 Apr 2014 16:55:08 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 21607 invoked by uid 500); 18 Apr 2014 16:55:08 -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 21599 invoked by uid 99); 18 Apr 2014 16:55:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Apr 2014 16:55:08 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of Matthew.Brown@citrix.com designates 66.165.176.63 as permitted sender) Received: from [66.165.176.63] (HELO SMTP02.CITRIX.COM) (66.165.176.63) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Apr 2014 16:55:03 +0000 X-IronPort-AV: E=Sophos;i="4.97,885,1389744000"; d="scan'208";a="121301009" Received: from sjcpex01cl03.citrite.net ([10.216.14.145]) by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA; 18 Apr 2014 16:54:42 +0000 Received: from SJCPEX01CL01.citrite.net ([169.254.1.125]) by SJCPEX01CL03.citrite.net ([10.216.14.145]) with mapi id 14.03.0123.003; Fri, 18 Apr 2014 09:54:41 -0700 From: Matt Brown To: "user@zookeeper.apache.org" , "user@zookeeper.apache.org" Subject: Re: Imposing ZooKeeper ensemble leader. Thread-Topic: Imposing ZooKeeper ensemble leader. Thread-Index: AQHPWvaMQ94+r3eW+0qBC0S7tfOVZ5sX6IKA///hnIA= Date: Fri, 18 Apr 2014 16:54:40 +0000 Message-ID: References: <535106F2.7020604@eurecom.fr> <53513A09.2010900@eurecom.fr> In-Reply-To: <53513A09.2010900@eurecom.fr> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.9.131030 x-originating-ip: [10.13.107.80] Content-Type: text/plain; charset="us-ascii" Content-ID: <911FB5691AF77D49869C4B30066CC5B5@citrix.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Another thing you could try is to send the "stat" command to each server in your ensemble. On a leader it will return "Mode: leader" versus "Mode: follower" for a follower. Of course it's not necessarily guaranteed that the leader at the start of the test will stay the leader throughout. $ echo stat | nc zookeeper1 2181 Zookeeper version: 3.4.5-107--1, built on 05/20/2013 06:34 GMT Clients: ... Latency min/avg/max: 0/0/390 Received: 2334607 Sent: 2631466 Connections: 2 Outstanding: 0 Zxid: 0x90032f244 Mode: leader Node count: 61 On 4/18/14, 10:43 AM, "Paolo Viotti" wrote: >I've solved this by implementing a simple leader election algorithm that >elects as leader the quorum peer with smallest id. > >Thanks anyway. >Best regards, >P > > >On 18/04/2014 13:05, Paolo Viotti wrote: >> Hello, >> >> I'm running some performance experiments which involve ZooKeeper. >> In order to simplify things I'd like to point all clients to the same >> server, and, most importantly, I'd like that server to be the leader >> of the ensemble. >> >> So I was wondering: is there a way to choose and impose a leader of >> the ensemble (thus bypassing the leader election algorithm)..? >> >> Thanks in advance. >> Kind regards, >> Paolo >> >