Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g2xNR-0003i7-VZ for pgsql-admin@arkaria.postgresql.org; Thu, 20 Sep 2018 11:44:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g2xNO-0005KV-GR for pgsql-admin@arkaria.postgresql.org; Thu, 20 Sep 2018 11:44:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g2xNO-0005KN-0Y for pgsql-admin@lists.postgresql.org; Thu, 20 Sep 2018 11:44:06 +0000 Received: from mail-ed1-f46.google.com ([209.85.208.46]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g2xNF-0005i2-9y for pgsql-admin@lists.postgresql.org; Thu, 20 Sep 2018 11:44:04 +0000 Received: by mail-ed1-f46.google.com with SMTP id f4-v6so7594676edq.3 for ; Thu, 20 Sep 2018 04:43:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=a9sL5QTpPLKIKrMH3UvAFKPBEaKbxt49imFPsr9ZJ10=; b=DKK2zLvXxrWVSTJ8chnYrCDD4HCd2sc0O6J1eF5P4bPCE76WJN/a/DA4/PvuKoLWuT fZosphCDyo6ArWLNcNVXwjSAbssIGhuwuY0Gw60wSDfPonfLZ2XGRnKUdr9+Cc1px3CY 3kXKSN0USfBPJBtBhfI4QiZhWR5TmptsfOn3hiBNaLlPMHj2tv3ppnHJxYOttr6qYJoY O4llmVohi6DuiUudnSwef9KVgoMv37RTQYxBPqznmjWapdAYGp3eJt/+UfVaMauiE/ZQ lKbT1S8oIBUWZC7PnuGZj5TKMObaFxSpX0C9k0qZIBk+otN9l3AHIXYLBzK1q8VH/32N ZiEA== X-Gm-Message-State: APzg51AiCjVdKMsKrUVKn6cMtN+NP29YNof9nBEtDhydi8fG2uTa1yL/ gnpGXw4anDXmuV0lvPIrYi05FG9T X-Google-Smtp-Source: ANB0VdZ2NCTkb1UmRbnzy8BXCw1X2HcRoz51SLxfJFfc6W+s8IDxY1OyRxqUbVhjlq4wiPoEGruGJw== X-Received: by 2002:a50:b3c8:: with SMTP id t8-v6mr3876461edd.95.1537443834987; Thu, 20 Sep 2018 04:43:54 -0700 (PDT) Received: from ?IPv6:2a02:a03f:4e4d:5200:789b:57a9:3a05:14d5? ([2a02:a03f:4e4d:5200:789b:57a9:3a05:14d5]) by smtp.gmail.com with ESMTPSA id i15-v6sm790132ede.66.2018.09.20.04.43.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 04:43:53 -0700 (PDT) Subject: Re: Repmgr 4, 2 primary servers in cluster To: pgsql-admin@lists.postgresql.org References: From: Boriss Mejias Message-ID: <3c013e09-8535-515f-039f-9bce6d133e45@dcc.uchile.cl> Date: Thu, 20 Sep 2018 13:43:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Language: es-ES Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello Kurt, When you promote a standby node to become primary, you cannot just reconnect the old primary to become a new standby. Both are now separated servers. Both are primary nodes. In the context of repmgr, to reuse the old server as a new standby, you will have to first unregister the old primary with: repmgr primary unregister --node-id More info here: https://repmgr.org/docs/4.1/repmgr-primary-unregister.html Once it's unregistered you have two choices: - Either you rebuild a new standby instance on the same server with 'repmgr standby clone' - or more complex, but useful for large databases, you manually synchronize the existing instance with rsync (while doing a base backup), and create the correct 'recovery.conf' file. Then 'repmgr standby register' with the correct information. Now, if you are interested in a planned switchover, repmgr also has a command for that: https://repmgr.org/docs/4.1/performing-switchover.html I hope that helps Cheers Boriss Van Gompel Kurt wrote on 2018-09-19 20:22: > Hello, > > I'm testing Postgresql 10 with repmgr 4. > > I set up a primary with 1 standby server. > > Afterwards, I stopped the primary server and promoted the standby server to > primary (repmgr standby promote -f /etc/repmgr.conf). > > Now the command 'repmgr -f /etc/repmgr.conf cluster show' shows 2 primary servers. > > How can I turn the 'old primary' server into a standby? > > Thanks in advance for your answers? > > *__________________ > **Kurt VAN GOMPEL* > Database Administration > > /Infrastructure/ > Tel :*+32 (2) 504.66.13* > Fax :*+32 (2) 219.34.61* > Troonstraat 30A 1000 Brussel > *www.hziv.be** > **__________________ > *De HZIV, een andere mutualiteit! > > > -------------------------------------------------------------------------------- > Deze e-mail en alle bijlagen zijn vertrouwelijk. Als deze e-mail niet voor u > bestemd is, vragen wij u dat ons te melden en deze e-mail inclusief alle > bijlagen te verwijderen. > Deze e-mail verbindt de HZIV enkel indien hij afkomstig is van een natuurlijke > persoon die krachtens de wettelijke en/of reglementaire bepalingen werd > aangesteld om de HZIV te vertegenwoordigen en handelt binnen de perken van zijn > bevoegdheid. > ________________________________ > > Ce courriel et toutes ses annexes sont confidentiels. Si ce courriel ne vous est > pas destiné, nous vous prions de nous en informer et de le supprimer ainsi que > ses annexes. > Ce courriel lie uniquement la CAAMI s'il émane d'une personne physique qui en > vertu des dispositions légales et/ou réglementaires, a été désignée pour > représenter la CAAMI et qui agit dans les limites de sa compétence. > ________________________________ > > Diese E-Mail und alle Anlagen sind vertraulich. Falls diese E-Mail nicht für Sie > bestimmt ist, möchten wir Sie bitten uns darüber zu informieren und diese E-Mail > einschlieβend alle Anlagen zu vernichten. > Diese E-Mail verbindet nur die HKIV, indem sie von einer natürlichen Person > stammt, die kraft der gesetzlichen und/oder vorschriftsmäβigen Bestimmungen > angestellt wurde, um die HKIV zu vertreten und im Rahmen ihrer Zuständigkeit > handelt.