openGauss5.0.0的缩扩容测试

现有系统资源如下

操作系统版本

[root@openeuler1 srv]# cat /etc/os-release

NAME="openEuler"
VERSION="22.03 LTS"
ID="openEuler"
VERSION_ID="22.03"
PRETTY_NAME="openEuler 22.03 LTS"
ANSI_COLOR="0;31"
 

硬盘空间情况
[root@openeuler1 srv]# df -h
Filesystem                  Size  Used Avail Use% Mounted on
devtmpfs                    1.7G     0  1.7G   0% /dev
tmpfs                       1.7G   12K  1.7G   1% /dev/shm
tmpfs                       1.7G   17M  1.7G   1% /run
tmpfs                       1.7G     0  1.7G   0% /sys/fs/cgroup
/dev/mapper/openeuler-root   54G   42G  9.7G  82% /
tmpfs                       1.7G     0  1.7G   0% /tmp
/dev/sda1                   974M  181M  726M  20% /boot
tmpfs                       343M     0  343M   0% /run/user/5701
tmpfs                       343M     0  343M   0% /run/user/0

python版本
[root@openeuler1 srv]# python -V
Python 3.9.9

集群状态正常

[omm@openeuler1 ~]$ gs_om -t status --detail
[  CMServer State   ]

node          node_ip         instance                                 state
------------------------------------------------------------------------------
1  openeuler1 192.168.56.31   1    /opt/huawei/data/cmserver/cm_server Primary
2  openeuler2 192.168.56.32   2    /opt/huawei/data/cmserver/cm_server Standby
3  openeuler3 192.168.56.33   3    /opt/huawei/data/cmserver/cm_server Standby

[   Cluster State   ]

cluster_state   : Normal
redistributing  : No
balanced        : Yes
current_az      : AZ_ALL

[  Datanode State   ]

node          node_ip         instance                         state
--------------------------------------------------------------------------------
1  openeuler1 192.168.56.31   6001 /opt/huawei/install/data/dn P Primary Normal
2  openeuler2 192.168.56.32   6002 /opt/huawei/install/data/dn S Standby Normal
3  openeuler3 192.168.56.33   6003 /opt/huawei/install/data/dn S Standby Normal

当前主节点为openeuler1,进行缩容,将节点三删除
[omm@openeuler1 ~]$ gs_dropnode -U omm -h 192.168.56.33
[GAUSS-35801] Empty parameter. The -G parameter is missing in the command.
[omm@openeuler1 ~]$ gs_dropnode -U omm -h 192.168.56.33 -G dbgrp
The target node to be dropped is (['openeuler3'])
Do you want to continue to drop the target node (yes/no)?yes
Drop node start with CM node.
Drop node with CM node is running.
[gs_dropnode]Start to drop nodes of the cluster.
[gs_dropnode]Start to stop the target node openeuler3.
[gs_dropnode]End of stop the target node openeuler3.
[gs_dropnode]Start to backup parameter config file on openeuler1.
[gs_dropnode]End to backup parameter config file on openeuler1.
[gs_dropnode]The backup file of openeuler1 is /opt/huawei/tmp/gs_dropnode_backup20230406091756/parameter_openeuler1.tar
[gs_dropnode]Start to parse parameter config file on openeuler1.
Command for Checking VIP mode: cm_ctl res --list | awk -F "|" '{print $2}' | grep -w ***
The current cluster does not support VIP.
[gs_dropnode]End to parse parameter config file on openeuler1.
[gs_dropnode]Start to parse backup parameter config file on openeuler1.
[gs_dropnode]End to parse backup parameter config file openeuler1.
[gs_dropnode]Start to set openGauss config file on openeuler1.
[gs_dropnode]End of set openGauss config file on openeuler1.
[gs_dropnode]Start to backup parameter config file on openeuler2.
[gs_dropnode]End to backup parameter config file on openeuler2.
[gs_dropnode]The backup file of openeuler2 is /opt/huawei/tmp/gs_dropnode_backup20230406091802/parameter_openeuler2.tar
[gs_dropnode]Start to parse parameter config file on openeuler2.
Command for Checking VIP mode: cm_ctl res --list | awk -F "|" '{print $2}' | grep -w ***
The current cluster does not support VIP.
[gs_dropnode]End to parse parameter config file on openeuler2.
[gs_dropnode]Start to parse backup parameter config file on openeuler2.
[gs_dropnode]End to parse backup parameter config file openeuler2.
[gs_dropnode]Start to set openGauss config file on openeuler2.
[gs_dropnode]End of set openGauss config file on openeuler2.
[gs_dropnode]Start of set pg_hba config file on openeuler1.
[gs_dropnode]End of set pg_hba config file on openeuler1.
[gs_dropnode]Start of set pg_hba config file on openeuler2.
[gs_dropnode]End of set pg_hba config file on openeuler2.
[gs_dropnode]Start to set repl slot on openeuler1.
[gs_dropnode]Start to get repl slot on openeuler1.
[gs_dropnode]End of set repl slot on openeuler1.
Command for Checking VIP mode: cm_ctl res --list | awk -F "|" '{print $2}' | grep -w ***
The current cluster does not support VIP.
Stopping node.
=========================================
Successfully stopped node.
=========================================
End stop node.
Generate drop flag file on drop node openeuler3 successfully.
[gs_dropnode]Start to modify the cluster static conf.
[gs_dropnode]End of modify the cluster static conf.
Restarting cm_server cluster ...
Remove dynamic_config_file and CM metadata directory on all nodes.
[gs_dropnode] Success to drop the target nodes.

