1)准备软件VMware® Workstation 16 Pro、xshell 7
2)准备安装包
GaussDB_Kernel_V500R002C10SPC600B012_X86_Distributed_AGENT_PACKAGE.tar.gz
GaussDB_Kernel_V500R002C10SPC600B012_X86_Distributed_SERVER_PACKAGE.tar.gz
DBS-GaussDBforOpenGauss-Adaptor_1.1.0.1663816251.tar.gz
EulerOS-V2.0SP10-x86_64-dvd.iso
1)管理平面网卡设置成nat模式,这样就换无线网就不需要修改静态ip地址了
操作步骤:Vmware 主页 => 创建新的虚拟机 => 典型 => 选择操作系统镜像 =>配置安装位置 => 自定义硬件(硬盘40GB,内存4GB,3个自定义网卡)=>完成
1)xshell链接服务器验证网络配置是否成功
1)设置硬件时间和操作系统时间,保持两个时间一致,避免每次重启机器集群时间不一致,导致集群自动重启失败
vim /etc/resolv.conf
nameserver x.x.x.x
nameserver x.x.x.x
vim /etc/yum.repos.d/EulerOS.repo
#粘贴下面内容后去掉首行
[base]
name=EulerOS-2.0SP5 base
baseurl=http://repo.huaweicloud.com/euler/2.5/os/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://repo.huaweicloud.com/euler/2.5/os/RPM-GPG-KEY-EulerOS
# 继续执行下面命令
yum clean all
yum makecache
#安装常用工具
yum install -y openssh-server vim gcc gcc-c++ glibc-headers bzip2-devel lzo-devel curl wget openssh-clients zlib-devel autoconf automake cmake libtool openssl-devel fuse-devel snappy-devel telnet unzip zip net-tools.x86_64 firewalld systemd
mkdir -p /opt/software/gaussdb
tar -xzf xxx_AGENT_PACKAGE.tar.gz
tar -xzf xxx-EULER-64bit-AGENT.tar.gz
mkdir server
mv xxx_SERVER_PACKAGE.tar.gz server/
tar -zcf server.tar.gz server/
tar -xzf DBS-GaussDBforOpenGauss-Adaptor_1.1.0.1663816251.tar.gz
1)创建omm用户、用户组,并修改密码,赋予相关权限
groupadd ommGroup
useradd -g ommGroup -d /home/omm -m -s /bin/bash omm
passwd omm
vim /home/omm/.bashrc
添加一行 export HOST_IP=管理ip
vim /etc/cron.allow
添加omm
mkdir -p /opt/rh/python27/root
ln -s /usr /opt/rh/python27/root/usr
chown -R omm:ommGroup /opt/software
su - omm
mkdir -p /home/omm/CA
mkdir -p /home/omm/sslcrt
mkdir -p /home/omm/demoCA/newcerts
touch demoCA/index.txt && echo '01' > demoCA/serial
vim /etc/pki/tls/openssl.cnf
openssl genrsa -aes256 -out ca.key 2048
openssl req -config /etc/pki/tls/openssl.cnf -new -key ca.key -out ca.csr
openssl ca -config /etc/pki/tls/openssl.cnf -days 365 -out ca.crt -keyfile ca.key -selfsign -infiles ca.csr
#修改/home/omm/demoCA/index.txt.attr文件
unique_subject = no
#依次执行下面命令
openssl genrsa -aes256 -out server.key 2048
openssl req -new -key server.key -out server.csr -config /etc/pki/tls/openssl.cnf
openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key -config /etc/pki/tls/openssl.cnf -days 365 -md sha256
cat ca.crt > ca.pem && cat server.crt > server.pem
cp ca.pem server.key server.pem /home/omm/sslcrt/
chmod 700 /home/omm/sslcrt
chmod 600 /home/omm/sslcrt/*
chown -R omm: /home/omm/sslcrt
1)这里的ssl_close =on,agent证书没用到
vim agent/om_agent.conf
mkdir -p /home/omm/log/om_agent
chown -R omm:ommGroup /home/omm/log
mkdir -p /dbs/om-agent
chmod 755 /dbs
chown -R omm:ommGroup /dbs/om-agent
cp agent/common/public_cloud.conf.sample agent/common/public_cloud.conf
vim public_cloud.conf
#修改网卡配置名称ens32,ens33,esn34
mkdir -p /opt/cluster/usr/local/package
mkdir -p /opt/cluster/var/lib/engine/data1/data
chown -R omm:ommGroup /opt/cluster
chown -R root:dbgrp /opt/cluster/usr/local/package
chmod -R 750 /opt/cluster/usr/local/package
chown root:dbgrp /opt/software/gaussdb/adaptor/utils/sudoer/gaussdbv5_api_sudo_exec.py
chmod 750 /opt/software/gaussdb/adaptor/utils/sudoer/gaussdbv5_api_sudo_exec.py
vim /etc/sudoers
添加下面内容
Defaults logfile =/var/log/sudo.log
Cmnd_Alias COMMAND_FLAG =/opt/cluster/usr/local/package/script/gs_preinstall *, /opt/software/gaussdb/adaptor/utils/sudoer/gaussdbv5_api_sudo_exec.py
omm ALL=(root) NOPASSWD: COMMAND_FLAG
su - omm
python3 /opt/software/gaussdb/agent/mgr/install.py --gen_ca_passwd xxxxxx
1)在3个节点上都要执行
su - omm
vim json_file
#粘贴下面内容,并修改其中的ip
{"dbPort": "8000", "nodeIp": "192.168.28.40", "packagePath": "/opt/software/gaussdb", "packageName": "server.tar.gz", "clusterMode": "combined", "clusterConf": "{\"gtmFree\": 1, \"clusterName\": \"CBG_Order\", \"solution\": \"hws\", \"cm\": [{\"rack\": \"gauss001\", \"az\": \"AZ1\", \"ip\": \"192.168.28.40\", \"dataIp\": \"192.168.38.40\", \"virtualIp\": \"192.168.48.40\"}, {\"rack\": \"gauss002\", \"az\": \"AZ2\", \"ip\":\"192.168.28.41\", \"dataIp\": \"192.168.38.41\", \"virtualIp\": \"192.168.48.41\"}, {\"rack\": \"gauss003\", \"az\": \"AZ3\", \"ip\": \"192.168.28.42\", \"dataIp\": \"192.168.38.42\", \"virtualIp\": \"192.168.48.42\"}], \"cn\": [{\"rack\": \"gauss001\", \"az\": \"AZ1\", \"ip\": \"192.168.28.40\", \"dataIp\": \"192.168.38.40\", \"virtualIp\": \"192.168.48.40\"}, {\"rack\": \"gauss002\", \"az\": \"AZ2\", \"ip\": \"192.168.28.41\", \"dataIp\": \"192.168.38.41\", \"virtualIp\": \"192.168.48.41\"}, {\"rack\": \"gauss003\", \"az\": \"AZ3\", \"ip\": \"192.168.28.42\", \"dataIp\": \"192.168.38.42\", \"virtualIp\": \"192.168.48.42\"}], \"shards\": [[{\"rack\": \"gauss001\", \"az\": \"AZ1\", \"ip\": \"192.168.28.40\", \"dataIp\": \"192.168.38.40\", \"virtualIp\": \"192.168.48.40\"}, {\"rack\": \"gauss002\", \"az\": \"AZ2\", \"ip\": \"192.168.28.41\", \"dataIp\": \"192.168.38.41\", \"virtualIp\": \"192.168.48.41\"}, {\"rack\": \"gauss003\", \"az\": \"AZ3\", \"ip\": \"192.168.28.42\", \"dataIp\": \"192.168.38.42\", \"virtualIp\": \"192.168.48.42\"}]], \"etcd\": {\"nodes\": [{\"rack\": \"gauss001\", \"az\": \"AZ1\", \"ip\": \"192.168.28.40\", \"dataIp\": \"192.168.38.40\", \"virtualIp\": \"192.168.48.40\"}, {\"rack\": \"gauss002\", \"az\": \"AZ2\", \"ip\": \"192.168.28.41\", \"dataIp\": \"192.168.38.41\", \"virtualIp\": \"192.168.48.41\"}, {\"rack\": \"gauss003\", \"az\": \"AZ3\", \"ip\": \"192.168.28.42\", \"dataIp\": \"192.168.38.42\", \"virtualIp\": \"192.168.48.42\"}]}, \"gtm\": [{\"rack\": \"gauss001\", \"az\": \"AZ1\", \"ip\": \"192.168.28.40\", \"dataIp\": \"192.168.38.40\", \"virtualIp\": \"192.168.48.40\"}, {\"rack\": \"gauss002\", \"az\": \"AZ2\", \"ip\": \"192.168.28.41\", \"dataIp\": \"192.168.38.41\", \"virtualIp\": \"192.168.48.41\"}, {\"rack\": \"gauss003\", \"az\": \"AZ3\", \"ip\": \"192.168.28.42\", \"dataIp\": \"192.168.38.42\", \"virtualIp\": \"192.168.48.42\"}], \"replicaNum\": 3, \"shardingNum\": 1}", "func_name": "pre_install"}
su - omm
vim install_json_file
#粘贴下面内容,并设置密码
{"rdsMetricPasswd": "xxxxxx", "rdsBackupUser": "rdsBackup", "rdsAdminUser": "rdsAdmin", "rdsMetricUser": "rdsMetric", "dbUser": "root", "server_crt_filename": "server.pem", "enableForceSwitch": null, "ca_crt_filename": "ca.pem", "cmParams": {}, "params": {"enable_thread_pool":"off"}, "nodeIp": "192.168.28.40", "clusterMode": "combined", "func_name": "install", "dnParams": {}, "rdsBackupPasswd": "xxxxxx","server_key_filename": "server.key", "cnParams": {}, "ssl_cert_path": "/home/omm/sslcrt", "dbPort": "8000", "rdsReplUser": "rdsRepl", "dbUserPasswd": "xxxxxx", "rdsAdminPasswd": "xxxxxx", "rdsReplPasswd": "xxxxxx", "ssl_cert_passwd": "xxxxxx", "replicationAll":"true"}
1) 在三个节点上都要执行命令
cat json_file | python3 /opt/software/gaussdb/adaptor/om_controller
2) 预安装报错操作系统不满足要求,报错信息中提示让执行gs_checkos -i A -h 192.168.28.40
3)执行后发现需要关闭交换内存 ,执行命令swapoff -a
4)正常返回结果
{\"detailmsg\": \"SUCCESS\", \"retcode\": 0}
1)在任意一个节点执行命令即可
cat install_json_file | python3 /opt/software/gaussdb/adaptor/om_controller
2)正常返回结果
{\"detailmsg\": \"SUCCESS\", \"retcode\": 0}
1)停止集群
见上文
2)查表
1)问题现象
2)使用命令检查各个网络平面的网络是否互通
ping -I 源端ip 目的ip
3)检查上述命令不通,再检查网关,也不通
ping -I 192.168.38.42 192.168.38.1
4)检查虚拟机网络,发现网卡顺序选错,三个虚拟机的网卡2和网卡3应该保持一致
1)问题现象
2)调大虚拟机内存6G。很多问题都是因为内存不勾引起的,比如调用gauss -V会出现报错信息
Segmentation fault
3)进入到dn目录,修改shared_buffers属性。改完后再修改其他组件(CN、DN等)shared_buffers属性
4)查看组件的数据目录
执行命令
cm_ctl view
5)调小shared_buffers属性
vim /opt/cluster/var/lib/engine/data1/data/dn_6003/postgresql.conf
安装GaussDB的时候dn节点采用的三分片部署形式,发现安装时内存不够,修改json_file文件后,重新安装,使用cm_ctl query -Cvidp查询发现还是之前的部署的3分片形式,json_file 未生效
rm -rf /opt/cluster
mkdir -p /opt/cluster/usr/local/package
mkdir -p /opt/cluster/var/lib/engine/data1/data
chown -R omm:ommGroup /opt/cluster
chown -R root:ommGroup /opt/cluster/usr/local/package
重新执行前置准备、预安装、安装
未记录
1) 检查根目录空间情况,发现已经达到100%
1)sda3是后面加的
执行命令 :fdisk /dev/sda
如步骤3) 图中红线框到的部分,新增一个分区
reboot
pvcreate /dev/sda3
1)将物理卷加入到名为euleros(上图VG字段)的逻辑卷组中
vgextend euleros /dev/sda3
1)发现euleros卷组下有一块空闲的空间
lvextend -L +19.75G /dev/mapper/euleros-root
resize2fs /dev/mapper/euleros-root
df -h
解决办法(未找到):重装可解决问题