锦通 发表于 2022-11-18 18:31:29

Centos 7 部署 openGauss 3.1.0 级联备库集群及集群缩容删除节点-运维指南

一、安装环境设置

1.1 硬件环境

名称最低配置建议配置测试配置服务器数量3略略硬盘* 至少1GB用于安装openGauss的应用程序。
* 每个主机需大约300MB用于元数据存储。
* 预留70%以上的磁盘剩余空间用于数据存储。略略内存>=2G略略CPU功能调试最小1×8核,2.0GHz略略网络300兆以上以太网,生产建议采用bond略略1.2 软件环境

软件类型信息描述操作系统Centos 7.6Linux文件系统剩余inode个数 > 15亿(推荐)工具bzip2Python*oepnEuler:支持Python 3.7.x
*Centos 7.6: 支持Python 3.6.x数据库版本opengauss 3.1.0 企业版数据库软件包名称openGauss-3.1.0-CentOS-64bit-all.tar.gz1.2.1 安装python

-- root用户【所有节点】
# 本次选择安装python 3.6.5版本
mkdir /usr/local/python3
cd /usr/local/python3
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
tar -zxf Python-3.6.5.tgz
cd /usr/local/python3/Python-3.6.5
./configure --prefix=/usr/local/python3 --enable-shared CFLAGS=-fPIC
make && make install
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

-- 设置环境变量
cat >>/etc/profile<<EOF
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/python3/bin
EOF
source /etc/profile
echo "/usr/local/python3/lib/" >> /etc/ld.so.conf
ldconfig

-- 如遇如下报错
python3: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory
可执行 cp /usr/local/python3/Python-3.6.5/libpython3.6m.so.1.0 /usr/lib64/1.2.2 安装软件依赖包

1.2.2.1 软件依赖要求

所需软件建议版本libaio-devel建议版本:0.3.109-13flex要求版本:2.5.31 以上bison建议版本:2.7-4ncurses-devel建议版本:5.9-13.20130511glibc-devel建议版本:2.17-111patch建议版本:2.7.1-10redhat-lsb-core建议版本:4.1readline-devel建议版本 :7.0-13libnsl(openeuler+x86环境中)建议版本 :2.28-361.2.2.2 安装软件依赖包

-- root用户 【所有节点】
-- 安装依赖包
yum install -y libaio-devel flex bison ncurses-devel glibc-devel patch redhat-lsb-core readline-devel zlib readline gcc perl-ExtUtils-Embed readline-devel zlib-devel expect

-- 检查是否已安装
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep -E "libaio-devel|flex|bison|ncurses-devel|glibc-devel|patch|redhat-lsb-core|readline-devel|zlib|readline|gcc|python|python-devel|perl-ExtUtils-Embed|readline-devel|zlib-devel|expect"1.2.3 操作系统配置

1.2.3.1 修改操作系统参数

-- root用户 【所有节点】
-- 添加如下参数:
cat>>/etc/sysctl.conf <<EOF
net.ipv4.tcp_fin_timeout=60
net.ipv4.tcp_retries1=5
net.ipv4.tcp_syn_retries=5
net.sctp.path_max_retrans=10
net.sctp.max_init_retransmits=10
EOF

-- 生效参数
sysctl -p

## 执行sysctl -p 时有如下报错,此处选择忽略
sysctl: cannot stat /proc/sys/net/sctp/path_max_retrans: No such file or directory
sysctl: cannot stat /proc/sys/net/sctp/max_init_retransmits: No such file or directory

# 预安装过程根据系统参数配置会有相应提示,请按照提示对应系统参数1.2.3.3 关闭透明大页

-- root用户 【所有节点】
echo "* soft stack 3072" >> /etc/security/limits.conf
echo "* hard stack 3072" >> /etc/security/limits.conf
echo "* soft nofile 1000000" >> /etc/security/limits.conf
echo "* hard nofile 1000000" >> /etc/security/limits.conf
echo "* soft nproc unlimited" >> /etc/security/limits.d/90-nproc.conf
tail -n 4 /etc/security/limits.conf
tail -n 1 /etc/security/limits.d/90-nproc.conf1.2.3.4 关闭防火墙

-- root用户 【所有节点】
-- openGauss默认关闭使用transparent_hugepage服务,并将关闭命令写入操作系统启动文件

cat >> /etc/rc.d/rc.local<<EOF
if test -f /sys/kernel/mm/transparent_hugepage/enabled;
        then
                echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag;
        then
                echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
EOF

-- 查看是否关闭:
cat /sys/kernel/mm/transparent_hugepage/enabled
cat /sys/kernel/mm/transparent_hugepage/defrag1.2.3.5 关闭selinux

-- root用户 【所有节点】
systemctl disable firewalld.service
systemctl stop firewalld.service1.2.3.6 修改字符集

-- root用户 【所有节点】
sed -i"s/SELINUX=enforcing/SELINUX=disabled/"/etc/selinux/config
-- 检查
cat /etc/selinux/config | grep disabled1.2.3.12 修改DNS配置

-- root用户 【所有节点】-- 节点一cat >>/etc/resolv.conf/etc/resolv.conf/etc/resolv.conf/etc/resolv.conf /etc/hosts
页: [1]
查看完整版本: Centos 7 部署 openGauss 3.1.0 级联备库集群及集群缩容删除节点-运维指南