同步配置文件

[omm@openeuler1 ~]$ gs_om -t refreshconf
Generating dynamic configuration file for all nodes.
Successfully generated dynamic configuration file.

缩容之后集群情况

[omm@openeuler1 ~]$ gs_om -t status --detail
[  CMServer State   ]

node          node_ip         instance                                 state
------------------------------------------------------------------------------
1  openeuler1 192.168.56.31   1    /opt/huawei/data/cmserver/cm_server Primary
2  openeuler2 192.168.56.32   2    /opt/huawei/data/cmserver/cm_server Standby

[   Cluster State   ]

cluster_state   : Normal
redistributing  : No
balanced        : Yes
current_az      : AZ_ALL

[  Datanode State   ]

node          node_ip         instance                         state
--------------------------------------------------------------------------------
1  openeuler1 192.168.56.31   6001 /opt/huawei/install/data/dn P Primary Normal
2  openeuler2 192.168.56.32   6002 /opt/huawei/install/data/dn S Standby Normal
缩容成功

现在把节点三再加回去,需要用root用户执行, 

source /home/omm/.bashrc


[root@openeuler1 script]# ./gs_expansion -X ../s3.xml -U omm -G dbgrp -h 192.168.56.33
Start expansion with cluster manager component.
Start to send soft to each standby nodes.
End to send soft to each standby nodes.
Success to send XML to new nodes
Start to perform perinstall on nodes: ['openeuler3']
Preinstall command is: /tmp/gs_expansion_2023-04-11_14_43_49_401567/pkg/script/gs_preinstall -U omm -G dbgrp -X /srv/soft/s3.xml -L  --non-interactive 2>&1
Success to perform perinstall on nodes ['openeuler3']
Success to change user to [omm]
Installing applications on all new nodes.
Install on new node output: [SUCCESS] openeuler3:
Using omm:dbgrp to install database.
Using installation program path : /opt/huawei/install/app
Command for creating symbolic link: ln -snf /opt/huawei/install/app_a07d57c3 /opt/huawei/install/app.
Decompressing bin file.
Decompress CM package command: export LD_LIBRARY_PATH=$GPHOME/script/gspylib/clib:$LD_LIBRARY_PATH && tar -zxf "/opt/huawei/install/om/script/os_platform/./../../openGauss-5.0.0-openEuler-64bit-cm.tar.gz" -C "/opt/huawei/install/app"
Decompress CM package successfully.
Successfully decompressed bin file.
Modifying Alarm configuration.
Modifying user's environmental variable $GAUSS_ENV.
Successfully modified user's environmental variable $GAUSS_ENV.
Fixing file permission.
Set Cgroup config file to appPath.
Successfully Set Cgroup.

Successfully installed APP on nodes ['openeuler3'].
success to send all CA file.
Success to change user to [omm]
Success to init instance on nodes ['openeuler3']
Start to generate and send cluster static file.
End to generate and send cluster static file.

The current cluster does not support VIP.
Ready to perform command on node [openeuler3]. Command is : source /home/omm/.bashrc;gs_guc set -D /opt/huawei/install/data/dn -h 'host    all    omm    192.168.56.33/32    trust' -h 'host    all    all    192.168.56.33/32    sha256'
Successfully set hba on all nodes.
Success to change user to [omm]
Remove dynamic_config_file and CM metadata directory on all nodes.
Expansion results:
192.168.56.33:  Success

扩容后集群状态

 cm_ctl query -Cv
[  CMServer State   ]

node     instance state
-------------------------
1  openeuler1 1        Primary
2  openeuler2 2        Standby
3  openeuler3 3        Standby

[   Cluster State   ]

cluster_state   : Normal
redistributing  : No
balanced        : Yes
current_az      : AZ_ALL

[  Datanode State   ]

node     instance state            | node     instance state            | node     instance state
---------------------------------------------------------------------------------------------------------------
1  openeuler1 6001     P Primary Normal | 2  openeuler2 6002     S Standby Normal | 3  openeuler3 6003     S Standby Normal


 gs_om -t status --detail
[  CMServer State   ]

node     node_ip         instance                                 state
-------------------------------------------------------------------------
1  openeuler1 192.168.56.31   1    /opt/huawei/data/cmserver/cm_server Primary
2  openeuler2 192.168.56.32   2    /opt/huawei/data/cmserver/cm_server Standby
3  openeuler3 192.168.56.33   3    /opt/huawei/data/cmserver/cm_server Standby

[   Cluster State   ]

cluster_state   : Normal
redistributing  : No
balanced        : Yes
current_az      : AZ_ALL

[  Datanode State   ]

