Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGBMk-001NmN-AA for pgsql-general@arkaria.postgresql.org; Wed, 27 Nov 2024 06:17:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tGBMi-00CEs1-6f for pgsql-general@arkaria.postgresql.org; Wed, 27 Nov 2024 06:17:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGBMh-00CErs-Q1 for pgsql-general@lists.postgresql.org; Wed, 27 Nov 2024 06:17:31 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tGBMf-004H5z-CC for pgsql-general@lists.postgresql.org; Wed, 27 Nov 2024 06:17:31 +0000 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2ffa49f623cso65518511fa.1 for ; Tue, 26 Nov 2024 22:17:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732688248; x=1733293048; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+8nlfxOjPNriv+201KNu3q+xPlFbfafign2MEIwfc6Y=; b=fjYoe5VgjrX6ShEflhhuhODM0t+1MXjKTq9FvN9JCvaWABYQiIFzab+cnbMaRHdIst IcBCdn/k27Xi5rlJ8Gm0fFHtbLLq0lJUAHMDcbVQx7xonqw+ilJTgxqVRgEHUQF7pFYP VTinD9Hezl0NNZ9sgkJEvoWdSVz6OHTlhRj9rhf/ZIOtT8qk0gVkWT5rXQ95jcjpMv3R xcO9Un04TDbUJOEzO9wiDhDsHVLMkx8MbzVoUMjPUlBylzzTSVaTyHm1jR/JRoyEMfx6 cqqB29evOWuSQuXgBMAMXPW4bFxjQubgpI7GlXaMdAQW51gGfmoadAg5/MtbePvgaSHQ tFjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732688248; x=1733293048; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+8nlfxOjPNriv+201KNu3q+xPlFbfafign2MEIwfc6Y=; b=IOJIw7Xo5tKWzsk8p6v1lu4sVxj0Xg6mVOv/Lh0h6KYbhQ6E9//6aS5cchu0FP/Xv4 vgxK3xTiEkQjjhyBNaAmtLlAkkzt7ihm5LbSGahobo69a1ROs81KFVAEfE/XCFNH+oh+ fSLNtda+kdmhJMOBh4vRH47mLJfh/Gdwv3cU/YKo8lfIaiTfv9KmphdFs+qLenmG6cF9 r50L0AUiYXJAkjfrGrEOV70sy8gYGPm/YhE+KxtWFc19dnzJt3zML2xlAe9D9uoX5jjU eDPP7kOGoIYPZ+ywOJBSJCdO2/yGIpNGia3ie1IouRyCUblFKzARHvK5Xb08ShS/6nlx eUmg== X-Gm-Message-State: AOJu0YwmgPb3exDP1IfWdNTimSVkuxZql06Q/iB8VPRbswkf3Ha1+d0/ v3M73yftAT0gx+9OvJG1NtSfmX9XZmCSVcdl/T2uH3HD3HXsi76g150G4xxkPKXDoOWjRWr6N9U G09xAxNhsQf6cVGLjjCqvBPDHsjZQ7BPBLTg= X-Gm-Gg: ASbGncs4R7yPn4VpTfmh+n1a2vZp5FMRTbvI65bKsRIre+Nq5Dnl9zPRA7la6eb7pbO NTvG0Fkg8bSO91u6OCg7rOw34HAr4Rqy5dvZ1PYDSP49So2IexitbKGgQuMpPqRUE X-Google-Smtp-Source: AGHT+IGr7SQEVsqXfD1dY3v2mFjcKskRRNLTlRiABotusNku2ueFBD5ldlcIqVp0kbrFkNstnveroq0LWlwDlgyzWZQ= X-Received: by 2002:a2e:bcc3:0:b0:2fa:ddb5:77f9 with SMTP id 38308e7fff4ca-2ffd60efc5cmr7709181fa.40.1732688247728; Tue, 26 Nov 2024 22:17:27 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: jayakumar s Date: Wed, 27 Nov 2024 11:47:16 +0530 Message-ID: Subject: Re: DB Switchover using repmgr--Error To: Paul Foerster Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000008330b40627deeb6f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008330b40627deeb6f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Paul, Thanks for your help. I have fixed that issue. Now I am getting one more issue. Can you help to fix the below error? [postgres@post1 bin]$ /usr/pgsql-16/bin/repmgr -f /var/lib/pgsql/repmgr.conf cluster show WARNING: node "standby" not found in "pg_stat_replication" ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string ----+---------+---------+-----------+-----------+----------+----------+----= ------+----------------------------------------------------------------- 1 | primary | primary | * running | | default | 100 | 8 | host=3D192.168.29.193 user=3Drepmgr dbname=3Drepmgr connect_timeout= =3D2 2 | standby | standby | running | ! primary | default | 100 | 8 | host=3D192.168.29.9 user=3Drepmgr dbname=3Drepmgr connect_timeout=3D= 2 WARNING: following issues were detected - node "standby" (ID: 2) is not attached to its upstream node "primary" (ID: 1) [postgres@post1 bin]$ On Tue, Nov 26, 2024 at 3:41=E2=80=AFPM Paul Foerster wrote: > Hi, > > > [postgres@post1 bin]$ ./repmgr -f /var/lib/pgsql/repmgr.conf primary > register > > ERROR: following errors were found in the configuration file: > > syntax error in file "/var/lib/pgsql/repmgr.conf" line 3, near token > "data_directory" > > syntax error in file "/var/lib/pgsql/repmgr.conf" line 6, near token > "log_file" > > [postgres@post1 bin]$ > > > > Conf file: > > > > [postgres@post1 data]$ cat /var/lib/pgsql/repmgr.conf > > node_id=3D1 > > node_name=3Dprimary > > conninfo=3D'host=3D192.168.29.193 user=3Drepmgr dbname=3Drepmgr > connect_timeout=3D2' data_directory=3D'/application/pgsql/data' > failover=3Dautomatic > > promote_command=3D'/usr/pgsql-16/bin/repmgr standby promote -f > /var/lib/pgsql/repmgr.conf --log-to-file' > > follow_command=3D'/usr/pgsql-16/bin/repmgr standby follow -f > /var/lib/pgsql/repmgr.conf --log-to-file --upstream-node-id=3D%n' > > pg_bindir=3D'/usr/pgsql-16/bin' log_file=3D'/usr/pgsql-16/repmgr.log' > > [postgres@post1 data]$ > > I'm not a repmgr guru but at first glance I would say that your config > lacks two line breaks. It should probably look like this: > > node_id=3D1 > node_name=3Dprimary > conninfo=3D'host=3D192.168.29.193 user=3Drepmgr dbname=3Drepmgr connect_t= imeout=3D2' > data_directory=3D'/application/pgsql/data' > failover=3Dautomatic > promote_command=3D'/usr/pgsql-16/bin/repmgr standby promote -f > /var/lib/pgsql/repmgr.conf --log-to-file' > follow_command=3D'/usr/pgsql-16/bin/repmgr standby follow -f > /var/lib/pgsql/repmgr.conf --log-to-file --upstream-node-id=3D%n' > pg_bindir=3D'/usr/pgsql-16/bin' log_file=3D'/usr/pgsql-16/repmgr.log' > > Cheers > Paul --0000000000008330b40627deeb6f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Paul,

