当前位置:   article > 正文

KingbaseES R6 主备流复制集群创建级联复制案例

金仓数据库创建复制槽的方法

案例环境:

  1. 数据库:
  2. test=# select version();
  3. version
  4. ------------------------------------------------------------------------------------------------------------------
  5. KingbaseES V008R006C003B0010 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46), 64-
  6. bit
  7. (1 row)

案例说明:

在已有的一主一从的架构上,构建级联复制。

案例架构:

操作步骤总结:

  1. 1)增加新的主机节点,并配置相关数据库用户、ssh信任关系、资源管理等。
  2. 2)在新节点创建和源节点相同的集群文件存储目录。
  3. 3)拷贝源节点的文件到新节点(除了data目录下的数据)。
  4. 4)在新节点上执行clone,注意upstream node。
  5. 5)启动新节点数据库服务。
  6. 6)在新节点以standby进行注册。
  7. 7)查看集群节点状态信息。
  8. 8)在主库做DML操作进行数据同步测试。
  9. 9)重启集群测试。

一、查看现有集群及流复制状态

1)查看集群节点状态

  1. [kingbase@node1 bin]$ ./repmgr cluster show
  2. ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string
  3. ----+---------+---------+-----------+----------+----------+----------+----------+-----------
  4. 1 | node248 | primary | * running | | default | 100 | 5 | host=192.168.7.248 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  5. 2 | node249 | standby | running | node248 | default | 100 | 5 | host=192.168.7.249 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3

2)查看主备流复制状态

  1. test=# select * from sys_stat_replication;
  2. pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_s
  3. tart | backend_xmin | state | sent_lsn | write_lsn | flush_lsn | replay_lsn | write_lag | flush_la
  4. g | replay_lag | sync_priority | sync_state | reply_time
  5. -------+----------+---------+------------------+---------------+-----------------+-------------+-----
  6. 11257 | 16384 | esrep | node249 | 192.168.7.249 | | 56568 | 2021-03-01 14:41:
  7. 41.062467+08 | | streaming | 2/1301BEC8 | 2/1301BEC8 | 2/1301BEC8 | 2/1301BEC8 | |
  8. | | 1 | quorum | 2021-03-01 15:02:50.835989+08
  9. (1 row)

=== 首先确保现有节点的集群和流复制状态正常===

二、配置新节点下集群目录存储结构和相关配置文件

1)集群目录结构

  1. [kingbase@node3 bin]$ ls -lh /home/kingbase/cluster/R6HA/KHA/kingbase/
  2. total 24M
  3. drwxrwxr-x. 2 kingbase kingbase 16K Jun 24 2021 archive
  4. drwxr-xr-x. 2 kingbase kingbase 4.0K Jun 24 2021 bin
  5. drwxrwxr-x. 2 kingbase kingbase 72 Mar 1 2021 etc
  6. -rw-rw-r--. 1 kingbase kingbase 4 Mar 1 12:07 hamgrd.pid
  7. -rw-rw-r--. 1 kingbase kingbase 2.0M Mar 1 2021 hamgr.log
  8. -rw-rw-r--. 1 kingbase kingbase 18K Jun 24 2021 hamgr.log-20210301
  9. -rw-rw-r--. 1 kingbase kingbase 2.2K Jun 24 2021 hamgr.log-20210423
  10. -rw-rw-r--. 1 kingbase kingbase 3.7K Jun 24 2021 hamgr.log-20210425
  11. -rw-rw-r--. 1 kingbase kingbase 20M Mar 1 2021 kbha.log
  12. -rw-rw-r--. 1 kingbase kingbase 989K Jun 24 2021 kbha.log-20210301
  13. -rw-rw-r--. 1 kingbase kingbase 130K Jun 24 2021 kbha.log-20210423
  14. -rw-rw-r--. 1 kingbase kingbase 741K Jun 24 2021 kbha.log-20210425
  15. drwxrwxr-x. 5 kingbase kingbase 8.0K Jun 24 2021 lib
  16. -rw-------. 1 kingbase kingbase 47K Mar 1 12:02 logfile
  17. drwxrwxr-x. 7 kingbase kingbase 4.0K Jun 24 2021 share

