Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m13L5-00065L-5Q for pgsql-admin@arkaria.postgresql.org; Wed, 07 Jul 2021 08:55:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m13L2-0008Mi-Kz for pgsql-admin@arkaria.postgresql.org; Wed, 07 Jul 2021 08:55:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m13L2-0008H5-AE for pgsql-admin@lists.postgresql.org; Wed, 07 Jul 2021 08:55:24 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m13Kz-0000zn-W4 for pgsql-admin@postgresql.org; Wed, 07 Jul 2021 08:55:23 +0000 Received: by mail-lf1-x142.google.com with SMTP id y42so2812666lfa.3 for ; Wed, 07 Jul 2021 01:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GlaG/7NHPto6yXGNWmVH/S84U90PrzosP5C5NnRtj1s=; b=pREJesr3JsGJgcwPKiYCqDTEUiYKNYg4j56RYgNyHH+r52/FHWIxomLIKE2t7Ypz1D I4Tza0pPva+J8j+I1I4tL8R4r3ktWCwSVVppWO0grXwO/VOMSDQvs98Fm4LrgPpyTdNf Ju/W/22fxYR48nsDloiuzLHIE0ZzfA7tnI6a38Cau0XOx0A12oFTS3OdtD9TTAQf4KlK D/GYD5uliaEBDoXDddDvdVJdoPolO24yJFTEY4rqj/fdXP+8+Ijaa2+upmKGWLeLHZYf FGWWIZLvpYlfVZcVvgV19VzVCHIzGpeYr66a9hoBHmzbj2R12piIQ6NNBgsxF0TauN/f UcYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GlaG/7NHPto6yXGNWmVH/S84U90PrzosP5C5NnRtj1s=; b=WPJ7b6ZPiELoKwFaPTpwgWB30AZ2IndrNv1LoDHloZ/RrVw0D1f/pSq375mA5+cIj2 4NuZPB6JiJ59toNJX5oMkdgJz3zdtFUq+vOwu6nOAlw4lx/ZNKxg9V2NJIN6w80w2FOq cGYK4tyGFBpNMxURLTAX186MrSbvJpem5JM7haGi3ot6sI1os8ZPoSAya1WyFVbMLXEy WJi3cIcM3oiXvm9i0iHDXm/IYMT38ZGXzrL45xAmw0GQdyWcKFhn9BNcT0pSdbpWES7P GUYisB+80M+C27JcCDziBnBvCMWlmi3/He0+V++Du95zX1YVV0YiHYqIU83/7ctvCfFN p1jw== X-Gm-Message-State: AOAM533Bb6C4bCHtDTFpenFcc/+RLENjtpjAGvIihJf8nC56KkaVgIiY 1n5fugF7je7URikcqNJccG4EldOdJhXhuSkDBho= X-Google-Smtp-Source: ABdhPJzBYonFHwGzF1zZPH+0BviZ804Tl4glEJbOit+3/C1egmaKFLwr13knvFsKM5TgO4KtU4EikTUwryKUgmVFsYs= X-Received: by 2002:a19:dc02:: with SMTP id t2mr18182482lfg.563.1625648120112; Wed, 07 Jul 2021 01:55:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Vijaykumar Jain Date: Wed, 7 Jul 2021 14:25:09 +0530 Message-ID: Subject: Re: Patroni configuration issue To: Deepak tyagi Cc: pgsql-admin Content-Type: multipart/alternative; boundary="000000000000baa8cc05c684b24e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000baa8cc05c684b24e Content-Type: text/plain; charset="UTF-8" On Tue, 6 Jul 2021 at 03:37, Vijaykumar Jain < vijaykumarjain.github@gmail.com> wrote: > I may be wrong in my simulation (my first time), but in that case you will > have to describe how did you setup your cluster, did you use any reference > etc? > maybe that might help me understand this more. > > just following up on this, I was new to etcd and installed v3.5.x and was not sure how to list all keys etc, turns out, I had to set ETCDCTL_API=2, and use the old version commands to list and del key. export ETCDCTL_API=2 # ls does not work on v3 alias ee='etcdctl --endpoints=http://127.0.0.1:2379 ' # i used default namespace and cluster name, so postgres@db:~/patroni_demo$ ee ls --recursive / /service /service/batman /service/batman/members /service/batman/members/postgresql0 /service/batman/members/postgresql1 /service/batman/initialize --- this is the key we need to delete to reinit the db /service/batman/config /service/batman/leader /service/batman/optime /service/batman/optime/leader postgres@db:~/patroni_demo$ ee get /service/batman/initialize 6981912157875070537 # solve i am not leader, server not starting up ee rm /service/batman/initialize PrevNode.Value: 6981912157875070537 and then run patroni again as a fresh setup, and you get your leaders and replica just fine. --000000000000baa8cc05c684b24e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Tue, 6 Jul 2021 at 03:37, Vijaykumar Jain <vijaykumarjain.github@gmail.com> = wrote:
I may be wrong in my simulati= on (my first time), but in that case you will have to describe how did you = setup your cluster, did you use any reference etc?
maybe that might help me understand this more.
<= br>
=

just following up on this, I w= as new to etcd and installed v3.5.x and was not sure how to list all keys e= tc,
turns out, I had to set ETCDCTL_API=3D2, and use the old vers= ion commands to list and del key.=C2=A0

expor= t ETCDCTL_API=3D2 # ls does not work on v3
alias ee=3D'etcdct= l --endpoints=3Dhttp://127.0.0.1:2379= '

# i used default namespace and cluster name= , so
postgres@db:~/patroni_demo$=C2=A0ee ls=C2=A0 --recursive /
/service
/service/batman
/service/batman/membe= rs
/service/batman/members/postgresql0
/service/batman/= members/postgresql1
/service/batman/initialize=C2=A0 =C2=A0--- th= is is the key we need to delete to reinit the db
/service/batman/= config
/service/batman/leader
/service/batman/optime
/service/batman/optime/leader

postgres@db:= ~/patroni_demo$ ee get /service/batman/initialize
69819121578= 75070537

# solve i am not leader, server not start= ing up
ee rm /service/batman/initialize
PrevNode.Value:= 6981912157875070537

and then run patroni &l= t;config> again as a fresh setup, and you get your leaders and replica j= ust fine.


--000000000000baa8cc05c684b24e--