环境说明
openEuler-22.0.3-LTS + opengauss5.0.1
安装数据库
安装系统依赖包
yum -y install lksctp*
yum -y install psmisc
yum -y install bzip2
yum -y install unzip
yum -y install gcc
yum -y install gcc-c++
yum -y install perl
yum -y install libxml2-devel
yum -y install libaio-devel
yum -y install flex
yum -y install bison
yum -y install ncurses-devel
yum -y install glibc-devel
yum -y install patch
yum -y install readline-devel
yum -y install redhat-lsb-core
yum -y install openssh
yum -y install expect
yum -y install tcl
安装python依赖包
[root@openeuler161 script]# pip3 install paramiko==3.4.0
[root@openeuler161 script]# pip3 install paramiko==3.4.0
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Looking in indexes: http://mirrors.aliyun.com/pypi/simple
Requirement already satisfied: paramiko==3.4.0 in /usr/local/lib/python3.9/site-packages (3.4.0)
Requirement already satisfied: cryptography>=3.3 in /usr/local/lib64/python3.9/site-packages (from paramiko==3.4.0) (42.0.7)
Requirement already satisfied: bcrypt>=3.2 in /usr/local/lib64/python3.9/site-packages (from paramiko==3.4.0) (4.1.3)
Requirement already satisfied: pynacl>=1.5 in /usr/local/lib64/python3.9/site-packages (from paramiko==3.4.0) (1.5.0)
Requirement already satisfied: cffi>=1.12 in /usr/local/lib64/python3.9/site-packages (from cryptography>=3.3->paramiko==3.4.0) (1.16.0)
Requirement already satisfied: pycparser in /usr/local/lib/python3.9/site-packages (from cffi>=1.12->cryptography>=3.3->paramiko==3.4.0) (2.22pip3 install paramiko==3.4.0[root@openeuler161 script]# pip3 list
Package Version
------------------- -------
bcrypt 4.1.3
cffi 1.16.0
configobj 5.0.6
cryptography 42.0.7
decorator 5.0.9
distro 1.6.0
gpg 1.16.0
libcomps 0.1.18
nftables 0.1
paramiko 3.4.0
perf 0.1
pip 21.3.1
pycairo 1.20.0
pycparser 2.22
PyGObject 3.42.0
PyNaCl 1.5.0
pyparsing 3.0.6
python-dateutil 2.8.2
python-linux-procfs 0.6.3
pyudev 0.22.0
rpm 4.17.0
schedutils 0.6
setuptools 59.4.0
six 1.16.0
SSSDConfig 2.6.1
出现死循环问题可参考:添加链接描述
下载并解压依赖包
-rwxr-xr-x 1 omm dbgrp 108 May 12 05:47 openGauss-5.0.1-openEuler-64bit-cm.sha256
-rwxr-xr-x 1 omm dbgrp 22M May 12 05:47 openGauss-5.0.1-openEuler-64bit-cm.tar.gz
-rwxrwxr-x 1 omm dbgrp 65 May 12 05:47 openGauss-5.0.1-openEuler-64bit-om.sha256
-rwxrwxr-x 1 omm dbgrp 11M May 12 05:47 openGauss-5.0.1-openEuler-64bit-om.tar.gz
-rwxrwxr-x 1 omm dbgrp 65 May 12 05:47 openGauss-5.0.1-openEuler-64bit.sha256
-rwxrwxr-x 1 omm dbgrp 97M May 12 05:47 openGauss-5.0.1-openEuler-64bit.tar.bz2
-rw------- 1 omm dbgrp 135M May 12 07:37 openGauss-Package-bak_33b035fd.tar.gz
tar -xvf openGauss-5.0.1-openEuler-64bit-cm.tar.gz
tar -xvf openGauss-5.0.1-openEuler-64bit-om.tar.gz
配置xml文件
root@openeuler161 openGauss]# cat cluster_cm.xml
<?xml version="1.0" encoding="UTF-8"?>
<ROOT><!-- openGauss整体信息 --><CLUSTER><PARAM name="clusterName" value="Cluster_template" /><PARAM name="nodeNames" value="openeuler161,openeuler162" /><PARAM name="gaussdbAppPath" value="/data/app" /><PARAM name="gaussdbLogPath" value="/data/omm" /><PARAM name="tmpMppdbPath" value="/data/tmp"/><PARAM name="gaussdbToolPath" value="/data/om" /><PARAM name="corePath" value="/data/corefile"/><PARAM name="backIp1s" value="192.168.99.161,192.168.99.162"/></CLUSTER><!-- 每台服务器上的节点部署信息 --><DEVICELIST><!-- node1上的节点部署信息 --><DEVICE sn="openeuler161"><PARAM name="name" value="openeuler161"/><PARAM name="azName" value="AZ1"/><PARAM name="azPriority" value="1"/><!-- 如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP --><PARAM name="backIp1" value="192.168.99.161"/><PARAM name="sshIp1" value="192.168.99.161"/><!-- cm主 --> <PARAM name="cmsNum" value="1"/> <PARAM name="cmDir" value="/data/cm"/> <PARAM name="cmServerPortBase" value="15300"/> <PARAM name="cmServerListenIp1" value="192.168.99.161,192.168.99.162"/> <PARAM name="cmServerHaIp1" value="192.168.99.161,192.168.99.162"/> <!-- cmServerlevel目前只支持1 --> <PARAM name="cmServerlevel" value="1"/> <!-- cms主及所有备的hostname --> <PARAM name="cmServerRelation" value="openeuler161,openeuler162"/> <!--dn--><PARAM name="dataNum" value="1"/><PARAM name="dataPortBase" value="26000"/><PARAM name="dataNode1" value="/data/data,openeuler162,/data/data"/><PARAM name="dataNode1_syncNum" value="0"/></DEVICE><!-- node2上的节点部署信息,其中“name”的值配置为主机名称 --><DEVICE sn="openeuler162"><PARAM name="name" value="openeuler162"/><PARAM name="azName" value="AZ1"/><PARAM name="azPriority" value="1"/><!-- 如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP --><PARAM name="backIp1" value="192.168.99.162"/><PARAM name="sshIp1" value="192.168.99.162"/><!-- cm --> <PARAM name="cmDir" value="/data/cm"/> <PARAM name="cmServerPortStandby" value="15300"/> </DEVICE></DEVICELIST>
</ROOT>
配置文件说明解释参考:cluster xml 参数解释说明
执行gs_preinstall
cd /opt/software/openGauss/script[root@openeuler161 script]# ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_cm.xml
Parsing the configuration file.
Successfully parsed the configuration file.
Installing the tools on the local node.
Successfully installed the tools on the local node.
Are you sure you want to create trust for root (yes/no)?no
Setting host ip env
Successfully set host ip env.
Distributing package.
Begin to distribute package to tool path.
Successfully distribute package to tool path.
Begin to distribute package to package path.
Successfully distribute package to package path.
Successfully distributed package.
Are you sure you want to create the user[omm] and create trust for it (yes/no)? yes
Please enter password for cluster user.
Password:
Please enter password for cluster user again.
Password:
Sorry. passwords do not match.
Please enter password for cluster user.
Password:
Please enter password for cluster user again.
Password:
Generate cluster user password files successfully.Successfully created [omm] user on all nodes.
Preparing SSH service.
Successfully prepared SSH service.
Installing the tools in the cluster.
Successfully installed the tools in the cluster.
Checking hostname mapping.
Successfully checked hostname mapping.
Creating SSH trust for [omm] user.
Please enter password for current user[omm].
Password:
Checking network information.
All nodes in the network are Normal.
Successfully checked network information.
Creating SSH trust.
Creating the local key file.
Successfully created the local key files.
Appending local ID to authorized_keys.
Successfully appended local ID to authorized_keys.
Updating the known_hosts file.
Successfully updated the known_hosts file.
Appending authorized_key on the remote node.
Successfully appended authorized_key on all remote node.
Checking common authentication file content.
Successfully checked common authentication content.
Distributing SSH trust file to all node.
Distributing trust keys file to all node successfully.
Successfully distributed SSH trust file to all node.
Verifying SSH trust on all hosts.
Successfully verified SSH trust on all hosts.
Successfully created SSH trust.
Successfully created SSH trust for [omm] user.
Checking OS software.
Successfully check os software.
Checking OS version.
Successfully checked OS version.
Creating cluster's path.
Successfully created cluster's path.
Set and check OS parameter.
Setting OS parameters.
Successfully set OS parameters.
Warning: Installation environment contains some warning messages.
Please get more details by "/opt/software/openGauss/script/gs_checkos -i A -h openeuler161,openeuler162 --detail".
Set and check OS parameter completed.
Preparing CRON service.
Successfully prepared CRON service.
Setting user environmental variables.
Successfully set user environmental variables.
Setting the dynamic link library.
Successfully set the dynamic link library.
Setting Core file
Successfully set core path.
Setting pssh path
Successfully set pssh path.
Setting Cgroup.
Successfully set Cgroup.
Set ARM Optimization.
No need to set ARM Optimization.
Fixing server package owner.
Setting finish flag.
Successfully set finish flag.
Preinstallation succeeded.
[root@openeuler161 script]#
系统详细检查
[root@openeuler161 script]# /opt/software/openGauss/script/gs_checkos -i A -h openeuler161,openeuler162 --detail
Checking items:A1. [ OS version status ] : Normal [openeuler161]openEuler_22.03_64bit[openeuler162]openEuler_22.03_64bitA2. [ Kernel version status ] : Normal The names about all kernel versions are same. The value is "5.10.0-60.18.0.50.oe2203.x86_64".A3. [ Unicode status ] : Normal The values of all unicode are same. The value is "LANG=en_US.UTF-8".A4. [ Time zone status ] : Normal The informations about all timezones are same. The value is "+0800".A5. [ Swap memory status ] : Warning [openeuler162]
SwapMemory 4152356864 TotalMemory 3478061056[openeuler161]
SwapMemory 4152356864 TotalMemory 3478061056A6. [ System control parameters status ] : Warning [openeuler161]Warning reason: variable 'net.ipv4.tcp_retries1' RealValue '3' ExpectedValue '5'.Warning reason: variable 'net.ipv4.tcp_syn_retries' RealValue '6' ExpectedValue '5'.Check_SysCtl_Parameter warning.[openeuler162]Warning reason: variable 'net.ipv4.tcp_retries1' RealValue '3' ExpectedValue '5'.Warning reason: variable 'net.ipv4.tcp_syn_retries' RealValue '6' ExpectedValue '5'.Check_SysCtl_Parameter warning.A7. [ File system configuration status ] : Normal Both soft nofile and hard nofile are correct. A8. [ Disk configuration status ] : Normal The value about XFS mount parameters is correct. A9. [ Pre-read block size status ] : Normal The value about Logical block size is correct. A10.[ IO scheduler status ] : Normal The value of IO scheduler is correct. A11.[ Network card configuration status ] : Warning [openeuler162]
BondMode NullWarning reason: network 'enp0s8' 'mtu' RealValue '1500' ExpectedValue '8192'[openeuler161]
BondMode NullWarning reason: network 'enp0s8' 'mtu' RealValue '1500' ExpectedValue '8192'A12.[ Time consistency status ] : Warning [openeuler162]The NTPD not detected on machine and local time is "2024-05-12 13:20:48".[openeuler161]The NTPD not detected on machine and local time is "2024-05-12 13:20:49".A13.[ Firewall service status ] : Normal The firewall service is stopped. A14.[ THP service status ] : Normal The THP service is stopped.
Total numbers:14. Abnormal numbers:0. Warning numbers:4.
参数都正常
执行安装
安装需要用omm用户
chmod 775 -R /opt/software/openGauss
su - omm
cd /opt/software/openGauss/scripts
[omm@openeuler161 script]$ ./gs_install -X /opt/software/openGauss/cluster_cm.xml
Parsing the configuration file.
Check preinstall on every node.
Successfully checked preinstall on every node.
Creating the backup directory.
Successfully created the backup directory.
begin deploy..
Installing the cluster.
begin prepare Install Cluster..
Checking the installation environment on all nodes.
begin install Cluster..
Installing applications on all nodes.
Successfully installed APP.
begin init Instance..
encrypt cipher and rand files for database.
Please enter password for database:
Please repeat for database:
[GAUSS-50306] : The password of database is incorrect.The two passwords are different, please enter password again.
Please enter password for database:
Please repeat for database:
begin to create CA cert files
The sslcert will be generated in /data/app/share/sslcert/om
Create CA files for cm beginning.
Create CA files on directory [/data/app_33b035fd/share/sslcert/cm]. file list: ['client.key.cipher', 'client.key.rand', 'server.key.cipher', 'client.key', 'client.crt', 'server.key.rand', 'cacert.pem', 'server.key', 'server.crt']
Non-dss_ssl_enable, no need to create CA for DSS
Cluster installation is completed.
Configuring.
Deleting instances from all nodes.
Successfully deleted instances from all nodes.
Checking node configuration on all nodes.
Initializing instances on all nodes.
Updating instance configuration on all nodes.
Check consistence of memCheck and coresCheck on database nodes.
Successful check consistence of memCheck and coresCheck on all nodes.
Configuring pg_hba on all nodes.
Configuration is completed.
Starting cluster.
======================================================================
Successfully started primary instance. Wait for standby instance.
======================================================================
.
Successfully started cluster.
======================================================================
cluster_state : Normal
redistributing : No
node_count : 2
Datanode Stateprimary : 1standby : 1secondary : 0cascade_standby : 0building : 0abnormal : 0down : 0Successfully installed application.
end deploy..
数据库安装检验
[omm@openeuler161 script]$ gs_om -t status
-----------------------------------------------------------------------cluster_state : Normal
redistributing : No
balanced : Yes-----------------------------------------------------------------------[omm@openeuler161 script]$ gs_om -t query
[ Cluster State ]cluster_state : Normal
redistributing : No
current_az : AZ_ALL[ Datanode State ]node node_ip port instance state
----------------------------------------------------------------------------
1 openeuler161 192.168.99.161 26000 6001 P Primary Normal
2 openeuler162 192.168.99.162 26000 6002 S Standby Normal
[omm@openeuler161 script]$ gs_om -t views
[GAUSS-50004] : The parameter '-t' value is incorrect.
[omm@openeuler161 script]$ gs_om -t view
NodeHeader:
version:301
time:1715491567
nodeCount:2
node:1
============================================================
azName:AZ1
azPriority:1
node :1
nodeName:openeuler161
ssh channel :
sshChannel 1:192.168.99.161
datanodeCount :1
datanodeInstanceType :primary
datanode 1:
datanodeLocalDataPath :/data/data
datanodeXlogPath :
datanodeListenIP 1:192.168.99.161
datanodePort :26000
datanodeLocalHAIP 1:192.168.99.161
datanodeLocalHAPort :26001
dn_replication_num: 2
datanodePeer0DataPath :/data/data
datanodePeer0HAIP 1:192.168.99.162
datanodePeer0HAPort :26001
============================================================
azName:AZ1
azPriority:1
node :2
nodeName:openeuler162
ssh channel :
sshChannel 1:192.168.99.162
datanodeCount :1
datanodeInstanceType :standby
datanode 1:
datanodeLocalDataPath :/data/data
datanodeXlogPath :
datanodeListenIP 1:192.168.99.162
datanodePort :26000
datanodeLocalHAIP 1:192.168.99.162
datanodeLocalHAPort :26001
dn_replication_num: 2
datanodePeer0DataPath :/data/data
datanodePeer0HAIP 1:192.168.99.161
datanodePeer0HAPort :26001
============================================================
[omm@openeuler161 script]$ netstat -nlpt
(Not all processes could be identified, non-owned process infowill not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN -
tcp 0 0 192.168.99.161:26000 0.0.0.0:* LISTEN 66901/gaussdb
tcp 0 0 127.0.0.1:26000 0.0.0.0:* LISTEN 66901/gaussdb
tcp 0 0 192.168.99.161:26001 0.0.0.0:* LISTEN 66901/gaussdb
tcp 0 0 127.0.0.1:26001 0.0.0.0:* LISTEN 66901/gaussdb
tcp 0 0 192.168.99.161:26005 0.0.0.0:* LISTEN 66901/gaussdb
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 192.168.99.161:15300 0.0.0.0:* LISTEN 66889/cm_server
tcp 0 0 192.168.99.161:15301 0.0.0.0:* LISTEN 66889/cm_server
tcp 0 0 192.168.99.161:15302 0.0.0.0:* LISTEN 66870/cm_agent
tcp6 0 0 :::111 :::* LISTEN -
tcp6 0 0 ::1:26000 :::* LISTEN 66901/gaussdb
tcp6 0 0 ::1:26001 :::* LISTEN 66901/gaussdb
tcp6 0 0 :::22 :::* LISTEN -
[omm@openeuler161 script]$