Thanks for your hel= p. I have fixed that issue. Now I am getting one more issue. Can you help t= o fix the below error?

[postgres@post1 bin]$ /usr/pgsql-16/bin/repmgr -= f /var/lib/pgsql/repmgr.conf cluster show
WARNING: node "standby&qu= ot; not found in "pg_stat_replication"
=C2=A0ID | Name =C2=A0 = =C2=A0| Role =C2=A0 =C2=A0| Status =C2=A0 =C2=A0| Upstream =C2=A0| Location= | Priority | Timeline | Connection string
----+---------+---------+----= -------+-----------+----------+----------+----------+----------------------= -------------------------------------------
=C2=A01 =C2=A0| primary | pr= imary | * running | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | default =C2=A0| 10= 0 =C2=A0 =C2=A0 =C2=A0| 8 =C2=A0 =C2=A0 =C2=A0 =C2=A0| host=3D192.168.29.19= 3 user=3Drepmgr dbname=3Drepmgr connect_timeout=3D2
=C2=A02 =C2=A0| stan= dby | standby | =C2=A0 running | ! primary | default =C2=A0| 100 =C2=A0 =C2= =A0 =C2=A0| 8 =C2=A0 =C2=A0 =C2=A0 =C2=A0| host=3D192.168.29.9 user=3Drepmg= r dbname=3Drepmgr connect_timeout=3D2

WARNING: following issues were= detected
=C2=A0 - node "standby" (ID: 2) is not attached to i= ts upstream node "primary" (ID: 1)


[postgres@post1 = bin]$

On Tue, Nov 26, 2024 at 3:41=E2=80=AFPM Paul Foerster <<= a href=3D"mailto:paul.foerster@gmail.com">paul.foerster@gmail.com> w= rote:
Hi,

> [postgres@post1 bin]$ ./repmgr -f /var/lib/pgsql/repmgr.conf primary r= egister
> ERROR: following errors were found in the configuration file:
>=C2=A0 =C2=A0syntax error in file "/var/lib/pgsql/repmgr.conf"= ; line 3, near token "data_directory"
>=C2=A0 =C2=A0syntax error in file "/var/lib/pgsql/repmgr.conf"= ; line 6, near token "log_file"
> [postgres@post1 bin]$
>
> Conf file:
>
> [postgres@post1 data]$ cat /var/lib/pgsql/repmgr.conf
> node_id=3D1
> node_name=3Dprimary
> conninfo=3D'host=3D192.168.29.193 user=3Drepmgr dbname=3Drepmgr co= nnect_timeout=3D2' data_directory=3D'/application/pgsql/data' f= ailover=3Dautomatic
> promote_command=3D'/usr/pgsql-16/bin/repmgr standby promote -f /va= r/lib/pgsql/repmgr.conf --log-to-file'
> follow_command=3D'/usr/pgsql-16/bin/repmgr standby follow -f /var/= lib/pgsql/repmgr.conf --log-to-file --upstream-node-id=3D%n'
> pg_bindir=3D'/usr/pgsql-16/bin' log_file=3D'/usr/pgsql-16/= repmgr.log'
> [postgres@post1 data]$

I'm not a repmgr guru but at first glance I would say that your config = lacks two line breaks. It should probably look like this:

node_id=3D1
node_name=3Dprimary
conninfo=3D'host=3D192.168.29.193 user=3Drepmgr dbname=3Drepmgr connect= _timeout=3D2'
data_directory=3D'/application/pgsql/data'
failover=3Dautomatic
promote_command=3D'/usr/pgsql-16/bin/repmgr standby promote -f /var/lib= /pgsql/repmgr.conf --log-to-file'
follow_command=3D'/usr/pgsql-16/bin/repmgr standby follow -f /var/lib/p= gsql/repmgr.conf --log-to-file --upstream-node-id=3D%n'
pg_bindir=3D'/usr/pgsql-16/bin' log_file=3D'/usr/pgsql-16/repmg= r.log'

Cheers
Paul
--0000000000008330b40627deeb6f--