1.正常安装GaussDB集群报错如下
[2023-09-07 16:18:59][root][INFO]:Start to execute cmd: sh /data/GaussDBInstaller/install_cluster.sh getCurrentIp 192.168.1.52 192.168.1.53 192.168.1.54
[2023-09-07 16:18:59][root][INFO]:End to execute cmd sh /data/GaussDBInstaller/install_cluster.sh getCurrentIp 192.168.1.52 192.168.1.53 192.168.1.54
[2023-09-07 16:18:59][root][INFO]:Start to execute installCluster...
[2023-09-07 16:18:59][root][INFO]:Start check json file
[2023-09-07 16:18:59][root][INFO]:Start to execute cmd: cat /data/GaussDBInstaller/install_cluster.json
[2023-09-07 16:18:59][root][INFO]:End to execute cmd cat /data/GaussDBInstaller/install_cluster.json
[2023-09-07 16:18:59][root][INFO]:The install cluster cmd is echo '{"dbPort": "8000", "nodeIp": "192.168.1.54", "rdsAdminUser": "rdsAdmin", "rdsAdminPasswd": "Gauss_123", "rdsMetricUser": "rdsMetric", "rdsMetricPasswd": "Gauss_123", "rdsReplUser": "rdsRepl", "rdsReplPasswd": "Gauss_123", "rdsBackupUser": "rdsBackup", "rdsBackupPasswd": "Gauss_123", "dbUser": "root", "dbUserPasswd": "Gauss_123", "params": {"enable_thread_pool": "on", "enable_bbox_dump": "on", "bbox_dump_path": "/home/core"}, "cnParams": {}, "dnParams": {}, "cmParams": {}, "ca_crt_filename": "ca.pem", "server_crt_filename": "server.pem", "server_key_filename": "server.key", "ssl_cert_passwd": "Gauss_2xx", "ssl_cert_path": "/home/omm/sslcrt", "enableForceSwitch": null, "clusterMode": "combined", "func_name": "install"}' | python3 /data/cluster/adaptor/om_controller
[2023-09-07 16:24:00][root][INFO]:The result of install is {"retcode": 1, "detailmsg": "Fail to install, Error: [FAILURE] 192.168.1.53:\n[GAUSS-51805] : The environmental variable [GAUSS_ENV]'s value is invalid.\n"}
[2023-09-07 16:24:00][root][ERROR]:InstallCluster in local host 192.168.1.54 execute failed, Error: {"retcode": 1, "detailmsg": "Fail to install, Error: [FAILURE] 192.168.1.53:\n[GAUSS-51805] : The environmental variable [GAUSS_ENV]'s value is invalid.\n"}
/data/GaussDBInstaller/install_cluster.sh: line 725: cm_ctl: command not found
installCluster installation faild
我们可以看到:GAUSS_ENV 环境变量无效。
通过检查各个数据节点:
su - omm
[omm@gaussdb02 ~]$ cat gauss_env_file
export CLUSTER_MODE=mixin
export AGENT_PORT=30170
source /etc/gauss_env_file_global
export "PATH_HOTPATCH_FILE="
export GAUSS_WARNING_TYPE=5
export GPHOME=/data/cluster/tools
export ETCD_UNSUPPORTED_ARCH=386
export PATH=$GPHOME/script/gspylib/pssh/bin:$GPHOME/script:$PATH
export GAUSSHOME=/data/cluster/core/app
export PATH=$GAUSSHOME/bin:$PATH
export LD_LIBRARY_PATH=$GAUSSHOME/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$GAUSSHOME/lib/libsimsearch:$LD_LIBRARY_PATH:$GPHOME/script/gspylib/clib
export S3_CLIENT_CRT_FILE=$GAUSSHOME/lib/client.crt
export GAUSS_VERSION=503.1.0.SPC1200
export PGHOST=/data/cluster/temp
export GAUSSLOG=/data/cluster/logs/gaussdb/omm
export OPENSSL_CONF=$GAUSSHOME/share/sslcert/etcd/openssl.cnf
export ETCD_UNSUPPORTED_ARCH=386
export MPPDB_ENV_SEPARATE_PATH=/home/omm/gauss_env_file
export PGUSER=rdsAdmin
export BACKUP_USER=rdsBackup
if [ -f '/data/cluster/core/app/utilslib/env_ec' ] && [ `id -u` -ne 0 ]; then source '/data/cluster/core/app/utilslib/env_ec'; fi
export GAUSS_ENV=2 --个别节点这个值没有生生成。
export GS_CLUSTER_NAME=Gauss_Cluster
export WHITELIST_ENV=1
2.原因
su - omm
vi .bash_profile 里面有不正确的java环境变量。
export JAVA_HOME=环境变量路径错误。且我把 gauss_env_file 环境变量文件中的内容粘贴到了
.bash_profile; 这个隐藏文件中。删除手工贴入的环境变量。重新部署就成功了。
3.总结
GaussDB是比较新的问题,环境变量的问题,清理环境变量,重新部署就可以了。