GaussDB 24.1.30 分布式3节点命令行方式部署
本文作者:董小姐
GaussDB介绍
华为自主创新研发的分布式关系型数据库。该产品具备企业级复杂事务混合负载能力,同时支持分布式事务,同城跨AZ部署,数据0丢失,支持1000+的扩展能力,PB级海量存储。同时拥有云上高可用,高可靠,高安全,弹性伸缩,一键部署,快速备份恢复,监控告警等关键能力,能为企业提供功能全面,稳定可靠,扩展性强,性能优越的企业级数据库服务。
服务器环境
--查操作系统版本
cat /etc/.kyinfo
--查cpu信息
lscpu
--查内存
free -g
--查磁盘
df -h
安装前准备
配置会话不中断
echo 'export TMOUT=0' >> /etc/profile
source /etc/profile
更改主机名
--节点1
hostnamectl set-hostname node01
exec bash
--节点2
hostnamectl set-hostname node02
exec bash
--节点3
hostnamectl set-hostname node03
exec bash
配置/etc/hosts
--节点1 节点2 节点3 分别执行
cp /etc/hosts /etc/hosts_bak_`date +%F`
cat >> /etc/hosts << "EOF"
192.168.30.51 node01
192.168.30.52 node02
192.168.30.53 node03
EOF
配置ssh互信
#下载脚本
wget https://gitcode.net/myneth/tools/-/raw/master/tool/ssh.sh
chmod +x ssh.sh
#执行互信
./ssh.sh -user root -hosts "node01 node02 node03" -advanced -exverify -confirm
chmod 600 /root/.ssh/config
#检查互信
su - root
for i in node{01,02,03};do
ssh $i hostname
done
操作系统配置
关闭防火墙并禁止开机启动
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service
更改selinux配置
修改 /etc/selinux/config 文件中的 SELINUX 值为 permissive
vi /etc/selinux/config
SELINUX=enforcing
改成
SELINUX=permissive
--重启系统
reboot
设置字符集参数
将各主机的字符集设置为相同的字符集
vi /etc/profile
尾部增加
export LANG=en_US.UTF-8
--配置文件生效
source /etc/profile
设置时区和时间
检查时区和时间
date
设置时区与时间
将 /usr/share/zoneinfo/ 目录下的时区文件拷贝到 /etc/localtime
mv /etc/localtime /etc/localtime_bak_20240820
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
使用 date -s 命令将各主机的时间设置为统一时间
date -s "2024-08-20 17:11:12"
关闭swap交换内存
swapoff -a
checklist检查清单
检查服务器firewalld是否关闭
输出:Active: inactive (dead)
systemctl status firewalld
检查iptables是否开启
输出:Active: inactive (dead)
systemctl status iptables
是否关闭selinux
输出Disabled
getenforce
检查服务器时间是否一致
date
检查数据磁盘文件系统类型
期望值:ext4
df -T
服务器字符集
期望值:en_US.UTF-8
echo $LANG
输出如下:
[root@node02 ~]# echo $LANG
en_US.UTF-8
swap交换内存
期望值:关闭 swap显示0
free
输出如下:
[root@node02 ~]# free
total used free shared buff/cache available
Mem: 31620992 712156 30208228 15012 700608 30259976
Swap: 0 0 0
java版本
期望值:>=1.8.0
java -version
输出如下:
[root@node02 ~]# java -version
openjdk version "1.8.0_272"
OpenJDK Runtime Environment Bisheng (build 1.8.0_272-b10)
OpenJDK 64-Bit Server VM Bisheng (build 25.272-b10, mixed mode)
python3版本
期望值:>3.7.4(arm) >3.7.9(x86)
python3
输出如下:
[root@node02 ~]# python3
Python 3.7.9 (default, Mar 2 2021, 02:43:11)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
expect
期望值:有回显
expect -v
输出如下:
[root@node01 ~]# expect -v
expect version 5.45.4
openssl
期望值:有回显
[root@node01 ~]# openssl version
OpenSSL 1.1.1f 31 Mar 2020
root密码一致
期望值:所有节点的root密码一致
注意:
用户密码中不能含有admin(不区分大小写)单词
用户密码中不能出现连续的重复字符,以及连续的数字不能超过两个
不然后面安装时会报错
root用户ssh连通性
期望值:集群节点root用户的ssh连通
--节点1
ssh node02
ssh node03
--节点2
ssh node01
ssh node03
--节点3
ssh node01
ssh node02
上传软件包和安装脚本
联系华为厂商申请并下载相应版本的安装介质。本文档是GaussDB 24.1.30 分布式
安装脚本另外联系华为厂商获取:GaussDBInstaller_1.0.5.6_20230630015648.tar.gz
--创建存放安装介质的目录
mkdir -p /gaussdb/soft/pkg
将安装包上传到了/gaussdb/soft目录下。
安装脚本:GaussDBInstaller_1.0.5.6_20230630015648.tar.gz
安装介质:
总共3个文件:GaussDB-Kernel_505.1.0.B026_Om_X86_Distributed.tar.gz 分集中式分布式注意版本
GaussDB-Kernel_505.1.0.B026_Server_X86_Distributed.tar.gz 分集中式分布式注意版本
- DBS-GaussDB-Kernel_24.1.30.835752444875136.tar.gz(windows上用7z打开逐层打开直到看到如下2个文件,将如下2个文件上传至/gaussdb/soft/pkg目录下)
[root@node01 pkg]# ls -l Gau*
-rw-r--r-- 1 root root 32392827 4月 18 23:49 GaussDB-Kernel_505.1.0.B026_Om_X86_Distributed.tar.gz
-rw-r--r-- 1 root root 861349604 4月 18 23:49 GaussDB-Kernel_505.1.0.B026_Server_X86_Distributed.tar.gz
- DBS-MetaDB_Kylin_Centralized_505.1.RC1.SPC0100.B006 .tar.gz(windows上用7z打开逐层打开直到看到如下2个文件,将如下2个文件上传至/gaussdb/soft/pkg目录下)
[root@node01 pkg]# ls -l *Ad*
-rw-r--r-- 1 root root 427997 3月 29 10:21 DBS-GaussDB-Adaptor_2.23.07.265.1708416436.tar.gz
安装脚本配置
解压安装脚本
cd /gaussdb/soft/pkg
unzip GaussDBInstaller_1.0.5.6_20230630015648.tar.gz
输出如下:
[root@node01 pkg]# tar -xvf GaussDBInstaller_1.0.5.6_20230630015648.tar.gz
GaussDBInstaller/
GaussDBInstaller/install_cluster.conf
GaussDBInstaller/ReadMe.txt
GaussDBInstaller/gaussdb_install.py
GaussDBInstaller/pkgDir/
GaussDBInstaller/pkgDir/ReadMe.txt
GaussDBInstaller/jsonFileSample/
GaussDBInstaller/jsonFileSample/3_nodes_centralized_paxos.json
GaussDBInstaller/jsonFileSample/3_nodes_distributed.json
GaussDBInstaller/jsonFileSample/4_nodes_distributed_4shards.json
GaussDBInstaller/jsonFileSample/1_node.json
GaussDBInstaller/jsonFileSample/5_nodes_distributed.json
GaussDBInstaller/jsonFileSample/2_nodes_centralized_1primary_1standby_1logger.json
GaussDBInstaller/jsonFileSample/4_nodes_distributed_8shards.json
GaussDBInstaller/jsonFileSample/5_nodes_centralized.json
GaussDBInstaller/jsonFileSample/9_nodes_distributed_8shards.json
GaussDBInstaller/jsonFileSample/9_nodes_distributed_4shards.json
GaussDBInstaller/jsonFileSample/3_nodes_centralized.json
GaussDBInstaller/jsonFileSample/3_nodes_centralized_1primary_1standby_1logger.json
GaussDBInstaller/install_cluster.sh
安装包移动
下面三个软件包上传至 /data/GaussDBInstaller/pkgDir 目录下 ,版本号根据具体的项目更改。
DBS-GaussDB-Adaptor_2.23.07.265.1708416436.tar.gz
GaussDB-Kernel_505.1.0.B026_Om_X86_Distributed.tar.gz
GaussDB-Kernel_505.1.0.B026_Server_X86_Distributed.tar.gz
cp /gaussdb/soft/pkg/DBS-GaussDB-Adaptor_2.23.07.265.1708416436.tar.gz /gaussdb/soft/pkg/GaussDBInstaller/pkgDir/
cp /gaussdb/soft/pkg/GaussDB-Kernel_505.1.0.B026_Om_X86_Distributed.tar.gz /gaussdb/soft/pkg/GaussDBInstaller/pkgDir/
cp /gaussdb/soft/pkg/GaussDB-Kernel_505.1.0.B026_Server_X86_Distributed.tar.gz /gaussdb/soft/pkg/GaussDBInstaller/pkgDir/
配置文件修改
修改 安装脚本中的install_cluster.conf 配置文件
install_cluster.conf 配置文件参数说明
注意:密码中不能用连续的数字
cd /gaussdb/soft/pkg/GaussDBInstaller/
cp install_cluster.conf install_cluster.conf_bak_`date +%F`
cat install_cluster.conf
[COMMON]
os_user = omm #不修改!!! -操作系统上安装数据库的用户
os_user_group = ${os_user} #不修改!!! -操作系统上安装数据库的用户组
os_user_home = /home/${os_user} #不修改!!! -数据库用户家目录
os_user_passwd = Gauss_246 #不修改!!! -操作系统上安装数据库的用户的密码建议与下面的root密码一致
root_passwd = Huawei@135 #os root密码 修改为自己实际的,保证所有节点密码一致
ssh_port = 22 #ssh端口
node_ip_list = 192.168.0.162,192.168.0.192,192.168.0.164 ##所有节点的IP,数据库安装涉及到的全都要写,修改为自己实际的,以,进行隔开
[OMAGENT]
gauss_home = /data/cluster #集群安装目录,将此处的/data修改为自己磁盘的实际挂载目录,确保/data下的cluster目录提前不存在,需要选择磁盘容量超过50G的分区目录
om_agent_port = 30170 #不修改!!!omagent服务端口,确保该端口未被使用,需要注意的是om_agent端口不能与install_cluster.json中的dbPort相同
mgr_net = #不修改!!!mgr_net data_net virtual_net三个参数无需配置,1.0.3以后的版本自动配置
data_net = #不修改!!!mgr_net data_net virtual_net三个参数无需配置,1.0.3以后的版本自动配置
virtual_net = #不修改!!!mgr_net data_net virtual_net三个参数无需配置,1.0.3以后的版本自动配置
log_dir = ${gauss_home}/logs/gaussdb ##不修改!!!${gauss_home}表示的是/data/cluster,如果有特殊需要可自行修改
cn_dir = ${gauss_home}/data/cn #不修改!!!${gauss_home}表示的是/data/cluster,如果有特殊需要可自行修改
gtm_dir = ${gauss_home}/data/gtm #不修改!!!${gauss_home}表示的是/data/cluster,如果有特殊需要可自行修改
cm_dir = ${gauss_home}/data/cm #不修改!!!${gauss_home}表示的是/data/cluster,如果有特殊需要可自行修改
tmp_dir = ${gauss_home}/temp #不修改!!!${gauss_home}表示的是/data/cluster,如果有特殊需要可自行修改
data_dir = ${gauss_home}/data/dn #不修改!!!${gauss_home}表示的是/data/cluster,如果有特殊需要可自行修改
tool_dir = ${gauss_home}/tools #不修改!!!${gauss_home}表示的是/data/cluster,如果有特殊需要可自行修改
etcd_dir = ${gauss_home}/data/etcd #不修改!!!${gauss_home}表示的是/data/cluster,如果有特殊需要可自行修改
补充:
数据库安装目录:默认路径都是/data/cluster
1.如果没有自定义路径的需求,默认即可
2.如果有自定义cn、dn、etcd、gtm路径安装的需求:
举例:需要把cn_dir路径配置到/data/cn路径下配置修改格式:cn dir=/data/cn
其他路径的自定义路径同上
修改后的install_cluster.conf 配置文件
cd /gaussdb/soft/pkg/GaussDBInstaller/
vi install_cluster.conf
[COMMON]
os_user = omm
os_user_group = ${os_user}
os_user_home = /home/${os_user}
os_user_passwd = Topnet@123
root_passwd = Topnet@123
ssh_port = 22
node_ip_list = 192.168.30.51,192.168.30.52,192.168.30.53
[OMAGENT]
gauss_home = /gaussdb/cluster
om_agent_port = 30170
mgr_net =
data_net =
virtual_net =
log_dir = ${gauss_home}/logs/gaussdb
cn_dir = ${gauss_home}/data/cn
gtm_dir = ${gauss_home}/data/gtm
cm_dir = ${gauss_home}/data/cm
tmp_dir = ${gauss_home}/temp
data_dir = ${gauss_home}/data/dn
tool_dir = ${gauss_home}/tools
etcd_dir = ${gauss_home}/data/etcd
查看脚本安装内容
说明:如下所示为常见的不同部署方式的配置文件,根据自己的需要选择即可:
centralized:集中式
distributed:分布式
[root@node01 ~]# ll /gaussdb/soft/pkg/GaussDBInstaller/jsonFileSample/
total 68
-rw------- 1 root root 1021 Jun 30 2023 1_node.json
-rw------- 1 root root 2138 Jun 30 2023 2_nodes_centralized_1primary_1standby_1logger.json
-rw------- 1 root root 2246 Jun 30 2023 3_nodes_centralized_1primary_1standby_1logger.json
-rw------- 1 root root 2187 Jun 30 2023 3_nodes_centralized.json
-rw------- 1 root root 2186 Jun 30 2023 3_nodes_centralized_paxos.json
-rw------- 1 root root 4048 Jun 30 2023 3_nodes_distributed.json
-rw------- 1 root root 3860 Jun 30 2023 4_nodes_distributed_4shards.json
-rw------- 1 root root 5889 Jun 30 2023 4_nodes_distributed_8shards.json
-rw------- 1 root root 2811 Jun 30 2023 5_nodes_centralized.json
-rw------- 1 root root 6128 Jun 30 2023 5_nodes_distributed.json
-rw------- 1 root root 6128 Jun 30 2023 9_nodes_distributed_4shards.json
-rw------- 1 root root 9456 Jun 30 2023 9_nodes_distributed_8shards.json
修改 install_cluster.json 配置文件
拷贝json文件
拷贝指定部署方式的json文件(以3节点分布式为例)到脚本解压后的目录GaussDBInstaller下
cp /gaussdb/soft/pkg/GaussDBInstaller/jsonFileSample/3_nodes_distributed.json /gaussdb/soft/pkg/GaussDBInstaller/install_cluster.json
修改 install_cluster.json 配置文件
说明:以下参数如无特殊说明都不要进行修改,使用时请删除掉注释
cat /gaussdb/soft/pkg/GaussDBInstaller/install_cluster.json
cp /gaussdb/soft/pkg/GaussDBInstaller/install_cluster.json /gaussdb/soft/pkg/GaussDBInstaller/install_cluster.json_bak_`date +%F`
cat /gaussdb/soft/pkg/GaussDBInstaller/install_cluster.json
{
#安装数据库时创建的omm用户是操作系统数据库用户,真正的数据库用户和密码如下rdsAdminUser和rdsAdminPasswd
"rdsAdminUser":"rdsAdmin",
"rdsAdminPasswd":"Gauss_123",
"rdsMetricUser":"rdsMetric",
"rdsMetricPasswd":"huawei@123Pwd",
"rdsReplUser":"rdsRepl",
"rdsReplPasswd":"huawei@123Pwd",
"rdsBackupUser":"rdsBackup",
"rdsBackupPasswd":"huawei@123Pwd",
"dbPort":"8000",
"dbUser":"root",
"dbUserPasswd":"Topnet@123", #修改为自己的root账户密码
"clusterMode":"combined",
"params":{
"enable_thread_pool":"on",
"enable_bbox_dump":"on",
"bbox_dump_path":"/home/core"
},
"cnParams":{
},
"dnParams":{
},
"cmParams":{
},
"clusterConf":{
"clusterName":"Gauss_XuanYuan",
"encoding": "utf8",
"shardingNum": 3,
"replicaNum": 3,
"solution":"hws",
"cm":[
{
"rack": "node01", #将下列中的所有rack值修改为自己的服务器节点主机名,将对应节点下面的IP全部换成节点的IP值,如node01节点下所有的IP为192.168.1.101
"az": "AZ1",
"ip": "192.168.30.51",
"dataIp":"192.168.30.51",
"virtualIp":"192.168.30.51"
},
{
"rack": "node02",
"az": "AZ2",
"ip": "192.168.30.52",
"dataIp":"192.168.30.52",
"virtualIp":"192.168.30.52"
},
{
"rack": "node03",
"az": "AZ3",
"ip": "192.168.30.53",
"dataIp":"192.168.30.53",
"virtualIp":"192.168.30.53"
}
],
"cn":[
{
"rack": "node01",
"az": "AZ1",
"ip": "192.168.30.51",
"dataIp":"192.168.30.51",
"virtualIp":"192.168.30.51"
},
{
"rack": "node02",
"az": "AZ2",
"ip": "192.168.30.52",
"dataIp":"192.168.30.52",
"virtualIp":"192.168.30.52"
},
{
"rack": "node03",
"az": "AZ3",
"ip": "192.168.30.53",
"dataIp":"192.168.30.53",
"virtualIp":"192.168.30.53"
}
],
"gtm":[
{
"rack": "node01",
"az": "AZ1",
"ip": "192.168.30.51",
"dataIp":"192.168.30.51",
"virtualIp":"192.168.30.51"
},
{
"rack": "node02",
"az": "AZ2",
"ip": "192.168.30.52",
"dataIp":"192.168.30.52",
"virtualIp":"192.168.30.52"
},
{
"rack": "node03",
"az": "AZ3",
"ip": "192.168.30.53",
"dataIp":"192.168.30.53",
"virtualIp":"192.168.30.53"
}
],
"shards":[
[
{
"rack": "node01",
"az": "AZ1",
"ip": "192.168.30.51",
"dataIp":"192.168.30.51",
"virtualIp":"192.168.30.51"
},
{
"rack": "node02",
"az": "AZ2",
"ip": "192.168.30.52",
"dataIp":"192.168.30.52",
"virtualIp":"192.168.30.52"
},
{
"rack": "node03",
"az": "AZ3",
"ip": "192.168.30.53",
"dataIp":"192.168.30.53",
"virtualIp":"192.168.30.53"
}
],
[
{
"rack": "node02",
"az": "AZ2",
"ip": "192.168.30.52",
"dataIp":"192.168.30.52",
"virtualIp":"192.168.30.52"
},
{
"rack": "node01",
"az": "AZ1",
"ip": "192.168.30.51",
"dataIp":"192.168.30.51",
"virtualIp":"192.168.30.51"
},
{
"rack": "node03",
"az": "AZ3",
"ip": "192.168.30.53",
"dataIp":"192.168.30.53",
"virtualIp":"192.168.30.53"
}
],
[
{
"rack": "node03",
"az": "AZ3",
"ip": "192.168.30.53",
"dataIp":"192.168.30.53",
"virtualIp":"192.168.30.53"
},
{
"rack": "node02",
"az": "AZ2",
"ip": "192.168.30.52",
"dataIp":"192.168.30.52",
"virtualIp":"192.168.30.52"
},
{
"rack": "node01",
"az": "AZ1",
"ip": "192.168.30.51",
"dataIp":"192.168.30.51",
"virtualIp":"192.168.30.51"
}
]
],
"etcd":{
"nodes":[
{
"rack": "node01",
"az": "AZ1",
"ip": "192.168.30.51",
"dataIp":"192.168.30.51",
"virtualIp":"192.168.30.51"
},
{
"rack": "node02",
"az": "AZ2",
"ip": "192.168.30.52",
"dataIp":"192.168.30.52",
"virtualIp":"192.168.30.52"
},
{
"rack": "node03",
"az": "AZ3",
"ip": "192.168.30.53",
"dataIp":"192.168.30.53",
"virtualIp":"192.168.30.53"
}
]
}
}
}
安装包检查
查看pkgDir目录下的安装包
注意:此处注意清理掉其他所有文件,仅仅保留以下的几个文件
[root@node01 ~]# ls -l /gaussdb/soft/pkg/GaussDBInstaller/pkgDir
total 873224
-rw-r--r-- 1 root root 427997 Aug 20 19:11 DBS-GaussDB-Adaptor_2.23.07.265.1708416436.tar.gz
-rw-r--r-- 1 root root 32392827 Aug 20 19:11 GaussDB-Kernel_505.1.0.B026_Om_X86_Distributed.tar.gz
-rw-r--r-- 1 root root 861349604 Aug 20 19:11 GaussDB-Kernel_505.1.0.B026_Server_X86_Distributed.tar.gz
补充:实例安装原理
GaussDB 数据库使用 adaptor接口方式的安装,在adaptor、om-agent安装完成后,会调用 adaptor接口来执行实例的预安装和安装。
安装
--切换目录
cd /gaussdb/soft/pkg/GaussDBInstaller
pwd --输出 /gaussdb/soft/pkg/GaussDBInstaller
--执行安装命令
python3 gaussdb_install.py --action main
环境变量配置
vi /etc/profile
增加
export GAUSSDB_HOME=/gaussdb/cluster/core/app_da28c417
PATH尾部增加
export PATH=$PATH:$UNPACKPATH/script/gspylib/pssh/bin:$UNPACKPATH/script:$GAUSSDB_HOME/bin
LD_LIBRARY_PATH尾部增加
export LD_LIBRARY_PATH=/gaussdb/cluster/pylib/libsimsearch:$LD_LIBRARY_PATH:$GAUSSDB_HOME/lib
--环境变量生效
source /etc/profile
查看集群状态
查看集群状态
必须切换到安装用户omm下才有结果输出。
su - omm
cm_ctl query -Cvipd | grep cluster_state
或
cm_ctl query -Cvipd
输出如下:
[root@node01 GaussDBInstaller]# su - omm
Last login: Wed Aug 21 11:50:13 CST 2024 on pts/1
[omm@node01 ~]$ cm_ctl query -Cvipd | grep cluster_state
cluster_state : Normal
[omm@node01 ~]$ cm_ctl query -Cvipd
[ CMServer State ]
node node_ip instance state
--------------------------------------------------------------------------------
1 192.168.30.51 192.168.30.51 1 /gaussdb/cluster/data/cm/cm_server Primary
2 192.168.30.52 192.168.30.52 2 /gaussdb/cluster/data/cm/cm_server Standby
3 192.168.30.53 192.168.30.53 3 /gaussdb/cluster/data/cm/cm_server Standby
[ ETCD State ]
node node_ip instance state
------------------------------------------------------------------------------
1 192.168.30.51 192.168.30.51 7001 /gaussdb/cluster/data/etcd StateLeader
2 192.168.30.52 192.168.30.52 7002 /gaussdb/cluster/data/etcd StateFollower
3 192.168.30.53 192.168.30.53 7003 /gaussdb/cluster/data/etcd StateFollower
[ Cluster State ]
cluster_state : Normal
redistributing : No
balanced : Yes
current_az : AZ_ALL
[ Coordinator State ]
node node_ip instance state
----------------------------------------------------------------------
1 192.168.30.51 192.168.30.51 5001 8000 /gaussdb/cluster/data/cn Normal
2 192.168.30.52 192.168.30.52 5002 8000 /gaussdb/cluster/data/cn Normal
3 192.168.30.53 192.168.30.53 5003 8000 /gaussdb/cluster/data/cn Normal
[ Central Coordinator State ]
node node_ip instance state
----------------------------------------------------------------------
1 192.168.30.51 192.168.30.51 5001 /gaussdb/cluster/data/cn Normal
[ GTM State ]
node node_ip instance state sync_state
-------------------------------------------------------------------------------------------------------
1 192.168.30.51 192.168.30.51 1001 /gaussdb/cluster/data/gtm P Primary Connection ok Sync
2 192.168.30.52 192.168.30.52 1002 /gaussdb/cluster/data/gtm S Standby Connection ok Sync
3 192.168.30.53 192.168.30.53 1003 /gaussdb/cluster/data/gtm S Standby Connection ok Sync
[ Datanode State ]
node node_ip instance state | node node_ip instance state | node node_ip instance state
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 192.168.30.51 192.168.30.51 6001 33100 /gaussdb/cluster/data/dn/dn_6001 P Primary Normal | 2 192.168.30.52 192.168.30.52 6002 33100 /gaussdb/cluster/data/dn/dn_6002 S Standby Normal | 3 192.168.30.53 192.168.30.53 6003 33100 /gaussdb/cluster/data/dn/dn_6003 S Standby Normal
2 192.168.30.52 192.168.30.52 6004 33120 /gaussdb/cluster/data/dn/dn_6004 P Primary Normal | 1 192.168.30.51 192.168.30.51 6005 33120 /gaussdb/cluster/data/dn/dn_6005 S Standby Normal | 3 192.168.30.53 192.168.30.53 6006 33120 /gaussdb/cluster/data/dn/dn_6006 S Standby Normal
3 192.168.30.53 192.168.30.53 6007 33140 /gaussdb/cluster/data/dn/dn_6007 P Primary Normal | 2 192.168.30.52 192.168.30.52 6008 33140 /gaussdb/cluster/data/dn/dn_6008 S Standby Normal | 1 192.168.30.51 192.168.30.51 6009 33140 /gaussdb/cluster/data/dn/dn_6009 S Standby Normal
问题处理
--查看集群状态
[root@node01 GaussDBInstaller]# cm_ctl query -cvip
-bash: cm_ctl: command not found
[root@node01 ~]# cm_ctl query -cvip
cm_ctl: error while loading shared libraries: libcjson.so.1: cannot open shared object file: No such file or directory
--问题原因
未配置环境变量导致
--解决办法
按照上面的环境变量配置解决
问题处理
ERROR: install_cluster.conf checked failed
--问题描述
[root@node01 GaussDBInstaller]# python3 gaussdb_install.py --action main
[2024-08-21 10:43:35][root][INFO]:Start to execute cmd: sh /gaussdb/soft/pkg/GaussDBInstaller/install_cluster.sh getCurrentIp 192.168.30.51 192.168.30.52 192.168.30.53
[2024-08-21 10:43:36][root][INFO]:End to execute cmd sh /gaussdb/soft/pkg/GaussDBInstaller/install_cluster.sh getCurrentIp 192.168.30.51 192.168.30.52 192.168.30.53
192.168.30.52 192.168.30.53
[2024-08-21 10:43:36][root][INFO]:Start to execute preProcess...
[2024-08-21 10:43:36][root][INFO]:ADAPTOR_PACKAGE exists
[2024-08-21 10:43:36][root][INFO]:AGENT_PACKAGE exists
[2024-08-21 10:43:36][root][INFO]:SERVER_PACKAGE exists
[2024-08-21 10:43:36][root][INFO]:Integrity check passed
[2024-08-21 10:43:36][root][ERROR]:User passwd check failed! The password can't contain more than two consecutive digits.
[2024-08-21 10:43:36][root][ERROR]:conf key:os_user_passwd check failed
ERROR: install_cluster.conf checked failed
--问题原因
密码不能包含两个以上的连续数字
--解决办法
更改服务器root用户密码符合要求
su - root
passwd
install_cluster.json file ip not configure
--问题描述
安装提示
[root@node01 GaussDBInstaller]# python3 gaussdb_install.py --action main
[2024-08-21 10:52:03][root][INFO]:Start to execute cmd: sh /gaussdb/soft/pkg/GaussDBInstaller/install_cluster.sh getCurrentIp 192.168.30.51 192.168.30.52 192.168.30.53
[2024-08-21 10:52:03][root][INFO]:End to execute cmd sh /gaussdb/soft/pkg/GaussDBInstaller/install_cluster.sh getCurrentIp 192.168.30.51 192.168.30.52 192.168.30.53
192.168.30.52 192.168.30.53
[2024-08-21 10:52:03][root][INFO]:Start to execute preProcess...
[2024-08-21 10:52:03][root][INFO]:ADAPTOR_PACKAGE exists
[2024-08-21 10:52:03][root][INFO]:AGENT_PACKAGE exists
[2024-08-21 10:52:03][root][INFO]:SERVER_PACKAGE exists
[2024-08-21 10:52:03][root][INFO]:Integrity check passed
[2024-08-21 10:52:03][root][INFO]:Start to execute cmd: mkdir -p /gaussdb/cluster
[2024-08-21 10:52:03][root][INFO]:End to execute cmd mkdir -p /gaussdb/cluster
[2024-08-21 10:52:03][root][INFO]:Start check json file
[2024-08-21 10:52:03][root][INFO]:Start to execute cmd: cat /gaussdb/soft/pkg/GaussDBInstaller/install_cluster.json
[2024-08-21 10:52:03][root][INFO]:End to execute cmd cat /gaussdb/soft/pkg/GaussDBInstaller/install_cluster.json
[2024-08-21 10:52:03][root][INFO]:preProcess start check disk capacity
[2024-08-21 10:52:03][root][INFO]:Start to execute cmd: df -h /gaussdb/cluster |grep "/" |awk '{print $4}' | awk '$1=$1'
[2024-08-21 10:52:03][root][INFO]:End to execute cmd df -h /gaussdb/cluster |grep "/" |awk '{print $4}' | awk '$1=$1'
[2024-08-21 10:52:03][root][INFO]:Start check json file
[2024-08-21 10:52:03][root][INFO]:Start to execute cmd: cat /gaussdb/soft/pkg/GaussDBInstaller/install_cluster.json
[2024-08-21 10:52:03][root][INFO]:End to execute cmd cat /gaussdb/soft/pkg/GaussDBInstaller/install_cluster.json
[2024-08-21 10:52:03][root][INFO]:mgr_net_ip = , data_net_ip= , virtual_net_ip=
[2024-08-21 10:52:03][root][ERROR]:preProcess check failed: install_cluster.json file ip not configure
False
--问题原因
/gaussdb/soft/pkg/GaussDBInstaller/install_cluster.json 未更改
--解决办法
/gaussdb/soft/pkg/GaussDBInstaller/install_cluster.json 更改参数文件中的参数
扩展
实例安装原理
GaussDB 数据库使用 adaptor接口方式的安装,在adaptor、om-agent安装完成后,会调用 adaptor接口来执行实例的预安装和安装。
安装步骤分解
GaussDB管理平台的agent
adaptor接口日志位置:/home/omm/log/adaptor_log
om_agent安装
--安装om-agent
python3 /gaussdb/soft/pkg/GaussDBInstaller/pkgDir/omagent/agent/mgr/install.py,其中,/gaussdb/soft/pkg/GaussDBInstaller路径为om-agent包的解压路径
--查看om_agent om_agent.py进程在表示安装成功
ps -ef | grep om_agent
--日志位置
/home/omm/log/om_agent
/home/omm/log/om_tmp
预安装、安装
预安装、安装由上层组装json体,通过调用adaptor接口来实现
预安装的目的是在实例安装前完成实例的环境配置,以保证实例安装的正常进行预安装的 adaptor 接口名称为 preinstall,预安装需要在待安装实例的所有节点上以实例用户身份来执行。预安装完成后,就可以进行实例的安装了。实例安装的 adaptor 接口名称为 install,只需以实例用户身份在实例任一个节点上执行即可。
安装日志位置:/gaussdb/soft/pkg/GaussDBInstaller 下的install_cluster.log
安装成功标志:
--查看集群状态
必须切换到安装用户omm下才有结果输出。
su - omm
cm_ctl query -Cvipd
- 点赞
- 收藏
- 关注作者
评论(0)