=== 新节点集群目录存储结构和源节点一致,除了data目录,所有数据从源节点拷贝===

2)配置repmgr.conf配置文件

三、在新节点上执行clone

=== 注意:通过指定upstream-node-id执行(upstream节点(上游节点))===

  1. [kingbase@node3 bin]$ ./repmgr standby clone -h 192.168.7.249 -U esrep -d esrep --upstream-node-id=2
  2. NOTICE: destination directory "/home/kingbase/cluster/R6HA/KHA/kingbase/data" provided
  3. INFO: connecting to source node
  4. DETAIL: connection string is: host=192.168.7.249 user=esrep dbname=esrep
  5. DETAIL: current installation size is 512 MB
  6. NOTICE: checking for available walsenders on the source node (2 required)
  7. NOTICE: checking replication connections can be made to the source server (2 required)
  8. INFO: creating directory "/home/kingbase/cluster/R6HA/KHA/kingbase/data"...
  9. NOTICE: starting backup (using sys_basebackup)...
  10. HINT: this may take some time; consider using the -c/--fast-checkpoint option
  11. INFO: executing:
  12. /home/kingbase/cluster/R6HA/KHA/kingbase/bin/sys_basebackup -l "repmgr base backup" -D /home/kingbase/cluster/R6HA/KHA/kingbase/data -h 192.168.7.249 -p 54321 -U esrep -X stream -S repmgr_slot_3
  13. NOTICE: creating replication slot "repmgr_slot_3" on upstream node 2
  14. NOTICE: replication slot "repmgr_slot_3" deleted on source node
  15. NOTICE: standby clone (using sys_basebackup) complete
  16. NOTICE: you can now start your Kingbase server
  17. HINT: for example: sys_ctl -D /home/kingbase/cluster/R6HA/KHA/kingbase/data start
  18. HINT: after starting the server, you need to register this standby with "repmgr standby register"

四、启动数据库服务注册standby节点

1)启动新备库数据库服务

  1. [kingbase@node3 bin]$ ./sys_ctl start -D ../data
  2. waiting for server to start....2021-03-01 12:37:58.541 CST [4741] LOG: sepapower extension initialized
  3. 2021-03-01 12:37:58.585 CST [4741] LOG: starting KingbaseES V008R006C003B0010 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46), 64-bit
  4. 2021-03-01 12:37:58.585 CST [4741] LOG: listening on IPv4 address "0.0.0.0", port 54321
  5. 2021-03-01 12:37:58.585 CST [4741] LOG: listening on IPv6 address "::", port 54321
  6. 2021-03-01 12:37:58.595 CST [4741] LOG: listening on Unix socket "/tmp/.s.KINGBASE.54321"
  7. 2021-03-01 12:37:58.640 CST [4741] LOG: redirecting log output to logging collector process
  8. 2021-03-01 12:37:58.640 CST [4741] HINT: Future log output will appear in directory "sys_log".
  9. . done
  10. server started

2)注册standby节点

=== 注意:通过指定upstream-node-id执行(upstream节点(上游节点))===

  1. [kingbase@node3 bin]$ ./repmgr standby register --upstream-node-id=2 --force
  2. INFO: connecting to local node "node243" (ID: 3)
  3. INFO: connecting to primary database
  4. WARNING: this node does not appear to be attached to upstream node "node249" (ID: 2)
  5. INFO: standby registration complete
  6. NOTICE: standby node "node243" (ID: 3) successfully registered
  7. [kingbase@node3 bin]$ ./repmgr cluster show
  8. ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string
  9. ----+---------+---------+-----------+----------+----------+----------+----------+--------------
  10. 1 | node248 | primary | * running | | default | 100 | 5 | host=192.168.7.248 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  11. 2 | node249 | standby | running | node248 | default | 100 | 5 | host=192.168.7.249 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3

