pkill postgres

主库日志
2024-09-25 16:42:30,579 INFO: no action. I am (postgres-1a86e6d5-0-0), the leader with the lock
2024-09-25 16:42:40,577 INFO: no action. I am (postgres-1a86e6d5-0-0), the leader with the lock
2024-09-25 16:42:50,578 INFO: no action. I am (postgres-1a86e6d5-0-0), the leader with the lock
2024-09-25 16:42:58,823 ERROR: get_postgresql_status
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/patroni/api.py", line 745, in query
    cursor.execute(sql, params)
psycopg2.OperationalError: terminating connection due to administrator command
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/patroni/api.py", line 673, in get_postgresql_status
    row = self.query(stmt.format(postgresql.wal_name, postgresql.lsn_name), retry=retry)[0]
  File "/usr/local/lib/python3.6/site-packages/patroni/api.py", line 655, in query
    return self.server.query(sql, *params)
  File "/usr/local/lib/python3.6/site-packages/patroni/api.py", line 750, in query
    raise PostgresConnectionException('connection problems')
patroni.exceptions.PostgresConnectionException: 'connection problems'
2024-09-25 16:42:58,835 ERROR: get_postgresql_status
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/patroni/api.py", line 744, in query
    with self.patroni.postgresql.connection().cursor() as cursor:
  File "/usr/local/lib/python3.6/site-packages/patroni/postgresql/__init__.py", line 282, in connection
    return self._connection.get()
  File "/usr/local/lib/python3.6/site-packages/patroni/postgresql/connection.py", line 24, in get
    self._connection = psycopg.connect(**self._conn_kwargs)
  File "/usr/local/lib/python3.6/site-packages/patroni/psycopg.py", line 42, in connect
    ret = _connect(*args, **kwargs)
  File "/usr/lib64/python3.6/site-packages/psycopg2/__init__.py", line 130, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/patroni/api.py", line 673, in get_postgresql_status
    row = self.query(stmt.format(postgresql.wal_name, postgresql.lsn_name), retry=retry)[0]
  File "/usr/local/lib/python3.6/site-packages/patroni/api.py", line 655, in query
    return self.server.query(sql, *params)
  File "/usr/local/lib/python3.6/site-packages/patroni/api.py", line 750, in query
    raise PostgresConnectionException('connection problems')
patroni.exceptions.PostgresConnectionException: 'connection problems'
2024-09-25 16:43:00,468 WARNING: Postgresql is not running.
2024-09-25 16:43:00,469 INFO: Lock owner: postgres-1a86e6d5-0-0; I am postgres-1a86e6d5-0-0
2024-09-25 16:43:00,522 INFO: Reaped pid=6013, exit status=0
2024-09-25 16:43:00,523 INFO: pg_controldata:
  pg_control version number: 1300
  Catalog version number: 202107181
  Database system identifier: 7414692467597594783
  Database cluster state: shut down
  pg_control last modified: Wed Sep 25 16:42:57 2024
  Latest checkpoint location: 0/20000028
  Latest checkpoint's REDO location: 0/20000028
  Latest checkpoint's REDO WAL file: 000000040000000000000020
  Latest checkpoint's TimeLineID: 4
  Latest checkpoint's PrevTimeLineID: 4
  Latest checkpoint's full_page_writes: on
  Latest checkpoint's NextXID: 0:753
  Latest checkpoint's NextOID: 16426
  Latest checkpoint's NextMultiXactId: 1
  Latest checkpoint's NextMultiOffset: 0
  Latest checkpoint's oldestXID: 727
  Latest checkpoint's oldestXID's DB: 1
  Latest checkpoint's oldestActiveXID: 0
  Latest checkpoint's oldestMultiXid: 1
  Latest checkpoint's oldestMulti's DB: 1
  Latest checkpoint's oldestCommitTsXid: 0
  Latest checkpoint's newestCommitTsXid: 0
  Time of latest checkpoint: Wed Sep 25 16:42:57 2024
  Fake LSN counter for unlogged rels: 0/3E8
  Minimum recovery ending location: 0/0
  Min recovery ending loc's timeline: 0
  Backup start location: 0/0
  Backup end location: 0/0
  End-of-backup record required: no
  wal_level setting: logical
  wal_log_hints setting: on
  max_connections setting: 200
  max_worker_processes setting: 8
  max_wal_senders setting: 10
  max_prepared_xacts setting: 0
  max_locks_per_xact setting: 64
  track_commit_timestamp setting: off
  Maximum data alignment: 8
  Database block size: 8192
  Blocks per segment of large relation: 131072
  WAL block size: 8192
  Bytes per WAL segment: 16777216
  Maximum length of identifiers: 64
  Maximum columns in an index: 32
  Maximum size of a TOAST chunk: 1996
  Size of a large-object chunk: 2048
  Date/time type storage: 64-bit integers
  Float8 argument passing: by value
  Data page checksum version: 0
  Mock authentication nonce: 31aae6ace80398a228c491656c26444d30ed617352f69068801256c575fd21c3
