目录
[修改 install_cluster.json 配置文件](#修改 install_cluster.json 配置文件)
GaussDB介绍
华为自主创新研发的分布式关系型数据库。该产品具备企业级复杂事务混合负载能力,同时支持分布式事务,同城跨AZ部署,数据0丢失,支持1000+的扩展能力,PB级海量存储。同时拥有云上高可用,高可靠,高安全,弹性伸缩,一键部署,快速备份恢复,监控告警等关键能力,能为企业提供功能全面,稳定可靠,扩展性强,性能优越的企业级数据库服务。
服务器环境
--查操作系统版本cat /etc/.kyinfo--查cpu信息lscpu--查内存free -g--查磁盘df -h
安装前准备
配置会话不中断
echo 'export TMOUT=0' >> /etc/profilesource /etc/profile
更改主机名
--节点1hostnamectl set-hostname node01exec bash--节点2hostnamectl set-hostname node02exec bash--节点3hostnamectl set-hostname node03exec bash
配置/etc/hosts
--节点1 节点2 节点3 分别执行cp /etc/hosts /etc/hosts_bak_`date +%F`cat >> /etc/hosts << "EOF"192.168.30.51 node01192.168.30.52 node02192.168.30.53 node03EOF
配置ssh互信
#下载脚本wget https://gitcode.net/myneth/tools/-/raw/master/tool/ssh.shchmod +x ssh.sh#执行互信./ssh.sh -user root -hosts "node01 node02 node03" -advanced -exverify -confirmchmod 600 /root/.ssh/config#检查互信su - rootfor i in node{01,02,03};dossh $i hostname done
操作系统配置
关闭防火墙并禁止开机启动
systemctl stop firewalld.servicesystemctl disable firewalld.servicesystemctl status firewalld.service
更改selinux配置
修改 /etc/selinux/config 文件中的 SELINUX 值为 permissive
vi /etc/selinux/configSELINUX=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_20240820cp /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 $LANGen_US.UTF-8
swap交换内存 期望值:关闭 swap显示0
free
输出如下:
[root@node02 ~]# free total used free shared buff/cache availableMem: 31620992 712156 30208228 15012 700608 30259976Swap: 0 0 0
java版本
期望值:>=1.8.0
java -version
输出如下:
[root@node02 ~]# java -versionopenjdk 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 ~]# python3Python 3.7.9 (default, Mar 2 2021, 02:43:11)[GCC 7.3.0] on linuxType "help", "copyright", "credits" or "license" for more information.
expect
期望值:有回显
expect -v
输出如下:
[root@node01 ~]# expect -vexpect version 5.45.4
openssl
期望值:有回显
[root@node01 ~]# openssl versionOpenSSL 1.1.1f 31 Mar 2020
root密码一致
期望值:所有节点的root密码一致
注意:
用户密码中不能含有admin(不区分大小写)单词
用户密码中不能出现连续的重复字符,以及连续的数字不能超过两个
不然后面安装时会报错
root用户ssh连通性
期望值:集群节点root用户的ssh连通
--节点1ssh node02ssh node03--节点2ssh node01ssh node03--节点3ssh node01ssh 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/pkgunzip GaussDBInstaller_1.0.5.6_20230630015648.tar.gz
输出如下:
[root@node01 pkg]# tar -xvf GaussDBInstaller_1.0.5.6_20230630015648.tar.gzGaussDBInstaller/GaussDBInstaller/install_cluster.confGaussDBInstaller/ReadMe.txtGaussDBInstaller/gaussdb_install.pyGaussDBInstaller/pkgDir/GaussDBInstaller/pkgDir/ReadMe.txtGaussDBInstaller/jsonFileSample/GaussDBInstaller/jsonFileSample/3_nodes_centralized_paxos.jsonGaussDBInstaller/jsonFileSample/3_nodes_distributed.jsonGaussDBInstaller/jsonFileSample/4_nodes_distributed_4shards.jsonGaussDBInstaller/jsonFileSample/1_node.jsonGaussDBInstaller/jsonFileSample/5_nodes_distributed.jsonGaussDBInstaller/jsonFileSample/2_nodes_centralized_1primary_1standby_1logger.jsonGaussDBInstaller/jsonFileSample/4_nodes_distributed_8shards.jsonGaussDBInstaller/jsonFileSample/5_nodes_centralized.jsonGaussDBInstaller/jsonFileSample/9_nodes_distributed_8shards.jsonGaussDBInstaller/jsonFileSample/9_nodes_distributed_4shards.jsonGaussDBInstaller/jsonFileSample/3_nodes_centralized.jsonGaussDBInstaller/jsonFileSample/3_nodes_centralized_1primary_1standby_1logger.jsonGaussDBInstaller/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 = ommos_user_group = ${os_user}os_user_home = /home/${os_user}os_user_passwd = Topnet@123root_passwd = Topnet@123ssh_port = 22node_ip_list = 192.168.30.51,192.168.30.52,192.168.30.53[OMAGENT]gauss_home = /gaussdb/clusterom_agent_port = 30170mgr_net =data_net =virtual_net =log_dir = ${gauss_home}/logs/gaussdbcn_dir = ${gauss_home}/data/cngtm_dir = ${gauss_home}/data/gtmcm_dir = ${gauss_home}/data/cmtmp_dir = ${gauss_home}/tempdata_dir = ${gauss_home}/data/dntool_dir = ${gauss_home}/toolsetcd_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.jsoncp /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/pkgDirtotal 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/GaussDBInstallerpwd --输出 /gaussdb/soft/pkg/GaussDBInstaller--执行安装命令python3 gaussdb_install.py --action main
环境变量配置
vi /etc/profile增加export GAUSSDB_HOME=/gaussdb/cluster/core/app_da28c417PATH尾部增加export PATH=$PATH:$UNPACKPATH/script/gspylib/pssh/bin:$UNPACKPATH/script:$GAUSSDB_HOME/binLD_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 - ommLast login: Wed Aug 21 11:50:13 CST 2024 on pts/1[omm@node01 ~]$ cm_ctl query -Cvipd | grep cluster_statecluster_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 Primary2 192.168.30.52 192.168.30.52 2 /gaussdb/cluster/data/cm/cm_server Standby3 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 StateLeader2 192.168.30.52 192.168.30.52 7002 /gaussdb/cluster/data/etcd StateFollower3 192.168.30.53 192.168.30.53 7003 /gaussdb/cluster/data/etcd StateFollower[ Cluster State ]cluster_state : Normalredistributing : Nobalanced : Yescurrent_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 Normal2 192.168.30.52 192.168.30.52 5002 8000 /gaussdb/cluster/data/cn Normal3 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 Sync2 192.168.30.52 192.168.30.52 1002 /gaussdb/cluster/data/gtm S Standby Connection ok Sync3 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 Normal2 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 Normal3 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 -cvipcm_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 failedERROR: install_cluster.conf checked failed--问题原因密码不能包含两个以上的连续数字--解决办法更改服务器root用户密码符合要求su - rootpasswd
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 configureFalse--问题原因/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-agentpython3 /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
本文作者:董小姐