3)查看集群节点状态

  1. [kingbase@node3 bin]$ ./repmgr cluster show
  2. ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string
  3. ----+---------+---------+-----------+----------+----------+----------+----------+-------------
  4. 1 | node248 | primary | * running | | default | 100 | 5 | host=192.168.7.248 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  5. 2 | node249 | standby | running | node248 | default | 100 | 5 | host=192.168.7.249 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3

=== 注意:在新节点上没有看到 node243的注册信息,应该不是正常状态===

4)查看上游节点中集群节点状态信息

  1. [kingbase@node1 bin]$ ./repmgr cluster show
  2. ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string
  3. ----+---------+---------+-----------+----------+----------+----------+----------+---------
  4. 1 | node248 | primary | * running | | default | 100 | 5 | host=192.168.7.248 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  5. 2 | node249 | standby | running | node248 | default | 100 | 5 | host=192.168.7.249 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  6. 3 | node243 | standby | running | node249 | default | 100 | 5 | host=192.168.7.243 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  1. [kingbase@node2 bin]$ ./repmgr cluster show
  2. ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string
  3. ----+---------+---------+-----------+----------+----------+----------+----------+---------
  4. 1 | node248 | primary | * running | | default | 100 | 5 | host=192.168.7.248 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  5. 2 | node249 | standby | running | node248 | default | 100 | 5 | host=192.168.7.249 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  6. 3 | node243 | standby | running | node249 | default | 100 | 5 | host=192.168.7.243 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3

=== 上游节点查询集群节点状态信息正常===

五、解决新节点(node243)集群状态非正常的故障

1)查看新节点数据库日志

  1. node243:
  2. ......
  3. 2021-03-01 12:41:19.789 CST [4909] FATAL: could not start WAL streaming: ERROR: replication slot "repmgr_slot_3" does not exist
  4. 2021-03-01 12:41:24.789 CST [4910] FATAL: could not start WAL streaming: ERROR: replication slot "repmgr_slot_3" does not exist
  5. 2021-03-01 12:41:29.794 CST [4911] FATAL: could not start WAL streaming: ERROR: replication slot "repmgr_slot_3" does not exist

=== 从日志信息可知,node243通过"repmgr_slot_3"复制槽做流复制连接,而复制槽不存在===

2)查看上游节点(node249)复制槽和流复制状态信息

  1. node249:
  2. 1、查看复制槽信息
  3. test=# select * from sys_replication_slots;
  4. slot_name | plugin | slot_type | datoid | database | temporary | active | active_pid | xmin | catalog_xmin | rest
  5. art_lsn | confirmed_flush_lsn
  6. -----------+--------+-----------+--------+----------+-----------+--------+------------+------+-
  7. (0 rows)

2、查看流复制信息

  1. test=# select * from sys_stat_replication;
  2. pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | backe
  3. nd_xmin | state | sent_lsn | write_lsn | flush_lsn | replay_lsn | write_lag | flush_lag | replay_lag | sync_priori
  4. ty | sync_state | reply_time
  5. -----+----------+---------+------------------+-------------+-----------------+-------------+
  6. (0 rows)

=== 从以上获知,在上游节点node249查询,复制槽和流复制节点信息均为空===

3)在node249节点创建复制槽

  1. test=# select sys_create_physical_replication_slot('repmgr_slot_3');
  2. sys_create_physical_replication_slot
  3. --------------------------------------
  4. (repmgr_slot_3,)
  5. (1 row)

