repmgr搭建
| IP | 用户 | 密码 |
|---|---|---|
| 10.197.165.133 | repmgr | repmgr |
| 10.197.165.134 | repmgr | repmgr |
| 10.197.165.135 | repmgr | repmgr |
repmgr编译安装
mkdir -p /opt/repmgr && cd /opt/repmgr wget https://github.com/EnterpriseDB/repmgr/releases/download/v5.5.0/repmgr-5.5.0.tar.gz tar xvf repmgr-5.5.0.tar.gz cd repmgr-5.5.0 su - postgres sudo dnf install -y libcurl-devel json-c-devel cd /opt/repmgr ./configure make && make install [postgres@hjx-rocky8-clickhouse01 repmgr-5.5.0]$ repmgr --version repmgr 5.5.0
编译安装后,在PostgreSQL安装目录的bin目录中会多出repmgr和repmgrd两个二进制文件。repmgr是一个命令行工具,日常操作主要通过repmgr进行操作,功能包括集群状态查看、switch over、克隆备库、失效节点重新加入等。repmgrd 是一个守护进程,支持故障检测、failover,监控和记录集群信息以及自定义脚本接受集群事件通知event_notification_command,比如邮件通知和告警等。
常用命令
repmgr primary register/unregister,注册/注销主库 repmgr standby clone,克隆备库 repmgr standby promote,提升为主库 repmgr standby follow,重新指向新的主库 repmgr node status,查看节点状态 repmgr node check,校验节点状态 repmgr cluster show,查看集群状态 repmgr cluster event,查看集群已发生事件 repmgr cluster crosscheck,集群中各个节点交叉检测 repmgr cluster cleanup,清除历史集群监控信息
主库配置(133)
配置主库postgresql.conf文件
max_wal_senders = 10 # 每个备库一个walsender进程,该值需要大于备库的数量 max_replication_slots = 10 # 复制槽的数量,用于防止WAL日志被回收导致备库丢失的问题 wal_level = 'replica' # WAL日志级别,流复制要求必须大于等于replica级别 hot_standby = on # 备库是否支持只读操作,默认为on,否则只作为备库
创建元信息用户
postgres=# create user repmgr; CREATE ROLE postgres=# alter user repmgr with password 'test1234'; ALTER ROLE postgres=# alter user repmgr superuser; ALTER ROLE postgres=# create database repmgr owner repmgr; CREATE DATABASE
配置repmgr.conf
[postgres@hjx-rocky8-clickhouse01 ~]$ pwd /home/postgres [postgres@hjx-rocky8-clickhouse01 ~]$ vim repmgr_primary.conf
# repmgr node information node_id=1 # 节点ID node_name='primary_node' # 节点名称 conninfo='host=10.197.165.133 port=5432 user=repmgr dbname=repmgr' # 连接串信息 data_directory='/home/postgres/pgdata' # 实例目录 replication_user=repmgr # 流复制用户 repmgr_bindir='/usr/local/pgsql/bin' # repmgr 可执行文件所在目录 pg_bindir='/usr/local/pgsql/bin' # PostgreSQL 可执行文件所在目录 # replication monitoring_history=yes # Whether to write monitoring data to the "monitoring_history" table # location='location1' # 定义节点位置的任意字符串,在故障转移期间用于检查当前主节点的可见性 priority=100 # 节点优先级,选主时可能使用到。(lsn > priority > node_id) # 0 代表该节点不会被提升为主节点 reconnect_interval=10 # 故障转移之前,尝试重新连接的间隔(以秒为单位) reconnect_attempts=6 # 故障转移之前,尝试重新连接的次数 connection_check_type=ping # ping: repmg 使用PQPing() 方法测试连接 # connection: 尝试与节点建立新的连接 # query: 通过现有连接在节点上执行 SQL 语句 monitor_interval_secs=5 # 写入监控数据的间隔 use_replication_slots=true # 是否使用复制槽 # log configuration log_level='INFO' # Log level: possible values are DEBUG, INFO, NOTICE, # WARNING, ERROR, ALERT, CRIT or EMERG log_facility='STDERR' # Logging facility: possible values are STDERR, or for # syslog integration, one of LOCAL0, LOCAL1, ..., LOCAL7, USER log_file='/tmp/repmgr.log' # STDERR can be redirected to an arbitrary file log_status_interval=30 # interval (in seconds) for repmgrd to log a status message # service management command service_start_command='/usr/local/pgsql/bin/pg_ctl -D /home/postgres/pgdata start' # 数据库启动 service_stop_command='/usr/local/pgsql/bin/pg_ctl -D /home/postgres/pgdata stop' # 数据库停止 service_restart_command='/usr/local/pgsql/bin/pg_ctl -D /home/postgres/pgdata restart' # 数据库重启 service_reload_command='/usr/local/pgsql/bin/pg_ctl -D /home/postgres/pgdata reload' # 数据库重加载 repmgrd_pid_file='/tmp/repmgrd.pid' # repmgrd守护进程pid repmgrd_service_start_command='/usr/local/pgsql/bin/repmgrd -f /home/postgres/repmgr.conf start' # repmgrd启动 repmgrd_service_stop_command='kill -9 `cat /tmp/repmgrd.pid`' # repmgrd停止 # failover failover='automatic' # one of 'automatic', 'manual'. # determines what action to take in the event of upstream failure # # 'automatic': repmgrd will automatically attempt to promote the # node or follow the new upstream node # 'manual': repmgrd will take no action and the node will require # manual attention to reattach it to replication #priority=100 # indicates a preferred priority for promoting nodes; # a value of zero prevents the node being promoted to primary # (default: 100) promote_command='repmgr -f /home/postgres/repmgr_primary.conf standby promote' # command repmgrd executes when promoting a new primary; use something like: # # repmgr standby promote -f /etc/repmgr.conf # follow_command='repmgr standby follow -f /home/postgres/repmgr_primary.conf --upstream-node-id=%n' # command repmgrd executes when instructing a standby to follow a new primary; # use something like: # # repmgr standby follow -f /etc/repmgr.conf --upstream-node-id=%n # #primary_visibility_consensus=false # If "true", only continue with failover if no standbys have seen # the primary node recently. *Must* be the same on all nodes.s
注册主节点
cat >> /home/postgres/.pgpass << 'EOF' 10.197.165.133:5432:*:repmgr:test1234 10.197.165.134:5432:*:repmgr:test1234 10.197.165.135:5432:*:repmgr:test1234 EOF cat >> $PGDATA/pg_hba.conf << 'EOF' host replication all 10.197.165.134/20 md5 host replication all 10.197.165.135/20 md5 host repmgr repmgr 0/0 md5 EOF [postgres@hjx-rocky8-clickhouse01 ~]$ repmgr -f repmgr_primary.conf primary register INFO: connecting to primary database... NOTICE: attempting to install extension "repmgr" NOTICE: "repmgr" extension successfully installed NOTICE: primary node record (ID: 1) registered #启动repmgrd -f repmgr_primary.conf -d守护进程 #启动之前,需要先在postgresql.conf配置文件中添加shared_preload_libraries = 'repmgr' [postgres@hjx-rocky8-clickhouse01 ~]repmgrd -f repmgr_primary.conf -d [postgres@hjx-rocky8-clickhouse01 ~]$ ps -ef |grep repmgr postgres 40044 3420 0 18:01 ? 00:00:00 postgres: repmgr repmgr 10.197.165.133(51632) idle postgres 40046 1 0 18:01 ? 00:00:00 repmgrd -f repmgr_primary.conf -d postgres 40050 36484 0 18:01 pts/0 00:00:00 grep --color=auto repmgr
注册成功之后,repmgr库会安装插件,以及创建一些元消息表核视图
[postgres@hjx-rocky8-clickhouse01 ~]$ psql -U repmgr -d repmgr psql (18.3) Type "help" for help. repmgr=# \d List of relations Schema | Name | Type | Owner --------+--------------------+-------+-------- repmgr | events | table | repmgr repmgr | monitoring_history | table | repmgr repmgr | nodes | table | repmgr repmgr | replication_status | view | repmgr repmgr | show_nodes | view | repmgr repmgr | voting_term | table | repmgr (6 rows) repmgr.events:records events of interest repmgr.nodes:实例中各个节点的连接和状态信息 repmgr.monitoring_history:由repmgrd写入,备库的历史监控信息 repmgr.show_nodes:based on the table repmgr.nodes, additionally showing the name of the server's upstream node repmgr.replication_status:when repmgrd's monitoring is enabled, shows current monitoring status for each standby.
使用命令查看当前集群状态
[postgres@hjx-rocky8-clickhouse01 ~]$ repmgr -f repmgr_primary.conf cluster show ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string ----+--------------+---------+-----------+----------+----------+----------+----------+--------------------------------------------------------- 1 | primary_node | primary | * running | | default | 100 | 1 | host=10.197.165.133 port=5432 user=repmgr dbname=repmgr repmgr=# select * from nodes; node_id | upstream_node_id | active | node_name | type | location | priority | conninfo | repluser | slot_nam e | config_file ---------+------------------+--------+--------------+---------+----------+----------+---------------------------------------------------------+----------+----------- ----+------------------------------------ 1 | | t | primary_node | primary | default | 100 | host=10.197.165.133 port=5432 user=repmgr dbname=repmgr | repmgr | repmgr_slo t_1 | /home/postgres/repmgr_primary.conf (1 row)
备库配置(134)
配置repmgr.conf文件
[postgres@hjx-rocky8-clickhouse02 ~]$ cat repmgr_standby.conf # repmgr node information node_id=2 # 节点ID node_name='standby_node' # 节点名称 conninfo='host=10.197.165.134 port=5432 user=repmgr dbname=repmgr' # 连接串信息 data_directory='/home/postgres/pgdata' # 实例目录 replication_user=repmgr # 流复制用户 repmgr_bindir='/usr/local/pgsql/bin' # repmgr 可执行文件所在目录 pg_bindir='/usr/local/pgsql/bin' # PostgreSQL 可执行文件所在目录 # replication monitoring_history=yes # Whether to write monitoring data to the "monitoring_history" table # location='location1' # 定义节点位置的任意字符串,在故障转移期间用于检查当前主节点的可见性 priority=100 # 节点优先级,选主时可能使用到。(lsn > priority > node_id) # 0 代表该节点不会被提升为主节点 reconnect_interval=10 # 故障转移之前,尝试重新连接的间隔(以秒为单位) reconnect_attempts=6 # 故障转移之前,尝试重新连接的次数 connection_check_type=ping # ping: repmg 使用PQPing() 方法测试连接 # connection: 尝试与节点建立新的连接 # query: 通过现有连接在节点上执行 SQL 语句 monitor_interval_secs=5 # 写入监控数据的间隔 use_replication_slots=true # 是否使用复制槽 # log configuration log_level='INFO' # Log level: possible values are DEBUG, INFO, NOTICE, # WARNING, ERROR, ALERT, CRIT or EMERG log_facility='STDERR' # Logging facility: possible values are STDERR, or for # syslog integration, one of LOCAL0, LOCAL1, ..., LOCAL7, USER log_file='/tmp/repmgr.log' # STDERR can be redirected to an arbitrary file log_status_interval=30 # interval (in seconds) for repmgrd to log a status message # service management command service_start_command='/usr/local/pgsql/bin/pg_ctl -D /home/postgres/pgdata start' # 数据库启动 service_stop_command='/usr/local/pgsql/bin/pg_ctl -D /home/postgres/pgdata stop' # 数据库停止 service_restart_command='/usr/local/pgsql/bin/pg_ctl -D /home/postgres/pgdata restart' # 数据库重启 service_reload_command='/usr/local/pgsql/bin/pg_ctl -D /home/postgres/pgdata reload' # 数据库重加载 repmgrd_pid_file='/tmp/repmgrd.pid' # repmgrd守护进程pid repmgrd_service_start_command='/usr/local/pgsql/bin/repmgrd -f /home/postgres/repmgr.conf start' # repmgrd启动 repmgrd_service_stop_command='kill -9 `cat /tmp/repmgrd.pid`' # repmgrd停止 # failover failover='automatic' # one of 'automatic', 'manual'. # determines what action to take in the event of upstream failure # # 'automatic': repmgrd will automatically attempt to promote the # node or follow the new upstream node # 'manual': repmgrd will take no action and the node will require # manual attention to reattach it to replication #priority=100 # indicates a preferred priority for promoting nodes; # a value of zero prevents the node being promoted to primary # (default: 100) promote_command='repmgr -f /home/postgres/repmgr_standby.conf standby promote' # command repmgrd executes when promoting a new primary; use something like: # # repmgr standby promote -f /etc/repmgr.conf # follow_command='repmgr standby follow -f /home/postgres/repmgr_standby.conf --upstream-node-id=%n' # command repmgrd executes when instructing a standby to follow a new primary; # use something like: # # repmgr standby follow -f /etc/repmgr.conf --upstream-node-id=%n # #primary_visibility_consensus=false # If "true", only continue with failover if no standbys have seen # the primary node recently. *Must* be the same on all nodes.s
克隆备库
在真正克隆之前,使用--dry-run试运行一下,可以发现可能的错误。克隆备库默认使用的是pg_basebackup
cat > /home/postgres/.pgpass << 'EOF' 10.197.165.134:5432:*:repmgr:test1234 10.197.165.133:5432:repmgr:repmgr:test1234 10.197.165.134:5432:repmgr:repmgr:test1234 10.197.165.135:5432:repmgr:repmgr:test1234 EOF #停止备库 pg_ctl stop && mv pgdata pgdata.bak #在真正克隆之前,使用`--dry-run`试运行一下,可以发现可能的错误。发现没有错误进行克隆备库 [postgres@hjx-rocky8-clickhouse02 ~]$ repmgr -f /home/postgres/repmgr_standby.conf standby clone -h 10.197.165.133 -p 5432 -U repmgr -d repmgr --dry-run NOTICE: destination directory "/home/postgres/pgdata" provided INFO: connecting to source node DETAIL: connection string is: host=10.197.165.133 port=5432 user=repmgr dbname=repmgr DETAIL: current installation size is 30 MB INFO: "repmgr" extension is installed in database "repmgr" INFO: parameter "max_replication_slots" set to 20 INFO: parameter "max_wal_senders" set to 20 NOTICE: checking for available walsenders on the source node (2 required) INFO: sufficient walsenders available on the source node DETAIL: 2 required, 20 available NOTICE: checking replication connections can be made to the source server (2 required) INFO: required number of replication connections could be made to the source server DETAIL: 2 replication connections required INFO: replication slots will be created by user "repmgr" NOTICE: standby will attach to upstream node 1 HINT: consider using the -c/--fast-checkpoint option INFO: would execute: /usr/local/pgsql/bin/pg_basebackup -l "repmgr base backup" -D /home/postgres/pgdata -h 10.197.165.133 -p 5432 -U repmgr -X stream -S repmgr_slot_2 INFO: all prerequisites for "standby clone" are met
克隆进行
[postgres@hjx-rocky8-clickhouse02 ~]$ repmgr -f /home/postgres/repmgr_standby.conf standby clone -h 10.197.165.133 -p 5432 -U repmgr -d repmgr NOTICE: destination directory "/home/postgres/pgdata" provided INFO: connecting to source node DETAIL: connection string is: host=10.197.165.133 port=5432 user=repmgr dbname=repmgr DETAIL: current installation size is 30 MB NOTICE: checking for available walsenders on the source node (2 required) NOTICE: checking replication connections can be made to the source server (2 required) INFO: creating directory "/home/postgres/pgdata"... NOTICE: starting backup (using pg_basebackup)... HINT: this may take some time; consider using the -c/--fast-checkpoint option INFO: executing: /usr/local/pgsql/bin/pg_basebackup -l "repmgr base backup" -D /home/postgres/pgdata -h 10.197.165.133 -p 5432 -U repmgr -X stream -S repmgr_slot_2 NOTICE: standby clone (using pg_basebackup) complete NOTICE: you can now start your PostgreSQL server HINT: for example: /usr/local/pgsql/bin/pg_ctl -D /home/postgres/pgdata start HINT: after starting the server, you need to register this standby with "repmgr standby register" [postgres@hjx-rocky8-clickhouse02 ~]$
注册备节点
[postgres@hjx-rocky8-clickhouse02 ~]$ pg_ctl start; [postgres@hjx-rocky8-clickhouse02 ~]$ repmgr standby -f repmgr_standby.conf register INFO: connecting to local node "standby_node" (ID: 2) INFO: connecting to primary database WARNING: --upstream-node-id not supplied, assuming upstream node is primary (node ID: 1) INFO: standby registration complete NOTICE: standby node "standby_node" (ID: 2) successfully registered #主库查看(133) [postgres@hjx-rocky8-clickhouse01 ~]$ repmgr cluster show ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string ----+--------------+---------+-----------+--------------+----------+----------+----------+--------------------------------------------------------- 1 | primary_node | primary | * running | | default | 100 | 1 | host=10.197.165.133 port=5432 user=repmgr dbname=repmgr 2 | standby_node | standby | running | primary_node | default | 100 | 1 | host=10.197.165.134 port=5432 user=repmgr dbname=repmgr [postgres@hjx-rocky8-clickhouse01 ~]$ psql -c 'select * from pg_stat_replication' pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | backend_xmin | state | sent_lsn | write_lsn | flush_lsn | replay_lsn | write_lag | flush_lag | replay_lag | sync_priority | sync_state | reply_time -------+----------+---------+------------------+----------------+-----------------+-------------+-------------------------------+--------------+-----------+--------- --+-----------+-----------+------------+-----------+-----------+------------+---------------+------------+------------------------------- 48491 | 16388 | repmgr | standby_node | 10.197.165.134 | | 53172 | 2026-05-12 18:14:56.814521+08 | | streaming | 0/A00080 0 | 0/A000800 | 0/A000800 | 0/A000800 | | | | 0 | async | 2026-05-12 18:17:39.506493+08 (1 row)
启动备库repmgrd
[postgres@hjx-rocky8-clickhouse02 ~]$ repmgrd -f repmgr_standby.conf start [2026-05-12 18:18:19] [NOTICE] redirecting logging output to "/tmp/repmgr.log" [postgres@hjx-rocky8-clickhouse02 ~]$ ps -ef| grep repmgr postgres 434216 431684 0 18:18 ? 00:00:00 postgres: repmgr repmgr 10.197.165.134(54722) idle postgres 434218 1 0 18:18 ? 00:00:00 repmgrd -f repmgr_standby.conf start postgres 434884 381384 0 18:19 pts/0 00:00:00 grep --color=auto repmgr
故障切换
现在一主一从,133是主节点,134是备节点
[postgres@hjx-rocky8-clickhouse02 ~]$ repmgr cluster show ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string ----+--------------+---------+-----------+--------------+----------+----------+----------+--------------------------------------------------------- 1 | primary_node | primary | * running | | default | 100 | 1 | host=10.197.165.133 port=5432 user=repmgr dbname=repmgr 2 | standby_node | standby | running | primary_node | default | 100 | 1 | host=10.197.165.134 port=5432 user=repmgr dbname=repmg
停止主库
pg_ctl -D pgdata stop
#日志显示
#repmgrd发现主库异常,首先会尝试继续连接,根据前面配置的参数,reconnect_attempts和reconnect_interval,尝试连接6次,依旧连不上的话就会做故障切换。
[2022-07-21 14:23:55] [WARNING] unable to ping "host=localhost port=5432 user=repmgr dbname=repmgr"
[2022-07-21 14:23:55] [DETAIL] PQping() returned "PQPING_NO_RESPONSE"
[2022-07-21 14:23:55] [WARNING] unable to connect to upstream node "primary_node" (ID: 1)
[2022-07-21 14:23:55] [INFO] checking state of node "primary_node" (ID: 1), 1 of 6 attempts
[2022-07-21 14:23:55] [WARNING] unable to ping "user=repmgr dbname=repmgr host=localhost port=5432 connect_timeout=2 fallback_application_name=repmgr"
[2022-07-21 14:23:55] [DETAIL] PQping() returned "PQPING_NO_RESPONSE"
[2022-07-21 14:23:55] [INFO] sleeping up to 10 seconds until next reconnection attempt
[2022-07-21 14:24:45] [INFO] checking state of node "primary_node" (ID: 1), 6 of 6 attempts
[2022-07-21 14:24:45] [WARNING] unable to ping "user=repmgr dbname=repmgr host=localhost port=5432 connect_timeout=2 fallback_application_name=repmgr"
[2022-07-21 14:24:45] [DETAIL] PQping() returned "PQPING_NO_RESPONSE"
[2022-07-21 14:24:45] [WARNING] unable to reconnect to node "primary_node" (ID: 1) after 6 attempts
[2022-07-21 14:24:45] [INFO] 0 active sibling nodes registered
[2022-07-21 14:24:45] [INFO] 2 total nodes registered
[2022-07-21 14:24:45] [INFO] primary node "primary_node" (ID: 1) and this node have the same location ("default")
[2022-07-21 14:24:45] [INFO] no other sibling nodes - we win by default
[2022-07-21 14:24:45] [NOTICE] this node is the only available candidate and will now promote itself
[2022-07-21 14:24:45] [INFO] promote_command is:
"repmgr -f /home/postgres/repmgr_standby.conf standby promote"
NOTICE: promoting standby to primary
DETAIL: promoting server "standby_node" (ID: 2) using pg_promote()
NOTICE: waiting up to 60 seconds (parameter "promote_check_timeout") for promotion to complete
NOTICE: STANDBY PROMOTE successful
DETAIL: server "standby_node" (ID: 2) was successfully promoted to primary
[2022-07-21 14:24:46] [INFO] checking state of node 2, 1 of 6 attempts
[2022-07-21 14:24:46] [NOTICE] node 2 has recovered, reconnecting
[2022-07-21 14:24:46] [INFO] connection to node 2 succeeded
[2022-07-21 14:24:46] [INFO] original connection is still available
[2022-07-21 14:24:46] [INFO] 0 followers to notify
[2022-07-21 14:24:46] [INFO] switching to primary monitoring mode
[2022-07-21 14:24:46] [NOTICE] monitoring cluster primary "standby_node" (ID: 2)
[2022-07-21 14:25:16] [INFO] monitoring primary node "standby_node" (ID: 2) in normal stat
备库查看
现在只剩下一个节点,原来的备节点顺利提升为主节点
[postgres@hjx-rocky8-clickhouse02 tmp]$ repmgr cluster show ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string ----+--------------+---------+-----------+----------+----------+----------+----------+--------------------------------------------------------- 1 | primary_node | primary | - failed | ? | default | 100 | | host=10.197.165.133 port=5432 user=repmgr dbname=repmgr 2 | standby_node | primary | * running | | default | 100 | 2 | host=10.197.165.134 port=5432 user=repmgr dbname=repmgr WARNING: following issues were detected - unable to connect to node "primary_node" (ID: 1) HINT: execute with --verbose option to see connection error messages [postgres@hjx-rocky8-clickhouse02 tmp]$
原来的主节点可以以备库的身份重新加入
[postgres@hjx-rocky8-clickhouse01 ~]$ repmgr node rejoin -f repmgr_primary.conf -d 'host=10.197.165.134 port=5432 user=repmgr dbname=repmgr' --dry-run [postgres@hjx-rocky8-clickhouse01 ~]$ repmgr node rejoin -f repmgr_primary.conf -d 'host=10.197.165.134 port=5432 user=repmgr dbname=repmgr' --dry-run NOTICE: rejoin target is node "standby_node" (ID: 2) INFO: replication slots in use, 2 free slots on node 20 INFO: replication connection to the rejoin target node was successful INFO: local and rejoin target system identifiers match DETAIL: system identifier is 7638896705802620331 INFO: local node 1 can attach to rejoin target node 2 DETAIL: local node's recovery point: 0/B000028; rejoin target node's fork point: 0/B0000A0 INFO: prerequisites for executing NODE REJOIN are met [postgres@hjx-rocky8-clickhouse01 ~]$ repmgr node rejoin -f repmgr_primary.conf -d 'host=10.197.165.134 port=5432 user=repmgr dbname=repmgr' NOTICE: rejoin target is node "standby_node" (ID: 2) INFO: local node 1 can attach to rejoin target node 2 DETAIL: local node's recovery point: 0/B000028; rejoin target node's fork point: 0/B0000A0 NOTICE: setting node 1's upstream to node 2 WARNING: unable to ping "host=10.197.165.133 port=5432 user=repmgr dbname=repmgr" DETAIL: PQping() returned "PQPING_NO_RESPONSE" NOTICE: starting server using "/usr/local/pgsql/bin/pg_ctl -D /home/postgres/pgdata start" NOTICE: replication slot "repmgr_slot_2" deleted on node 1 NOTICE: NODE REJOIN successful DETAIL: node 1 is now attached to node 2 [postgres@hjx-rocky8-clickhouse01 ~]$ cat ~/.bashrc ^C [postgres@hjx-rocky8-clickhouse01 ~]$ repmgr cluster show ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string ----+--------------+---------+-----------+--------------+----------+----------+----------+--------------------------------------------------------- 1 | primary_node | standby | running | standby_node | default | 100 | 1 | host=10.197.165.133 port=5432 user=repmgr dbname=repmgr 2 | standby_node | primary | * running | | default | 100 | 2 | host=10.197.165.134 port=5432 user=repmgr dbname=repmgr
6987

被折叠的 条评论
为什么被折叠?



