Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING: Can't get <node-name> xlog location. #1846

Open
dumm1 opened this issue Mar 9, 2023 · 6 comments
Open

WARNING: Can't get <node-name> xlog location. #1846

dumm1 opened this issue Mar 9, 2023 · 6 comments

Comments

@dumm1
Copy link

dumm1 commented Mar 9, 2023

Hello,

I attempted to create an HA postgres cluster but the primary resource won't come to alive.
PostgreSQL version: 11.19
Pacemaker version: 2.1.4
OS Distribution: AlmaLinux 9.1

##############################
Cluster and Resource status:

  • Resource Group: master-group:
    • vip-master (ocf:heartbeat:IPaddr2): Stopped
  • Resource Group: slave-group:
    • vip-slave (ocf:heartbeat:IPaddr2): Stopped

Node Attributes:

  • Node: 10.66.59.83:
    • master-pgsql : -INFINITY
    • pgsql-data-status : LATEST
    • pgsql-status : HS:alone
    • pgsql-xlog-loc : 0000000006000098
  • Node: 10.66.59.84:
    • master-pgsql : -INFINITY
    • pgsql-master-baseline : 0000000004000098
    • pgsql-status : HS:alone
    • pgsql-xlog-loc : 0000000004000098
      ##############################

pacemaker.log is repeating below lines,
Mar 09 10:31:16 pgsql(pgsql)[3290789]: INFO: Master does not exist.
Mar 09 10:31:16 pgsql(pgsql)[3290789]: INFO: My data status=LATEST.
Mar 09 10:31:16 pgsql(pgsql)[3290789]: WARNING: Can't get node-1 xlog location.
Mar 09 10:31:16 pgsql(pgsql)[3290789]: WARNING: Can't get node-2 xlog location.
Mar 09 10:31:20 pgsql(pgsql)[3290995]: INFO: Master does not exist.
Mar 09 10:31:20 pgsql(pgsql)[3290995]: INFO: My data status=LATEST.
Mar 09 10:31:20 pgsql(pgsql)[3290995]: WARNING: Can't get node-1 xlog location.
Mar 09 10:31:20 pgsql(pgsql)[3290995]: WARNING: Can't get node-2 xlog location.

I'm sure that the xlog's location is correct when I created the resource.

Am I using the wrong packages?
Do you have any example commands to create this cluster?

@oalbrigt
Copy link
Contributor

oalbrigt commented Mar 9, 2023

Here's an old example of how to do this setup: https://wiki.clusterlabs.org/wiki/PgSQL_Replicated_Cluster

From what I recall there was a couple of keywords that are outdated, but I think you can just remove them from the config file when you get the error until it starts without errors.

@dumm1
Copy link
Author

dumm1 commented Mar 16, 2023

Here's an old example of how to do this setup: https://wiki.clusterlabs.org/wiki/PgSQL_Replicated_Cluster

From what I recall there was a couple of keywords that are outdated, but I think you can just remove them from the config file when you get the error until it starts without errors.

Thanks for your reply. I referred to this example and it worked in my environment.

I'm a little bit curious why it is the vip-rep rather than vip-master.

pcs -f pgsql_cfg resource create pgsql pgsql
pgctl="/usr/bin/pg_ctl"
psql="/usr/bin/psql"
pgdata="/var/lib/pgsql/data/"
rep_mode="sync"
node_list="node1 node2"
restore_command="cp /var/lib/pgsql/pg_archive/%f %p"
primary_conninfo_opt="keepalives_idle=60 keepalives_interval=5 keepalives_count=5"
master_ip="192.168.2.3"

@oalbrigt
Copy link
Contributor

vip-rep is for replication, so it's on it's own network in the example.

@dumm1
Copy link
Author

dumm1 commented Mar 16, 2023

vip-rep is for replication, so it's on it's own network in the example.

I understand it is in its own network environment.

In below 3 commands, the 3rd command with master_ip="192.168.2.3", why the value of master_ip is not the value of ip="192.168.0.3" from the first command?

pcs -f pgsql_cfg resource create vip-master IPaddr2
ip="192.168.0.3"
nic="eth0"
cidr_netmask="24"
op start timeout="60s" interval="0s" on-fail="restart"
op monitor timeout="60s" interval="10s" on-fail="restart"
op stop timeout="60s" interval="0s" on-fail="block"

pcs -f pgsql_cfg resource create vip-rep IPaddr2
ip="192.168.2.3"
nic="eth2"
cidr_netmask="24"
meta migration-threshold="0"
op start timeout="60s" interval="0s" on-fail="stop"
op monitor timeout="60s" interval="10s" on-fail="restart"
op stop timeout="60s" interval="0s" on-fail="ignore"

pcs -f pgsql_cfg resource create pgsql pgsql
pgctl="/usr/bin/pg_ctl"
psql="/usr/bin/psql"
pgdata="/var/lib/pgsql/data/"
rep_mode="sync"
node_list="node1 node2"
restore_command="cp /var/lib/pgsql/pg_archive/%f %p"
primary_conninfo_opt="keepalives_idle=60 keepalives_interval=5 keepalives_count=5"
master_ip="192.168.2.3" \

@oalbrigt
Copy link
Contributor

Ah. That's probably due to the devs not thinking of a better name for the parameter when they made the pgsql agent, but at least the metadata says it's for replication:
https://github.com/ClusterLabs/resource-agents/blob/main/heartbeat/pgsql#L339-L341

@dumm1
Copy link
Author

dumm1 commented Mar 17, 2023

Ah. That's probably due to the devs not thinking of a better name for the parameter when they made the pgsql agent, but at least the metadata says it's for replication: https://github.com/ClusterLabs/resource-agents/blob/main/heartbeat/pgsql#L339-L341

Thank you for quoting the description from metadata

Master's floating IP address to be connected from hot standby.
This parameter is used for "primary_conninfo" in recovery.conf.
This is required for replication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants