上接:
通过gs_expansion命令完成主库增加备库的处理,测试switchover正常(3)
本次使用gs_expansion命令完成了主库增加一个级联备库的处理,实现了一主一备一级联的高可用架构。
在openGauss训练营学习心得-安装初体验(1)的基础上,克隆出虚机omm04作为备库,从而具备了opengauss软件及omm用户、用户组等文件信息(没有克隆就按(1)文档重新安装opengauss软件即可)。
主要步骤:
1.备库系统克隆/openGauss软件安装
2.主备环境变量准备
3.主库xml集群配置文件准备
4.root/omm用户在主备节点互信配置
5.主库和级联备库postgres.conf和pg_hba.conf修改信息
6.主库启动成primary模式,备库启动standy模式
7.执行gs_expansion增加级联备库操作
8.检查状态
如下为详细安装步骤:
1.omm04虚机系统克隆完毕(忽略步骤)
2.主备库环境变量修改(之前已配好)
注意环境变量提前添加好,避免后续的报错提示:
vi /etc/profile
export PGDATA=/gaussdb/data/db1
export GPHOME=/gaussdb/om
export GAUSSHOME=/gaussdb/app
export PGHOST=/gaussdb/om/omm_mppdb
export PATH=/root/gauss_om/omm/script:$GAUSSHOME/bin:$PATH
source /etc/profile 即时生效
3.主库omm02准备好集群脚本:注意下划线为增加的级联节点信息
vi /soft/openGauss/clusterconfig.xml
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<!-- openGauss整体信息 -->
<CLUSTER>
<PARAM name="clusterName" value="dbCluster" />
<PARAM name="nodeNames" value="omm02,omm03,omm04" />
<PARAM name="backIp1s" value="192.168.52.143,192.168.52.144,192.168.52.145"/>
<PARAM name="gaussdbAppPath" value="/gaussdb/app" />
<PARAM name="gaussdbLogPath" value="/gaussdb/log" />
<PARAM name="gaussdbToolPath" value="/gaussdb/om" />
<PARAM name="corePath" value="/gaussdb/corefile"/>
</CLUSTER>
<!-- 每台服务器上的节点部署信息 -->
<DEVICELIST>
<!-- node1上的节点部署信息 -->
<DEVICE sn="omm02">
<PARAM name="name" value="omm02"/>
<PARAM name="azName" value="AZ1"/>
<PARAM name="azPriority" value="1"/>
<!-- 如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP -->
<PARAM name="backIp1" value="192.168.52.143"/>
<PARAM name="sshIp1" value="192.168.52.143"/>
<!--dbnode-->
<PARAM name="dataNum" value="1"/>
<PARAM name="dataPortBase" value="26000"/>
<PARAM name="dataNode1" value="/gaussdb/data/db1,omm03,/gaussdb/data/db1,omm04,/gaussdb/data/db1"/>
<PARAM name="dataNode1_syncNum" value="0"/>
</DEVICE>
<!-- node1上的节点部署信息 -->
<DEVICE sn="omm03">
<PARAM name="name" value="omm03"/>
<PARAM name="azName" value="AZ1"/>
<PARAM name="azPriority" value="1"/>
<!-- 如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP -->
<PARAM name="backIp1" value="192.168.52.144"/>
<PARAM name="sshIp1" value="192.168.52.144"/>
</DEVICE>
<!-- node3上的节点部署信息,其中“name”的值配置为主机名称 -->
<DEVICE sn="omm04">
<PARAM name="name" value="omm04"/>
<PARAM name="azName" value="AZ1"/>
<PARAM name="azPriority" value="1"/>
<!-- 如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP -->
<PARAM name="backIp1" value="192.168.52.145"/>
<PARAM name="sshIp1" value="192.168.52.145"/>
<PARAM name="cascadeRole" value="on"/>
</DEVICE>
</DEVICELIST>
</ROOT>
4.root/omm用户在主备节点互信配置
在omm02主库操作即可:
[root@omm02 openGauss]# cat hostfile
192.168.52.143
192.168.52.144
192.168.52.145
[root@omm02 openGauss]# cd script/
[root@omm02 script]# ./gs_sshexkey -f /soft/openGauss/hostfile
Please enter password for current user[root].
Password:
Checking network information.
All nodes in the network are Normal.
Successfully checked network information.
Creating SSH trust.
Creating the local key file.
Successfully created the local key files.
Appending local ID to authorized_keys.
Successfully appended local ID to authorized_keys.
Updating the known_hosts file.
Successfully updated the known_hosts file.
Appending authorized_key on the remote node.
Successfully appended authorized_key on all remote node.
Checking common authentication file content.
Successfully checked common authentication content.
Distributing SSH trust file to all node.
Successfully distributed SSH trust file to all node.
Verifying SSH trust on all hosts.
Successfully verified SSH trust on all hosts.
Successfully created SSH trust.
[root@omm02 script]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.52.143 omm02 #Gauss OM IP Hosts Mapping
192.168.52.144 omm03 #Gauss OM IP Hosts Mapping
192.168.52.145 omm04 #Gauss OM IP Hosts Mapping
[root@omm02 script]# ssh omm03 date
Sat Sep 18 12:09:30 CST 2021
[root@omm02 script]# ssh omm04 date
Sat Sep 18 12:09:33 CST 2021
[root@omm02 script]# ssh omm02 date
Sat Sep 18 12:09:36 CST 2021
[root@omm02 script]# su - omm
Last login: Thu Sep 16 13:55:43 CST 2021 on pts/0
[omm@omm02 ~]$ cd /soft/openGauss/script/
[omm@omm02 script]$ ./gs_sshexkey -f /soft/openGauss/hostfile
Please enter password for current user[omm].
Password:
Checking network information.
All nodes in the network are Normal.
Successfully checked network information.
Creating SSH trust.
Creating the local key file.
Successfully created the local key files.
Appending local ID to authorized_keys.
Successfully appended local ID to authorized_keys.
Updating the known_hosts file.
Successfully updated the known_hosts file.
Appending authorized_key on the remote node.
Successfully appended authorized_key on all remote node.
Checking common authentication file content.
Successfully checked common authentication content.
Distributing SSH trust file to all node.
Successfully distributed SSH trust file to all node.
Verifying SSH trust on all hosts.
Successfully verified SSH trust on all hosts.
Successfully created SSH trust.
[omm@omm02 script]$ ssh omm03 date
Sat Sep 18 12:10:15 CST 2021
[omm@omm02 script]$ ssh omm04 date
Sat Sep 18 12:10:17 CST 2021
[omm@omm02 script]$ ssh omm02 date
Sat Sep 18 12:10:19 CST 20215.主库和级联备库postgres.conf和pg_hba.conf修改信息
主库:postgres.conf增加修改内容: listen_addresses = '*' 注意监听地址最好为* replconninfo1 = 'localhost=192.168.52.143 localport=26001 localheartbeatport=26003 localservice=26004 remotehost=192.168.52.144 remoteport=26001 remoteheartbeatport=26003 remoteservice=26004' wal_level = hot_standby 级联备库:postgres.conf增加修改内容: listen_addresses = '*' 注意监听地址最好为*否则可能报错如下:[root@omm02 script]# ./gs_expansion -U omm -G dbgrp -X /soft/openGauss/clusterconfig.xml -h 192.168.52.145 -L Database on standby nodes installed finished. Checking gaussdb and gs_om version. End to check gaussdb and gs_om version. Start to establish the relationship. Start to build cascade standby 192.168.52.145. Failed to start 192.168.52.145 as standby before building. [GAUSS-35706] Fail to build on all new hosts.[root@omm02 script]# ./gs_expansion -U omm -G dbgrp -X /soft/openGauss/clusterconfig.xml -h 192.168.52.145 -L Database on standby nodes installed finished. Checking gaussdb and gs_om version. End to check gaussdb and gs_om version. Start to establish the relationship. Start to build cascade standby 192.168.52.145. Failed to start 192.168.52.145 as standby before building. [GAUSS-35706] Fail to build on all new hosts.主备:pg_hba.conf增加内容: host all omm 192.168.52.0/24 trust host replication omm 192.168.52.0/24 trust
6.主库启动成primary模式,备库启动为standby模式
主库启动:[omm@omm02 ~]$ gs_ctl start -M primary [2021-09-18 12:24:16.206][8831][][gs_ctl]: gs_ctl started,datadir is /gaussdb/data/db1 [2021-09-18 12:24:16.296][8831][][gs_ctl]: waiting for server to start... .0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env. 0 LOG: [Alarm Module]Host Name: omm02 0 LOG: [Alarm Module]Host IP: 192.168.52.143 0 LOG: [Alarm Module]Cluster Name: dbCluster 0 LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 52 0 WARNING: failed to open feature control file, please check whether it exists: FileName=gaussdb.version, Errno=2, Errmessage=No such file or directory. 0 WARNING: failed to parse feature control file: gaussdb.version. 0 WARNING: Failed to load the product control file, so gaussdb cannot distinguish product version. 0 LOG: Failed to initialze environment for codegen. The core dump path is an invalid directory 2021-09-18 12:24:16.480 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 DB010 0 [REDO] LOG: Recovery parallelism, cpu count = 4, max = 4, actual = 4 2021-09-18 12:24:16.480 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 DB010 0 [REDO] LOG: ConfigRecoveryParallelism, true_max_recovery_parallelism:4, max_recovery_parallelism:4 2021-09-18 12:24:16.480 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env. 2021-09-18 12:24:16.480 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Host Name: omm02 2021-09-18 12:24:16.480 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Host IP: 192.168.52.143 2021-09-18 12:24:16.480 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Cluster Name: dbCluster 2021-09-18 12:24:16.480 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 52 2021-09-18 12:24:16.480 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: Transparent encryption disabled. 2021-09-18 12:24:16.483 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: loaded library "security_plugin" 2021-09-18 12:24:16.485 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: InitNuma numaNodeNum: 1 numa_distribute_mode: none inheritThreadPool: 0. 2021-09-18 12:24:16.485 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 01000 0 [BACKEND] WARNING: Failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (16 Mbytes) or shared memory (1496 Mbytes) is larger. 2021-09-18 12:24:16.497 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 00000 0 [CACHE] LOG: set data cache size(12582912) 2021-09-18 12:24:16.498 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 00000 0 [CACHE] LOG: set metadata cache size(4194304) 2021-09-18 12:24:18.063 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: gaussdb: fsync file "/gaussdb/data/db1/gaussdb.state.temp" success 2021-09-18 12:24:18.063 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: create gaussdb state file success: db state(STARTING_STATE), server mode(Primary) 2021-09-18 12:24:18.087 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: max_safe_fds = 979, usable_fds = 1000, already_open = 11 The core dump path is an invalid directory 2021-09-18 12:24:18.104 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: the configure file /gaussdb/app/etc/gscgroup_omm.cfg doesn't exist or the size of configure file has changed. Please create it by root user! 2021-09-18 12:24:18.104 614569f0.1 [unknown] 140295839307520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: Failed to parse cgroup config file. . [2021-09-18 12:24:19.157][8831][][gs_ctl]: done [2021-09-18 12:24:19.157][8831][][gs_ctl]: server started (/gaussdb/data/db1) [omm@omm02 ~]$ exit logout 备库启动:[omm@omm03 ~]$ gs_ctl start -M standby [2021-09-18 12:25:30.045][4047][][gs_ctl]: gs_ctl started,datadir is /gaussdb/data/db1 [2021-09-18 12:25:30.141][4047][][gs_ctl]: waiting for server to start... .0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env. 0 LOG: [Alarm Module]Host Name: omm03 0 LOG: [Alarm Module]Host IP: 192.168.52.144 0 LOG: [Alarm Module]Cluster Name: dbCluster 0 LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 52 0 WARNING: failed to open feature control file, please check whether it exists: FileName=gaussdb.version, Errno=2, Errmessage=No such file or directory. 0 WARNING: failed to parse feature control file: gaussdb.version. 0 WARNING: Failed to load the product control file, so gaussdb cannot distinguish product version. 0 LOG: Failed to initialze environment for codegen. The core dump path is an invalid directory 2021-09-18 12:25:30.331 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 DB010 0 [REDO] LOG: Recovery parallelism, cpu count = 4, max = 4, actual = 4 2021-09-18 12:25:30.331 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 DB010 0 [REDO] LOG: ConfigRecoveryParallelism, true_max_recovery_parallelism:4, max_recovery_parallelism:4 2021-09-18 12:25:30.331 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env. 2021-09-18 12:25:30.331 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Host Name: omm03 2021-09-18 12:25:30.331 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Host IP: 192.168.52.144 2021-09-18 12:25:30.331 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Cluster Name: dbCluster 2021-09-18 12:25:30.331 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 52 2021-09-18 12:25:30.332 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: Transparent encryption disabled. 2021-09-18 12:25:30.334 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: loaded library "security_plugin" 2021-09-18 12:25:30.336 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: InitNuma numaNodeNum: 1 numa_distribute_mode: none inheritThreadPool: 0. 2021-09-18 12:25:30.336 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 01000 0 [BACKEND] WARNING: Failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (16 Mbytes) or shared memory (1496 Mbytes) is larger. 2021-09-18 12:25:30.351 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 00000 0 [CACHE] LOG: set data cache size(12582912) 2021-09-18 12:25:30.351 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 00000 0 [CACHE] LOG: set metadata cache size(4194304) 2021-09-18 12:25:31.859 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: gaussdb: fsync file "/gaussdb/data/db1/gaussdb.state.temp" success 2021-09-18 12:25:31.859 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: create gaussdb state file success: db state(STARTING_STATE), server mode(Standby) 2021-09-18 12:25:31.882 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: max_safe_fds = 979, usable_fds = 1000, already_open = 11 The core dump path is an invalid directory 2021-09-18 12:25:31.884 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: the configure file /gaussdb/app/etc/gscgroup_omm.cfg doesn't exist or the size of configure file has changed. Please create it by root user! 2021-09-18 12:25:31.884 61456a3a.1 [unknown] 140502000035584 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: Failed to parse cgroup config file. . [2021-09-18 12:25:33.039][4047][][gs_ctl]: done [2021-09-18 12:25:33.039][4047][][gs_ctl]: server started (/gaussdb/data/db1) [omm@omm03 ~]$ gs_ctl query [2021-09-18 12:25:42.572][4107][][gs_ctl]: gs_ctl query ,datadir is /gaussdb/data/db1 HA state: local_role : Standby static_connections : 1 db_state : Normal detail_information : Normal Senders info: No information Receiver info: receiver_pid : 4106 local_role : Standby peer_role : Primary peer_state : Normal state : Normal sender_sent_location : 0/2124340 sender_write_location : 0/2124340 sender_flush_location : 0/2124340 sender_replay_location : 0/2124340 receiver_received_location : 0/2124340 receiver_write_location : 0/2124340 receiver_flush_location : 0/2124340 receiver_replay_location : 0/2124340 sync_percent : 100% channel : 192.168.52.144:59494<--192.168.52.143:26001
7.执行gs_expansion增加级联备库操作
[root@omm02 script]# ./gs_expansion -U omm -G dbgrp -X /soft/openGauss/clusterconfig.xml -h 192.168.52.145 -L
Database on standby nodes installed finished.
Checking gaussdb and gs_om version.
End to check gaussdb and gs_om version.
Start to establish the relationship.
Start to build cascade standby 192.168.52.145.
Build cascade standby 192.168.52.145 success.
Start to generate and send cluster static file.
End to generate and send cluster static file.
Expansion results:
192.168.52.145: Success
Expansion Finish.
8.主备、级联备的检查:主库创建test库,级联备库同步成功。
主库:[omm@omm02 ~]$ gs_om -t status ----------------------------------------------------------------------- cluster_name : dbCluster cluster_state : Normal redistributing : No ----------------------------------------------------------------------- [omm@omm02 ~]$ gs_om -t status --all ----------------------------------------------------------------------- cluster_state : Normal redistributing : No ----------------------------------------------------------------------- node : 1 node_name : omm02 instance_id : 6001 node_ip : 192.168.52.143 data_path : /gaussdb/data/db1 type : Datanode instance_state : Normal az_name : AZ1 static_connections : 2 HA_state : Normal instance_role : Primary ----------------------------------------------------------------------- node : 2 node_name : omm03 instance_id : 6002 node_ip : 192.168.52.144 data_path : /gaussdb/data/db1 type : Datanode instance_state : Normal az_name : AZ1 instance_role : Standby HA_state : Streaming sender_sent_location : 0/212A738 sender_write_location : 0/212A738 sender_flush_location : 0/212A738 sender_replay_location : 0/212A738 receiver_received_location: 0/212A738 receiver_write_location : 0/212A738 receiver_flush_location : 0/212A738 receiver_replay_location : 0/212A738 sync_percent : 100% sync_state : Async ----------------------------------------------------------------------- node : 3 node_name : omm04 instance_id : 6003 node_ip : 192.168.52.145 data_path : /gaussdb/data/db1 type : Datanode instance_state : Normal az_name : AZ1 instance_role : Cascade Standby HA_state : Normal sender_sent_location : 0/212A738 sender_write_location : 0/212A738 sender_flush_location : 0/212A738 sender_replay_location : 0/212A620 receiver_received_location: 0/212A738 receiver_write_location : 0/212A738 receiver_flush_location : 0/212A738 receiver_replay_location : 0/212A738 sync_percent : 100% sync_state : Async upstream_nodeIp : 192.168.52.144:26001 ----------------------------------------------------------------------- [omm@omm02 ~]$ gs_ctl query [2021-09-18 12:37:56.702][30905][][gs_ctl]: gs_ctl query ,datadir is /gaussdb/data/db1 HA state: local_role : Primary static_connections : 2 db_state : Normal detail_information : Normal Senders info: sender_pid : 29821 local_role : Primary peer_role : Standby peer_state : Normal state : Streaming sender_sent_location : 0/212A738 sender_write_location : 0/212A738 sender_flush_location : 0/212A738 sender_replay_location : 0/212A738 receiver_received_location : 0/212A738 receiver_write_location : 0/212A738 receiver_flush_location : 0/212A738 receiver_replay_location : 0/212A738 sync_percent : 100% sync_state : Async sync_priority : 0 sync_most_available : Off channel : 192.168.52.143:26001-->192.168.52.144:59578 Receiver info: No information [omm@omm02 ~]$ gsql -d postgres -r -p 26000 gsql ((openGauss 2.0.1 build d97c0e8a) compiled at 2021-06-02 19:37:17 commit 0 last mr ) Non-SSL connection (SSL connection is recommended when requiring high-security) Type "help" for help. postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+-------+----------+---------+-------+------------------- jyc | omm | UTF8 | C | C | postgres | omm | UTF8 | C | C | template0 | omm | UTF8 | C | C | =c/omm + | | | | | omm=CTc/omm template1 | omm | UTF8 | C | C | =c/omm + | | | | | omm=CTc/omm (4 rows) postgres=# create database test; CREATE DATABASE postgres=#备库:[omm@omm03 ~]$ gs_om -t status ----------------------------------------------------------------------- cluster_name : dbCluster cluster_state : Normal redistributing : No ----------------------------------------------------------------------- [omm@omm03 ~]$ gs_ctl query [2021-09-18 12:56:25.215][7039][][gs_ctl]: gs_ctl query ,datadir is /gaussdb/data/db1 HA state: local_role : Standby static_connections : 2 db_state : Normal detail_information : Normal Senders info: sender_pid : 6631 local_role : Standby peer_role : Cascade Standby peer_state : Normal state : Streaming sender_sent_location : 0/212C080 sender_write_location : 0/212C080 sender_flush_location : 0/212C080 sender_replay_location : 0/212C080 receiver_received_location : 0/212C080 receiver_write_location : 0/212C080 receiver_flush_location : 0/212C080 receiver_replay_location : 0/212C080 sync_percent : 100% sync_state : Async sync_priority : 0 sync_most_available : Off channel : 192.168.52.144:26001-->192.168.52.145:37508 Receiver info: receiver_pid : 6598 local_role : Standby peer_role : Primary peer_state : Normal state : Normal sender_sent_location : 0/212C080 sender_write_location : 0/212C080 sender_flush_location : 0/212C080 sender_replay_location : 0/212C080 receiver_received_location : 0/212C080 receiver_write_location : 0/212C080 receiver_flush_location : 0/212C080 receiver_replay_location : 0/212C080 sync_percent : 100% channel : 192.168.52.144:59578<--192.168.52.143:26001级联备库:[omm@omm04 ~]$ gs_om -t status ----------------------------------------------------------------------- cluster_name : dbCluster cluster_state : Normal redistributing : No ----------------------------------------------------------------------- [omm@omm04 ~]$ gs_om -t status --all ----------------------------------------------------------------------- cluster_state : Normal redistributing : No ----------------------------------------------------------------------- node : 1 node_name : omm02 instance_id : 6001 node_ip : 192.168.52.143 data_path : /gaussdb/data/db1 type : Datanode instance_state : Normal az_name : AZ1 static_connections : 2 HA_state : Normal instance_role : Primary ----------------------------------------------------------------------- node : 2 node_name : omm03 instance_id : 6002 node_ip : 192.168.52.144 data_path : /gaussdb/data/db1 type : Datanode instance_state : Normal az_name : AZ1 instance_role : Standby HA_state : Streaming sender_sent_location : 0/212C198 sender_write_location : 0/212C198 sender_flush_location : 0/212C198 sender_replay_location : 0/212C198 receiver_received_location: 0/212C198 receiver_write_location : 0/212C198 receiver_flush_location : 0/212C198 receiver_replay_location : 0/212C198 sync_percent : 100% sync_state : Async ----------------------------------------------------------------------- node : 3 node_name : omm04 instance_id : 6003 node_ip : 192.168.52.145 data_path : /gaussdb/data/db1 type : Datanode instance_state : Normal az_name : AZ1 instance_role : Cascade Standby HA_state : Normal sender_sent_location : 0/212C198 sender_write_location : 0/212C198 sender_flush_location : 0/212C198 sender_replay_location : 0/212C080 receiver_received_location: 0/212C198 receiver_write_location : 0/212C198 receiver_flush_location : 0/212C198 receiver_replay_location : 0/212C198 sync_percent : 100% sync_state : Async upstream_nodeIp : 192.168.52.144:26001 ----------------------------------------------------------------------- [omm@omm04 ~]$ gs_om -t status --detail [ Cluster State ] cluster_state : Normal redistributing : No current_az : AZ_ALL [ Datanode State ] node node_ip instance state | node node_ip instance state | node node_ip instance state --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1 omm02 192.168.52.143 6001 /gaussdb/data/db1 P Primary Normal | 2 omm03 192.168.52.144 6002 /gaussdb/data/db1 S Standby Normal | 3 omm04 192.168.52.145 6003 /gaussdb/data/db1 C Cascade Normal [omm@omm04 ~]$ gs_ctl query [2021-09-18 12:57:29.983][8180][][gs_ctl]: gs_ctl query ,datadir is /gaussdb/data/db1 HA state: local_role : Cascade Standby static_connections : 2 db_state : Normal detail_information : Normal Senders info: No information Receiver info: receiver_pid : 6600 local_role : Cascade Standby peer_role : Standby peer_state : Normal state : Normal sender_sent_location : 0/212C198 sender_write_location : 0/212C198 sender_flush_location : 0/212C198 sender_replay_location : 0/212C080 receiver_received_location : 0/212C198 receiver_write_location : 0/212C198 receiver_flush_location : 0/212C198 receiver_replay_location : 0/212C198 sync_percent : 100% channel : 192.168.52.145:37508<--192.168.52.144:26001 [omm@omm04 ~]$ gsql -d postgres -r -p 26000 gsql ((openGauss 2.0.1 build d97c0e8a) compiled at 2021-06-02 19:37:17 commit 0 last mr ) Non-SSL connection (SSL connection is recommended when requiring high-security) Type "help" for help. postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+-------+----------+---------+-------+------------------- jyc | omm | UTF8 | C | C | postgres | omm | UTF8 | C | C | template0 | omm | UTF8 | C | C | =c/omm + | | | | | omm=CTc/omm template1 | omm | UTF8 | C | C | =c/omm + | | | | | omm=CTc/omm test | omm | UTF8 | C | C | (5 rows) postgres=#
最后修改时间:2021-09-18 13:06:50
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