查看复制槽:

  1. test=# select * from sys_replication_slots;
  2. slot_name | plugin | slot_type | datoid | database | temporary | active | active_pid | xmin | catalog_xmin |
  3. restart_lsn | confirmed_flush_lsn
  4. ---------------+--------+-----------+--------+----------+-----------+--------+------------+------+--------------+-
  5. repmgr_slot_3 | | physical | | | f | t | 18334 | | |
  6. 2/1301BEC8 |
  7. (1 row)

查看流复制:

  1. test=# select * from sys_stat_replication;
  2. pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_s
  3. tart | backend_xmin | state | sent_lsn | write_lsn | flush_lsn | replay_lsn | write_lag | flush_la
  4. g | replay_lag | sync_priority | sync_state | reply_time
  5. -------+----------+---------+------------------+---------------+-----------------+-------------+
  6. 18334 | 16384 | esrep | node243 | 192.168.7.243 | | 48912 | 2021-03-01 15:08:
  7. 13.075586+08 | | streaming | 2/1301BEC8 | 2/1301BEC8 | 2/1301BEC8 | 2/1301BEC8 | |
  8. | | 0 | async | 2021-03-01 12:47:40.421207+08
  9. (1 row)

=== 从以上获知,复制槽创建后,流复制状态正常===

4)在node243上查看集群节点状态

  1. [kingbase@node3 bin]$ ./repmgr cluster show
  2. ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string
  3. ----+---------+---------+-----------+----------+----------+----------+----------+---------------------------------------------------------------------------------------------------------------------------------------------------
  4. 1 | node248 | primary | * running | | default | 100 | 5 | host=192.168.7.248 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  5. 2 | node249 | standby | running | node248 | default | 100 | 5 | host=192.168.7.249 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  6. 3 | node243 | standby | running | node249 | default | 100 | 5 | host=192.168.7.243 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3

=== 从以上获知,整个集群节点状态正常===

六、测试级联复制数据同步

  1. node248
  2. prod=# create table t1 (id int);
  3. CREATE TABLE
  4. prod=# insert into t1 values (generate_series(10,1000,10));
  5. INSERT 0 100
  6. prod=# select * from t1 limit 10;
  7. id
  8. -----
  9. 10
  10. 20
  11. 30
  12. 40
  13. 50
  14. 60
  15. 70
  16. 80
  17. 90
  18. 100
  19. (10 rows)
  20. node249
  21. prod=# \d t1;
  22. Table "public.t1"
  23. Column | Type | Collation | Nullable | Default
  24. --------+---------+-----------+----------+---------
  25. id | integer | | |
  26. prod=# select * from t1 limit 10;
  27. id
  28. -----
  29. 10
  30. 20
  31. 30
  32. 40
  33. 50
  34. 60
  35. 70
  36. 80
  37. 90
  38. 100
  39. (10 rows)
  40. node243
  41. prod=# select * from t1 limit 10;
  42. id
  43. -----
  44. 10
  45. 20
  46. 30
  47. 40
  48. 50
  49. 60
  50. 70
  51. 80
  52. 90
  53. 100
  54. (10 rows)

七、重启集群测试

1)查看集群节点状态

  1. [kingbase@node3 bin]$ ./ksql -U esrep -d esrep
  2. ksql (V8.0)
  3. Type "help" for help.
  4. esrep=# select * from repmgr.nodes;
  5. node_id | upstream_node_id | active | node_name | type | location | priority |
  6. conninfo
  7. | repluser | slot_name | config_file
  8. ---------+------------------+--------+-----------+---------+----------+----------+-------------
  9. 1 | | t | node248 | primary | default | 100 | host=192.168.7.248 user=esrep d
  10. bname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  11. | esrep | repmgr_slot_1 | /home/kingbase/cluster/R6HA/KHA/kingbase/bin/../etc/repmgr.conf
  12. 2 | 1 | t | node249 | standby | default | 100 | host=192.168.7.249 user=esrep d
  13. bname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  14. | esrep | repmgr_slot_2 | /home/kingbase/cluster/R6HA/KHA/kingbase/bin/../etc/repmgr.conf
  15. 3 | 2 | t | node243 | standby | default | 100 | host=192.168.7.243 user=esrep d
  16. bname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  17. | esrep | repmgr_slot_3 | /home/kingbase/cluster/R6HA/KHA/kingbase/bin/../etc/repmgr.conf
  18. (3 rows)