node     node_ip         instance                         state
---------------------------------------------------------------------------
1  openeuler1 192.168.56.31   6001 /opt/huawei/install/data/dn P Primary Normal
2  openeuler2 192.168.56.32   6002 /opt/huawei/install/data/dn S Standby Normal
3  openeuler3 192.168.56.33   6003 /opt/huawei/install/data/dn S Standby Normal

[omm@openeuler1 ~]$ gs_om -t status --all
-----------------------------------------------------------------------

cluster_state             : Normal
redistributing            : No
balanced                  : Yes

-----------------------------------------------------------------------

node                      : 1
node_name                 : openeuler1

node                      : 1
instance_id               : 1
node_ip                   : 192.168.56.31
data_path                 : /opt/huawei/data/cmserver/cm_server
type                      : CMServer
instance_state            : Primary

node                      : 1
instance_id               : 6001
node_ip                   : 192.168.56.31
data_path                 : /opt/huawei/install/data/dn
type                      : Datanode
instance_state            : Primary
static_connections        : 2
HA_state                  : Normal
reason                    : Normal
standby_node              :
standby_data_path         :
standby_node              :
standby_data_path         :
standby_state             : Standby
sender_sent_location      : 0/60005C8
sender_write_location     : 0/60005C8
sender_flush_location     : 0/60005C8
sender_replay_location    : 0/60005C8
receiver_received_location: 0/60005C8
receiver_write_location   : 0/60005C8
receiver_flush_location   : 0/60005C8
receiver_replay_location  : 0/60005C8
sync_state                : Quorum
secondary_state           : Unknown
sender_sent_location      : 0/0
sender_write_location     : 0/0
sender_flush_location     : 0/0
sender_replay_location    : 0/0
receiver_received_location: 0/0
receiver_write_location   : 0/0
receiver_flush_location   : 0/0
receiver_replay_location  : 0/0
sync_state                : Unknown

node                      : 1
node_name                 : openeuler1

node                      : 1
instance_id               : 1
node_ip                   : 192.168.56.31
data_path                 : /opt/huawei/data/cmserver/cm_server
type                      : CMServer
instance_state            : Primary

node                      : 1
node_ip                   : 192.168.56.31
type                      : Fenced UDF
state                     : Normal

-----------------------------------------------------------------------

node                      : 2
node_name                 : openeuler2

node                      : 2
instance_id               : 2
node_ip                   : 192.168.56.32
data_path                 : /opt/huawei/data/cmserver/cm_server
type                      : CMServer
instance_state            : Standby

node                      : 2
instance_id               : 6002
node_ip                   : 192.168.56.32
data_path                 : /opt/huawei/install/data/dn
type                      : Datanode
instance_state            : Standby
dcf_role                  : FOLLOWER
static_connections        : 2
HA_state                  : Normal
reason                    : Normal
sender_sent_location      : 0/60005C8
sender_write_location     : 0/60005C8
sender_flush_location     : 0/60005C8
sender_replay_location    : 0/60005C8
receiver_received_location: 0/60005C8
receiver_write_location   : 0/60005C8
receiver_flush_location   : 0/60005C8
receiver_replay_location  : 0/60005C8
sync_state                : Async

node                      : 2
node_name                 : openeuler2

node                      : 2
instance_id               : 2
node_ip                   : 192.168.56.32
data_path                 : /opt/huawei/data/cmserver/cm_server
type                      : CMServer
instance_state            : Standby

node                      : 2
node_ip                   : 192.168.56.32
type                      : Fenced UDF
state                     : Normal

-----------------------------------------------------------------------

node                      : 3
node_name                 : openeuler3

node                      : 3
instance_id               : 3
node_ip                   : 192.168.56.33
data_path                 : /opt/huawei/data/cmserver/cm_server
type                      : CMServer
instance_state            : Standby

node                      : 3
instance_id               : 6003
node_ip                   : 192.168.56.33
data_path                 : /opt/huawei/install/data/dn
type                      : Datanode
instance_state            : Standby
dcf_role                  : FOLLOWER
static_connections        : 2
HA_state                  : Normal
reason                    : Normal
sender_sent_location      : 0/60005C8
sender_write_location     : 0/60005C8
sender_flush_location     : 0/60005C8
sender_replay_location    : 0/60005C8
receiver_received_location: 0/60005C8
receiver_write_location   : 0/60005C8
receiver_flush_location   : 0/60005C8
receiver_replay_location  : 0/60005C8
sync_state                : Async

node                      : 3
node_name                 : openeuler3

node                      : 3
instance_id               : 3
node_ip                   : 192.168.56.33
data_path                 : /opt/huawei/data/cmserver/cm_server
type                      : CMServer
instance_state            : Standby

node                      : 3
node_ip                   : 192.168.56.33
type                      : Fenced UDF
state                     : Normal

-----------------------------------------------------------------------
 

扩容过程中失败,有提示openeuler3: /tmp/gs_expansion_2023-04-10_11_05_19_591507/pkg/script/domain_utils/sql_handler/../../../lib/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?

经查是由于节点三的resovl.conf非空,导致执行预安装超时,注释掉DNS就行了。

直接安装三节点不报超时。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值