[postgres@autofailover-1 ~]$ pg_autoctl show state Name | Node | Host:Port | LSN | Reachable | Current State | Assigned State -------+-------+---------------------+------------+-----------+---------------------+-------------------- node_1 | 1 | autofailover-1:5432 | 0/1E000110 | yes | primary | primary node_2 | 2 | autofailover-2:5432 | 0/1E000000 | yes | secondary | secondary node_5 | 5 | autofailover-3:5432 | 0/1E000000 | yes | secondary | secondary
Where:
pg_autoctl run --pgdata data --pgport 5432 > autofailover.log 2>&1 &Run this command to collect the following information:
pg_autoctl -q show systemd --pgdata ~postgres/data > pgautofailover.service
[postgres@autofailover-1 ~]$ sudo journalctl -u pgautofailover.service -- Logs begin at Fri 2021-06-11 21:14:19 UTC, end at Tue 2021-07-13 20:41:55 UTC. -- Jul 13 20:41:25 autofailover-1 systemd[1]: Started pg_auto_failover. Jul 13 20:41:25 autofailover-1 systemd[1]: Starting pg_auto_failover... Jul 13 20:41:25 autofailover-1 pg_autoctl[11773]: 20:41:25 11773 INFO Started pg_autoctl postgres service with pid 11776 Jul 13 20:41:25 autofailover-1 pg_autoctl[11773]: 20:41:25 11773 INFO Started pg_autoctl node-active service with pid 11777 Jul 13 20:41:25 autofailover-1 pg_autoctl[11773]: 20:41:25 11776 INFO /usr/bin/pg_autoctl do service postgres --pgdata /var/lib/pgsql/data -v ... Jul 13 20:41:25 autofailover-1 pg_autoctl[11773]: 20:41:25 11777 INFO Transition complete: current state is now "catchingup" Jul 13 20:41:25 autofailover-1 pg_autoctl[11773]: 20:41:25 11777 INFO Updated the keeper's state from the local PostgreSQL instance, which is running Jul 13 20:41:25 autofailover-1 pg_autoctl[11773]: 20:41:25 11777 INFO pg_autoctl managed to ensure current state "catchingup": PostgreSQL is running Jul 13 20:41:25 autofailover-1 pg_autoctl[11773]: 20:41:25 11776 INFO Postgres is now serving PGDATA "/var/lib/pgsql/data" on port 5432 with pid 11786 Jul 13 20:41:26 autofailover-1 pg_autoctl[11773]: 20:41:26 11777 INFO Monitor assigned new state "secondary" Jul 13 20:41:26 autofailover-1 pg_autoctl[11773]: 20:41:26 11777 INFO FSM transition from "catchingup" to "secondary": Convinced the monitor that I'm up and running, and eligible for promotion again Jul 13 20:41:26 autofailover-1 pg_autoctl[11773]: 20:41:26 11777 INFO Transition complete: current state is now "secondary"
sudo journalctl -u pgautofailover.service --since "2021-07-12 00:30:00" > autofailover1.log
sudo journalctl -u pgautofailover.service --since "2021-07-12 00:30:00" -p err > autofailover1_error.log