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 B2FFA10ADF for ; Tue, 5 Nov 2013 20:44:39 +0000 (UTC) Received: (qmail 97523 invoked by uid 500); 5 Nov 2013 20:44:39 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 97495 invoked by uid 500); 5 Nov 2013 20:44:38 -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 97486 invoked by uid 99); 5 Nov 2013 20:44:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Nov 2013 20:44:38 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mckenzie.cam@gmail.com designates 209.85.160.53 as permitted sender) Received: from [209.85.160.53] (HELO mail-pb0-f53.google.com) (209.85.160.53) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Nov 2013 20:44:32 +0000 Received: by mail-pb0-f53.google.com with SMTP id up7so7906834pbc.26 for ; Tue, 05 Nov 2013 12:44:11 -0800 (PST) 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=Z5JhuzI/W39vHvNPNuOLjYv3kuuMlR+4hn/wRioP5FQ=; b=LBMJH97065zR/ghdDf+JfDU7XdcNe1OFNlxO/Okq1LPymKktYiJojm5hguDvEfUNHA RkOfymGBbU1aWZQkQmlA2R/3HPFBeEXy0T9izJfx2+eB7T7DEEZIl7/43YG5p3WVBN6m tthuAZ0Qeo/OFsrIm18JH1g+dw7ZMnQJo0EHgDbKIgDMOK5VQqVTqRwRelZurJJlXEBt lyHF898HX21+KGUv6VhzF1yN7hrxVqzRaFPB4fS8TyL6eLvGwxNLE9GXnRu8vJuGaliP 2lbdlA58PH/vvjyvpP7BoMj+mBSwnTIPmPDYuKvAPHIXneWViAB+G07Vfn/P5T2RTcot GjWQ== MIME-Version: 1.0 X-Received: by 10.69.18.1 with SMTP id gi1mr9712257pbd.152.1383684250831; Tue, 05 Nov 2013 12:44:10 -0800 (PST) Received: by 10.68.236.7 with HTTP; Tue, 5 Nov 2013 12:44:10 -0800 (PST) In-Reply-To: <1383635110847-7579237.post@n2.nabble.com> References: <1383626327987-7579232.post@n2.nabble.com> <1383630127781-7579234.post@n2.nabble.com> <1383635110847-7579237.post@n2.nabble.com> Date: Wed, 6 Nov 2013 07:44:10 +1100 Message-ID: Subject: Re: Running Zookeeper in 2 machines From: Cameron McKenzie To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=001a11367632408fc804ea741887 X-Virus-Checked: Checked by ClamAV on apache.org --001a11367632408fc804ea741887 Content-Type: text/plain; charset=ISO-8859-1 I have a similar problem to you. I have more than 2 machines, but only 2 geographically redundant sites. In your situation, you could get some redundancy by running 2 instances on one host, and 1 instance on the other host. This would protect you from temporary network glitches (because the machine with 2 instances can still form a quorum), and will protect you from failure of the machine with the single instance. It will not help you if the machine with 2 instances crashes. In this situation, where the 2 instance machine dies, you can temporarily configure the 1 instance machine to be a single instance cluster, and then when the 2 instance machine is recovered, you can reconfigure the single instance machine to be part of the 3 instance cluster again. This process is manual, and slightly dangerous, because if you restart nodes in the wrong order, you have potential to lose data. This is the approach that I have tested and seems to work, but I'd recommend testing it also. Machine A has ZK instance 1 Machine B has ZK instances 2 and 3 Machine B dies Reconfigure ZK instance 1 so that it only has itself in the cluster. This means that there is no redundancy at this point, but it can form a quorum as its the only instance in the cluster. Restart ZK instance 1 to pickup config changes Fix up Machine B Reconfigure ZK 1 instance to have ZK instances 2 and 3 in its configuration Restart ZK instance 1 to pickup config changes Start ZK instance 2 on Machine B. Wait for ZK instance 1 on Machine A and ZK instance 2 on machine B form a quorum. This is vitally important. If you start instance 3 before a quorum is formed it is possible that instances 2 and 3 will form a quorum. This will cause any updates that have occurred via instance 1 during the outage of Machine B to be lost. Start ZK instance 3 on Machine B This process should become easier once dynamic reconfiguration is implemented (in ZK 3.5 I believe?) because restarts won't be required. cheers Cam On Tue, Nov 5, 2013 at 6:05 PM, erolagnab wrote: > Thanks, I got the idea now. So is it fair to say that it is not possible to > create ZK cluster providing some redundancy with 2 physical machines? If > so, > is there a way to make it happen? > > > > -- > View this message in context: > http://zookeeper-user.578899.n2.nabble.com/Running-Zookeeper-in-2-machines-tp7579232p7579237.html > Sent from the zookeeper-user mailing list archive at Nabble.com. > --001a11367632408fc804ea741887--