安装环境
一、安装准备
流程 | |
---|---|
openGauss安装前需要准备相应的软硬件环境以及完成相关配置。 本文档提供了openGauss安装所需的最低要求,实际安装中,请用户根据实际情况进行规划。 更多信息,请参考安装准备。 | |
安装包需要在openGauss开源社区下载并且对安装包内容进行检查,详细请参见获取安装包。 | |
安装openGauss前需要创建XML文件。XML文件包含部署openGauss的服务器信息、安装路径、IP地址以及端口号等。用于告知openGauss如何部署。用户需根据不同场景配置对应的XML文件。 关于如何配置XML文件,详细请参见创建XML配置文件。 | |
上传安装包和XML文件 | 上传安装包和XML配置文件到待安装的服务器。 |
解压安装包 | 使用tar命令解压安装包。 |
安装环境的初始化包含上传安装包和XML文件、解压安装包、使用gs_preinstall准备好安装环境。 关于如何初始化安装环境,详细请参见初始化安装环境。 | |
关于如何执行安装,详细请参见执行安装。 | |
二、获取安装包
openGauss开源社区上提供了安装包的获取方式:
wget https://opengauss.obs.cn-south-1.myhuaweicloud.com/6.0.0/openEuler22.03/x86/openGauss-All-6.0.0-openEuler22.03-x86_64.tar.gz
解压安装包,检查安装目录及文件是否齐全。在安装包所在目录执行以下命令:
[root@node1 xiaoran]# tar zxvf openGauss-All-6.0.0-openEuler22.03-x86_64.tar.gz
[root@node1 xiaoran]# ll
total 297M
-rw-r--r-- 1 root root 148M Sep 29 14:19 openGauss-All-6.0.0-openEuler22.03-x86_64.tar.gz
-rw-r----- 1 root root 0 Sep 29 11:31 openGauss-CM-6.0.0-openEuler22.03-x86_64.sha256
-rw-r----- 1 root root 22M Sep 29 11:31 openGauss-CM-6.0.0-openEuler22.03-x86_64.tar.gz
-rw-r----- 1 root root 65 Sep 29 11:29 openGauss-OM-6.0.0-openEuler22.03-x86_64.sha256
-rw-r----- 1 root root 23M Sep 29 11:29 openGauss-OM-6.0.0-openEuler22.03-x86_64.tar.gz
-rw-r----- 1 root root 65 Sep 29 11:31 openGauss-Server-6.0.0-openEuler22.03-x86_64.sha256
-rw-r----- 1 root root 105M Sep 29 11:31 openGauss-Server-6.0.0-openEuler22.03-x86_64.tar.bz2
-rw------- 1 root root 65 Sep 29 11:28 upgrade_sql.sha256
-rw------- 1 root root 552K Sep 29 11:28 upgrade_sql.tar.gz
[root@node1 xiaoran]#
三、准备软硬件安装环境
硬件环境要求
软件环境要求
软件类型 | |
---|---|
psutil | netifaces | cffi | pycparser | cryptography | pynacl | bcrypt | paramiko |
软件依赖要求
libnsl(openEuler+x86环境中) | 建议版本:2.28-36 |
四、安装openGauss(所有节点)
1、安装所需软件
pip install psutil netifaces cffi pycparser cryptography pynacl bcrypt paramiko
yum install libaio-devel readline-devel libnsl bash-com* vim wget tar hostname expect
2、关闭防火墙
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
reboot
systemctl status firewalld
systemctl disable firewalld.service
systemctl stop firewalld.service
3、设置字数集
echo 'export LANG=en_US.UTF-8' >> /etc/profile
source /etc/profile
4、设置时间和时区
cp /etc/localtime /etc/localtime.backup
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
date
5、关闭交换分区
swapoff -a
6、设置网卡MTU值(注意先查后改)
符合要求可以不改
#使用ifconfig查询
ifconfig
#ARM推荐8192、x86推荐>=1500
ifconfig 《网卡名称》 mtu 《值》
7、关闭RmoveIPC
sed -i 's/#RemoveIPC=no/RemoveIPC=no/g' /etc/systemd/logind.conf
echo 'RemoveIPC=no' >> /usr/lib/systemd/system/systemd-logind.service
systemctl daemon-reload
systemctl restart systemd-logind
loginctl show-session | grep RemoveIPC
systemctl show systemd-logind | grep RemoveIPC
8、关闭history记录(可选)
#避免代码泄露
sed -i 's/HISTSIZE=1000/HISTSIZE=0/g' /etc/profile
source /etc/profile
9、设置root用户远程登录
vim /etc/ssh/sshd_config
PermitRootLogin yes
#需要把Banner注释掉
vim /etc/ssh/sshd_config
#Banner XXXX
systemctl restart sshd.service
ssh xxx.xxx.xxx.xxx
五、创建XML配置文件
1、一主二备配置文件(主节点)
<ROOT>
<CLUSTER>
<PARAM name="clusterName" value="Cluster_template" />
<PARAM name="nodeNames" value="node1,node2,node3" />
<PARAM name="gaussdbAppPath" value="/opt/openGauss/install/app" />
<PARAM name="gaussdbLogPath" value="/opt/openGauss/install/log" />
<PARAM name="tmpMppdbPath" value="/opt/openGauss/install/tmp" />
<PARAM name="gaussdbToolPath" value="/opt/openGauss/install/tool" />
<PARAM name="corePath" value="/opt/openGauss/install/corefile" />
<PARAM name="backIp1s" value="10.0.31.10,10.0.31.20,10.0.31.30" />
</CLUSTER>
<DEVICELIST>
<DEVICE sn="node1_hostname">
<PARAM name="name" value="node1" />
<PARAM name="azName" value="AZ1" />
<PARAM name="azPriority" value="1" />
<PARAM name="backIp1" value="10.0.31.10" />
<PARAM name="sshIp1" value="10.0.31.10" />
<PARAM name="cmsNum" value="1" />
<PARAM name="cmServerPortBase" value="15400" />
<PARAM name="cmServerListenIp1" value="10.0.31.10,10.0.31.20,10.0.31.30" />
<PARAM name="cmServerHaIp1" value="10.0.31.10,10.0.31.20,10.0.31.30" />
<PARAM name="cmServerlevel" value="1" />
<PARAM name="cmServerRelation" value="node1,node2,node3" />
<PARAM name="cmDir" value="/opt/openGauss/install/data/cmserver" />
<PARAM name="dataNum" value="1" />
<PARAM name="dataPortBase" value="15000" />
<PARAM name="dataNode1" value="/opt/openGauss/install/data/dn1,node2,/opt/openGauss/install/data/dn1,node3,/opt/openGauss/install/data/dn1" />
<PARAM name="dataNode1_syncNum" value="0" />
</DEVICE>
<DEVICE sn="node2_hostname">
<PARAM name="name" value="node2" />
<PARAM name="azName" value="AZ1" />
<PARAM name="azPriority" value="1" />
<PARAM name="backIp1" value="10.0.31.20" />
<PARAM name="sshIp1" value="10.0.31.20" />
<PARAM name="cmServerPortStandby" value="15400" />
<PARAM name="cmDir" value="/opt/openGauss/install/data/cmserver" />
</DEVICE>
<DEVICE sn="node3_hostname">
<PARAM name="name" value="node3" />
<PARAM name="azName" value="AZ1" />
<PARAM name="azPriority" value="1" />
<PARAM name="backIp1" value="10.0.31.30" />
<PARAM name="sshIp1" value="10.0.31.30" />
<PARAM name="cmServerPortStandby" value="15400" />
<PARAM name="cmDir" value="/opt/openGauss/install/data/cmserver" />
</DEVICE>
</DEVICELIST>
2、初始化环境(主节点)
mkdir -p /opt/software/openGauss
wget https://opengauss.obs.cn-south-1.myhuaweicloud.com/6.0.0/openEuler22.03/x86/openGauss-All-6.0.0-openEuler22.03-x86_64.tar.gz
tar -zxvf openGauss-6.0.0-RC1-openEuler-64bit-all.tar.gz -C /opt/software/openGauss
cd /opt/software/openGauss/
tar -zxvf openGauss-6.0.0-RC1-openEuler-64bit-om.tar.gz
chmod 755 -R /opt/software
cd /opt/software/openGauss/script
cp /opt/software/openGauss/script/gspylib/pssh/bin/pssh /usr/local/bin/
cp /opt/software/openGauss/script/gspylib/pssh/bin/pscp /usr/local/bin/
cp /opt/software/openGauss/script/gspylib/pssh/bin/TaskPool.py /usr/local/bin/
chmod +x /usr/local/bin/pssh
chmod +x /usr/local/bin/pscp
chmod +x /usr/local/bin/TaskPool.py
./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml [--sep-env-file=ENVFILE]
3、安装openGauss
su - omm
source ENVFILE
gs_install -X /opt/software/openGauss/cluster_config.xml
#执行完需要输入密码
#设置的密码要符合复杂度要求:
#最少包含8个字符,最多包含16个字符。
#不能和用户名、当前密码(ALTER)、或当前密码反序相同。
#至少包含大写字母(A-Z)、小写字母(a-z)、数字、非字母数字字符(限定为~!@#$%^&*()-_=+\|[{}];:,<.>/?)四类字符中的三类字符。
#openEuler12#$
4、安装验证
[root@node1 profile.d]# su - omm
Last login: Sat Sep 28 13:39:02 CST 2024 on pts/0
Welcome to 5.10.0-60.18.0.50.oe2203.x86_64
System information as of time: Sat Sep 28 02:25:20 PM CST 2024
System load: 0.07
Processes: 132
Memory used: .9%
Swap used: 0.0%
Usage On: 17%
IP address: 10.0.31.180
IP address: 172.129.78.139
Users online: 2
To run a command as administrator(user "root"),use "sudo <command>".
[omm@node1 ~]$ gs_om -t start
Starting cluster.
======================================================================
^[[ASuccessfully started primary instance. Wait for standby instance.
======================================================================
.
Successfully started cluster.
======================================================================
cluster_state : Normal
redistributing : No
node_count : 3
Datanode State
primary : 1
standby : 2
secondary : 0
cascade_standby : 0
building : 0
abnormal : 0
down : 0
Successfully started cluster.
[omm@node1 ~]$ gs_om -t status
-----------------------------------------------------------------------
cluster_state : Normal
redistributing : No
balanced : Yes
-----------------------------------------------------------------------
标签:x86,tar,部署,root,安装包,6.0,openGauss,安装
From: https://blog.csdn.net/m0_69378895/article/details/142780750