从openGauss开源社区下载对应平台的安装包。
a. 通过https://opengauss.org/zh/download.html登录openGauss开源社区,选择3.1.0版本对应平台极简版安装包。
b. 单击“下载”。
检查安装包。
解压安装包,检查安装目录及文件是否齐全。在安装包所在目录执行以下命令:
tar -jxf openGauss-x.x.x-openEuler-64bit.tar.bz2
ls -lb
执行ls命令,显示类似如下信息:
total 90296
drwx------ 3 root root 4096 Mar 31 21:18 bin
drwx------ 3 root root 4096 Mar 31 21:18 etc
drwx------ 3 root root 4096 Mar 31 21:18 include
drwx------ 4 root root 4096 Mar 31 21:18 jre
drwx------ 5 root root 4096 Mar 31 21:18 lib
-rw------- 1 root root 92427499 Apr 1 09:43 openGauss-x.x.x-openEuler-64bit.tar.bz2
drwx------ 5 root root 4096 Mar 31 21:18 share
drwx------ 2 root root 4096 Mar 31 21:18 simpleInstall
-rw------- 1 root root 32 Mar 31 21:18 version.cfg
安装前需要进行的环境准备。
硬件环境要求
表 1 硬件环境要求
软件环境要求
表 2 软件环境要求
软件依赖要求
openGauss的软件依赖要求所示。
建议使用上述操作系统安装光盘或者源中,下列依赖软件的默认安装包,若不存在下列软件,可参看软件对应的建议版本。
表 3 软件依赖要求
修改操作系统配置
注意:
以下动作需要以root用户进行操作操作完成后请及时注销root用户,避免误操作。
关闭操作系统防火墙
为了在防火墙开启的状态下,确保openGauss的正常使用,用户需要将同openGauss相关的服务、协议、IP以及端口添加到openGauss主机的防火墙白名单中。
以openEuler操作系统为例,假设openGauss信息如所示。
表 4 openGauss信息
目前仅支持在防火墙关闭的状态下进行安装。
修改/etc/selinux/config文件中的“SELINUX”值为“disabled”。
a. 使用VIM打开config文件。
vim /etc/selinux/configb. 修改“SELINUX”的值“disabled”,执行:wq保存并退出修改。
SELINUX=disabled重新启动操作系统。
复制代码
reboot检查防火墙是否关闭。
systemctl status firewalld若防火墙状态显示为active (running),则表示防火墙未关闭,请执行4;
若防火墙状态显示为inactive (dead),则无需再关闭防火墙。
systemctl disable firewalld.service
systemctl stop firewalld.service
在其他主机上重复步骤1到步骤4。
设置字符集参数
将各数据库节点的字符集设置为相同的字符集,可以在/etc/profile文件中添加“export LANG=XXX”(XXX为Unicode编码)。
vim /etc/profile
设置时区和时间
在各数据库节点上,确保时区和时间一致。
执行如下命令检查各数据库节点时间和时区是否一致。如果各数据库节点时间和时区不一致区,请执行步骤2~步骤3。
date使用如下命令将各数据库节点/usr/share/zoneinfo/目录下的时区文件拷贝为/etc/localtime文件。
cp /usr/share/zoneinfo/$地区/$时区 /etc/localtime$地区/$时区为需要设置时区的信息,例如:Asia_Shanghai。使用date -s命令将各数据库节点的时间设置为统一时间,举例如下。
date -s "Sat Sep 27 16:00:07 CST 2020"
(可选)关闭swap交换内存:
关闭swap交换内存是为了保障数据库的访问性能,避免把数据库的缓冲区内存淘汰到磁盘上。 如果服务器内存比较小,内存过载时,可打开swap交换内存保障正常运行。
在各数据库节点上,使用swapoff -a命令将交换内存关闭。
swapoff -a
关闭RemoveIPC
在各数据库节点上,关闭RemoveIPC。CentOS操作系统默认为关闭,可以跳过该步骤。
修改/etc/systemd/logind.conf文件中的“RemoveIPC”值为“no”。
a. 使用VIM打开logind.conf文件。
vim /etc/systemd/logind.confb. 修改“RemoveIPC”值为“no”。
RemoveIPC=no修改/usr/lib/systemd/system/systemd-logind.service文件中的“RemoveIPC”值为“no”。
a. 使用VIM打开systemd-logind.service文件。
vim /usr/lib/systemd/system/systemd-logind.serviceb. 修改“RemoveIPC”值为“no”。
RemoveIPC=no重新加载配置参数。
systemctl daemon-reload
systemctl restart systemd-logind
检查修改是否生效。
loginctl show-session | grep RemoveIPC
systemctl show systemd-logind | grep RemoveIPC
在其他主机上重复
关闭HISTORY记录
为避免指令历史记录安全隐患,需关闭各主机的history指令。
步骤 1 修改根目录下/etc/profile文件。
vim /etc/profile
步骤 2 设置HISTSIZE值为0。例如,系统中HISTSIZE默认值为1000,将其修改为0。
HISTSIZE=0
步骤 3 保存/etc/profile。
:wq
步骤 4 设置/etc/profile生效。
source /etc/profile




