This article addresses whether pg_auto_failover supports two monitor servers for a single cluster and provides steps for migrating a cluster to a new monitor server.
pg_auto_failover does NOT natively support physical streaming replication between two separate clusters managed by two independent monitors.
Each pg_auto_failover keeper relies on its designated monitor to orchestrate its local primary/secondary state machine. Configuring a cluster as a physical standby of another cluster managed by a different monitor will cause state machine conflicts and keeper errors on the second monitor.
PG04 to a new monitor GPDB14).
Execute the disable monitor command on the standby node first, followed by the primary node.
On Standby Node:
pg_autoctl disable monitor --force --pgdata /var/lib/pgsql/haOn Primary Node:
pg_autoctl disable monitor --force --pgdata /var/lib/pgsql/haWarning: The primary node must be registered first so the new monitor initializes it as the group primary.
On Primary Node:
pg_autoctl enable monitor 'postgres://autoctl_node@<NEW_MONITOR_HOST>:5432/pg_auto_failover?sslmode=require' --pgdata /var/lib/pgsql/haOn Standby Node:
pg_autoctl enable monitor 'postgres://autoctl_node@<NEW_MONITOR_HOST>:5432/pg_auto_failover?sslmode=require' --pgdata /var/lib/pgsql/haCheck the HA state on the new monitor node or any database node to ensure the transition was successful.
pg_autoctl show stateExample Output:
Name | Node | Host:Port | TLI: LSN | Connection | Reported State | Assigned State
--------+-------+------------+-----------------+--------------+---------------------+--------------------
node_1 | 1 | pg05:5432 | 1: 0/1001E528 | read-write | primary | primary
node_12 | 12 | pg06:5432 | 1: 0/1001E528 | read-only | secondary | secondary