2)使用sys_monitor.sh重启集群测试

  1. [kingbase@node1 bin]$ ./sys_monitor.sh restart
  2. 2021-03-01 15:16:53 Ready to stop all DB ...
  3. Service process "node_export" was killed at process 12387
  4. Service process "postgres_ex" was killed at process 12388
  5. Service process "node_export" was killed at process 12886
  6. Service process "postgres_ex" was killed at process 12887
  7. There is no service "node_export" running currently.
  8. There is no service "postgres_ex" running currently.
  9. 2021-03-01 15:17:04 begin to stop repmgrd on "[192.168.7.248]".
  10. 2021-03-01 15:17:05 repmgrd on "[192.168.7.248]" stop success.
  11. 2021-03-01 15:17:05 begin to stop repmgrd on "[192.168.7.249]".
  12. 2021-03-01 15:17:06 repmgrd on "[192.168.7.249]" stop success.
  13. 2021-03-01 15:17:06 begin to stop repmgrd on "[192.168.7.243]".
  14. 2021-03-01 15:17:07 repmgrd on "[192.168.7.243]" already stopped.
  15. 2021-03-01 15:17:07 begin to stop DB on "[192.168.7.249]".
  16. waiting for server to shut down.... done
  17. server stopped
  18. 2021-03-01 15:17:08 DB on "[192.168.7.249]" stop success.
  19. 2021-03-01 15:17:08 begin to stop DB on "[192.168.7.243]".
  20. waiting for server to shut down.... done
  21. server stopped
  22. 2021-03-01 15:17:09 DB on "[192.168.7.243]" stop success.
  23. 2021-03-01 15:17:09 begin to stop DB on "[192.168.7.248]".
  24. waiting for server to shut down..... done
  25. server stopped
  26. 2021-03-01 15:17:11 DB on "[192.168.7.248]" stop success.
  27. 2021-03-01 15:17:11 Done.
  28. 2021-03-01 15:17:11 Ready to start all DB ...
  29. 2021-03-01 15:17:11 begin to start DB on "[192.168.7.248]".
  30. waiting for server to start.... done
  31. server started
  32. 2021-03-01 15:17:13 execute to start DB on "[192.168.7.248]" success, connect to check it.
  33. 2021-03-01 15:17:14 DB on "[192.168.7.248]" start success.
  34. 2021-03-01 15:17:14 Try to ping trusted_servers on host 192.168.7.248 ...
  35. 2021-03-01 15:17:16 Try to ping trusted_servers on host 192.168.7.249 ...
  36. 2021-03-01 15:17:19 Try to ping trusted_servers on host 192.168.7.243 ...
  37. 2021-03-01 15:17:22 begin to start DB on "[192.168.7.249]".
  38. waiting for server to start.... done
  39. server started
  40. 2021-03-01 15:17:24 execute to start DB on "[192.168.7.249]" success, connect to check it.
  41. 2021-03-01 15:17:25 DB on "[192.168.7.249]" start success.
  42. 2021-03-01 15:17:25 begin to start DB on "[192.168.7.243]".
  43. waiting for server to start.... done
  44. server started
  45. 2021-03-01 15:17:27 execute to start DB on "[192.168.7.243]" success, connect to check it.
  46. 2021-03-01 15:17:28 DB on "[192.168.7.243]" start success.
  47. ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string
  48. ----+---------+---------+-----------+----------+----------+----------+----------+---------------------------------------------------------------------------------------------------------------------------------------------------
  49. 1 | node248 | primary | * running | | default | 100 | 5 | host=192.168.7.248 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  50. 2 | node249 | standby | running | node248 | default | 100 | 5 | host=192.168.7.249 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  51. 3 | node243 | standby | running | node249 | default | 100 | 5 | host=192.168.7.243 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  52. 2021-03-01 15:17:28 The primary DB is started.
  53. WARNING: There are no 2 standbys in pg_stat_replication, please check all the standby servers replica from primary
  54. 2021-03-01 15:17:52 Success to load virtual ip [192.168.7.240/24] on primary host [192.168.7.248].
  55. 2021-03-01 15:17:52 Try to ping vip on host 192.168.7.248 ...
  56. 2021-03-01 15:17:55 Try to ping vip on host 192.168.7.249 ...
  57. 2021-03-01 15:17:57 Try to ping vip on host 192.168.7.243 ...
  58. 2021-03-01 15:18:00 begin to start repmgrd on "[192.168.7.248]".
  59. [2021-03-01 15:18:01] [NOTICE] using provided configuration file "/home/kingbase/cluster/R6HA/KHA/kingbase/bin/../etc/repmgr.conf"
  60. [2021-03-01 15:18:01] [NOTICE] redirecting logging output to "/home/kingbase/cluster/R6HA/KHA/kingbase/hamgr.log"
  61. 2021-03-01 15:18:01 repmgrd on "[192.168.7.248]" start success.
  62. 2021-03-01 15:18:01 begin to start repmgrd on "[192.168.7.249]".
  63. [2021-03-01 15:17:38] [NOTICE] using provided configuration file "/home/kingbase/cluster/R6HA/KHA/kingbase/bin/../etc/repmgr.conf"
  64. [2021-03-01 15:17:38] [NOTICE] redirecting logging output to "/home/kingbase/cluster/R6HA/KHA/kingbase/hamgr.log"
  65. 2021-03-01 15:18:02 repmgrd on "[192.168.7.249]" start success.
  66. 2021-03-01 15:18:02 begin to start repmgrd on "[192.168.7.243]".
  67. [2021-03-01 12:56:57] [NOTICE] using provided configuration file "/home/kingbase/cluster/R6HA/KHA/kingbase/bin/../etc/repmgr.conf"
  68. [2021-03-01 12:56:57] [NOTICE] redirecting logging output to "/home/kingbase/cluster/R6HA/KHA/kingbase/hamgr.log"
  69. 2021-03-01 15:18:04 repmgrd on "[192.168.7.243]" start success.
  70. ID | Name | Role | Status | Upstream | repmgrd | PID | Paused? | Upstream last seen
  71. ----+---------+---------+-----------+----------+---------+-------+---------+--------------------
  72. 1 | node248 | primary | * running | | running | 3420 | no | n/a
  73. 2 | node249 | standby | running | node248 | running | 21209 | no | 1 second(s) ago
  74. 3 | node243 | standby | running | node249 | running | 7376 | no | 0 second(s) ago
  75. 2021-03-01 15:18:18 Done.
  1. [kingbase@node1 bin]$ ./repmgr cluster show
  2. ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string
  3. ----+---------+---------+-----------+----------+----------+----------+----------+---------------------------------------------------------------------------------------------------------------------------------------------------
  4. 1 | node248 | primary | * running | | default | 100 | 5 | host=192.168.7.248 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  5. 2 | node249 | standby | running | node248 | default | 100 | 5 | host=192.168.7.249 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3
  6. 3 | node243 | standby | running | node249 | default | 100 | 5 | host=192.168.7.243 user=esrep dbname=esrep port=54321 connect_timeout=10 keepalives=1 keepalives_idle=10 keepalives_interval=1 keepalives_count=3

=== 从以上启动信息获知,通过sys_monitor.sh一键重启集群成功,新节点亦可以加入集群管理===

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/68165
推荐阅读
相关标签
  

闽ICP备14008679号