2024-09-25 16:43:00,524 INFO: Lock owner: postgres-1a86e6d5-0-0; I am postgres-1a86e6d5-0-0
2024-09-25 16:43:00,592 INFO: starting as readonly because i had the session lock
2024-09-25 16:43:00.918 CST [6019] LOG:  pgaudit extension initialized
2024-09-25 16:43:00,927 INFO: postmaster pid=6019
/tmp:5432 - no response
2024-09-25 16:43:00.965 CST [6019] LOG:  redirecting log output to logging collector process
2024-09-25 16:43:00.965 CST [6019] HINT:  Future log output will appear in directory "/pglog".
/tmp:5432 - accepting connections
/tmp:5432 - accepting connections
Wed Sep 25 16:43:01 CST 2024 INFO: on_role_change callback called (action=on_role_change role=replica cluster=postgres-1a86e6d5)
2024-09-25 16:43:02,015 INFO: Lock owner: postgres-1a86e6d5-0-0; I am postgres-1a86e6d5-0-0
2024-09-25 16:43:02,016 INFO: establishing a new patroni connection to the postgres cluster
server signaled
2024-09-25 16:43:02,194 INFO: promoted self to leader because I had the session lock
Wed Sep 25 16:43:02 CST 2024 INFO: pre promote script called
2024-09-25 16:43:02,218 INFO: pre_promote script `/opt/crunchy/bin/postgres-ha/callbacks/pgha-pre-promote.sh` exited with 0
server promoting
2024-09-25 16:43:02,223 INFO: cleared rewind state after becoming the leader
Wed Sep 25 16:43:02 CST 2024 INFO: on_role_change callback called (action=on_role_change role=master cluster=postgres-1a86e6d5)
Wed Sep 25 16:43:02 CST 2024 INFO: New primary still in recovery, waiting one second...
2024-09-25 16:43:03,268 INFO: Lock owner: postgres-1a86e6d5-0-0; I am postgres-1a86e6d5-0-0
2024-09-25 16:43:03,324 INFO: Reaped pid=6433, exit status=0
2024-09-25 16:43:03,450 INFO: no action. I am (postgres-1a86e6d5-0-0), the leader with the lock
2024-09-25 16:43:13,768 INFO: Lock owner: postgres-1a86e6d5-0-0; I am postgres-1a86e6d5-0-0
2024-09-25 16:43:13,820 INFO: Assigning synchronous standby status to ['postgres-1a86e6d5-1-0']
server signaled
2024-09-25 16:43:15,982 INFO: Synchronous standby status assigned to ['postgres-1a86e6d5-1-0']
2024-09-25 16:43:16,048 INFO: no action. I am (postgres-1a86e6d5-0-0), the leader with the lock
2024-09-25 16:43:23,881 INFO: no action. I am (postgres-1a86e6d5-0-0), the leader with the lock
2024-09-25 16:43:33,878 INFO: no action. I am (postgres-1a86e6d5-0-0), the leader with the lock
2024-09-25 16:43:43,877 INFO: no action. I am (postgres-1a86e6d5-0-0), the leader with the lock
备库日志
2024-09-25 16:42:50,592 INFO: no action. I am (postgres-1a86e6d5-1-0), a secondary, and following a leader (postgres-1a86e6d5-0-0)
2024-09-25 16:43:00,601 INFO: no action. I am (postgres-1a86e6d5-1-0), a secondary, and following a leader (postgres-1a86e6d5-0-0)
2024-09-25 16:43:02,138 INFO: no action. I am (postgres-1a86e6d5-1-0), a secondary, and following a leader (postgres-1a86e6d5-0-0)
2024-09-25 16:43:03,428 INFO: no action. I am (postgres-1a86e6d5-1-0), a secondary, and following a leader (postgres-1a86e6d5-0-0)
2024-09-25 16:43:13,896 INFO: no action. I am (postgres-1a86e6d5-1-0), a secondary, and following a leader (postgres-1a86e6d5-0-0)
2024-09-25 16:43:23,916 INFO: no action. I am (postgres-1a86e6d5-1-0), a secondary, and following a leader (postgres-1a86e6d5-0-0)
2024-09-25 16:43:33,893 INFO: no action. I am (postgres-1a86e6d5-1-0), a secondary, and following a leader (postgres-1a86e6d5-0-0)
2024-09-25 16:43:43,900 INFO: no action. I am (postgres-1a86e6d5-1-0), a secondary, and following a leader (postgres-1a86e6d5-0-0)
2024-09-25 16:43:53,904 INFO: no action. I am (postgres-1a86e6d5-1-0), a secondary, and following a leader (postgres-1a86e6d5-0-0)
pkill patroni

主库日志

 
备库日志



















