openGauss安装手册
1.使用Python 3
rm -f /usr/bin/python
ln -s /usr/bin/python3.7 /usr/bin/python
验证:python -V 可以查看python版本
2、安装openGauss的依赖组件
yum install -y bzip2 libaio-devel flex bison ncurses-devel glibc-devel patch readline-devel
3、修改操作系统配置
a) 关闭防火墙和SeLinux
systemctl disable firewalld.service
systemctl stop firewalld.service
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
setenforce 0
b) 设置字符集参数
if [ "$LANG" != "en_US.UTF-8" ];then
export.UTF-8
echo export.UTF-8 >> /etc/profile
fi
c) 检查设置时区
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
d) 关闭swap交换区
swapoff -a
e) 检查设置网卡MTU值:可以通过ifconfig查看网卡名称,如果名称不是eth0请根据实际情况进行修改
ifconfig eth0 mtu 8192
f) 设置root用户远程登录配置
sed -i 's/^Banner .*/Banner none/' /etc/selinux/config
sed -i 's/^#PermitRootLogin .*/PermitRootLogin yes/' /etc/selinux/config
sed -i 's/^PermitRootLogin no/PermitRootLogin yes/' /etc/selinux/config
systemctl restart sshd
g) 准备环境
chmod 777 -R /data
#在执行安装openGauss的时候会创建omm账户,该账户需要相应的操作权限
安装openGauss
准备openGauss的安装配置文件(cluster_config.xml,改文件位于/data/software目录中)
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CLUSTER>
<PARAM name="clusterName" value="myopgauss" />
<PARAM name="nodeNames" value="主机名" />
<PARAM name="backIp1s" value="主机IP地址" />
<PARAM name="gaussdbAppPath" value="/data/huawei/install/app" />
<PARAM name="gaussdbLogPath" value="/data/huawei/omm" />
<PARAM name="tmpMppdbPath" value="/data/huawei/tmp" />
<PARAM name="gaussdbToolPath" value="/data/huawei/install/om" />
<PARAM name="corePath" value="/data/huawei/corefile" />
<PARAM name="clusterType" value="single-inst" />
</CLUSTER>
<DEVICELIST>
<DEVICE sn="2000001">
<PARAM name="name" value="主机名"/>
<PARAM name="azName" value="AZ1"/>
<PARAM name="azPriority" value="1"/>
<PARAM name="backIp1" value="主机IP地址"/>
<PARAM name="sshIp1" value="主机IP地址"/>
<PARAM name="dataNum" value="1"/>
<PARAM name="dataPortBase" value="26000"/>
<PARAM name="dataNode1" value="/data/huawei/install/data/db1"/>
</DEVICE>
</DEVICELIST>
</ROOT>
初始化安装环境
sed -i 's/^sysctl -w vm.min_free_kbytes=112640/#&/' /etc/profile.d/performance.sh
配置库文件的路径
export LD_LIBRARY_PATH=/data/software/script/gspylib/clib:$LD_LIBRARY_PATH
执行预安装脚本
cd /data/software/script
./gs_preinstall -U omm -G dbgrp -X /data/software/cluster_config.xml
执行安装脚本
#当前目录在/data/software/script中
su - omm
./gs_install -X /data/software/clusterconfig.xml