本脚本用于单机数据库安装。
脚本内容如下:
#!/bin/bash
############################################################
## 环境配置:一下为实验CPU及内存配置,如生产安装可根据实际情况修改配置
## OS: openEuler22.03LTSsp3 x86_64[最小硬件配置:2c/4G]
## Database:openGauss 5.0.0
## Description:一键式实现操作系统环境配置、openGauss软件下载、openGauss软件安装等步骤,帮助大家提升安装openGauss数据库效率
## Tips: 本脚本可离线或在线安装,可根据实际情况修改相应配置
############################################################
## 说明:ARM架构的操作系统需要修改脚本的URL地址和YUM源地址。
## 第1步操作修改内容:
## export openGauss_Download_url=https://opengauss.obs.cn-south-1.myhuaweicloud.com/2.0.0/arm/openGauss-2.0.0-openEuler-64bit-all.tar.gz
##离线安装需将安装包放至/soft/openGauss
## 第8步操作修改内容:
##离线安装需要手动配置yum源
## wget -O /etc/yum.repos.d/openEulerOS.repo https://repo.huaweicloud.com/repository/conf/openeuler_aarch64.repo
####################
#注意:使用此脚本安装时需要联网,如不能联网则无法下载opengauss安装包和配置openEuler的yum原,需要修改第1步和第8步
############################################################
## 0.关闭virbr0网卡 [本地虚拟机软件标准化安装openEuler系统会默认存在virbr0网卡,删除该网卡以避免干扰数据库的安装]
## virsh net-destroy default
## virsh net-list
## echo "Net device virbr0 is disabled."
## 1.定义主机信息[请根据实际情况修改]
export MY_HOSTNAME=gaussdb ## 主机名
export MY_HOSTIP=192.168.1.199 ## IP地址
export MY_SOFTWARE_DIRECTORY=/soft/openGauss ## 软件包所在目录
export MY_XML=/soft/openGauss/clusterconfig.xml ## 集群配置文件XML
##export openGauss_Download_url=https://opengauss.obs.cn-south-1.myhuaweicloud.com/3.0.0/x86_openEuler/openGauss-3.0.0-openEuler-64bit-all.tar.gz
## 1. 设置主机名并配置hosts文件
hostnamectl set-hostname $MY_HOSTNAME
sed -i '/$MY_HOSTIP/d' /etc/hosts
echo "$MY_HOSTIP $MY_HOSTNAME #Gauss OM IP Hosts Mapping" >> /etc/hosts
cat /etc/hosts
echo "1.Configure /etc/hosts completed."
echo -e "\n"
## 2. 关闭防火墙
systemctl disable firewalld.service
systemctl stop firewalld.service
echo "Firewalld " `systemctl status firewalld|grep Active`
echo "2.Disable firewalld service completed."
echo -e "\n"
## 3. 关闭SELinux
sed -i '/^SELINUX=/d' /etc/selinux/config
echo "SELINUX=disabled" >> /etc/selinux/config
cat /etc/selinux/config|grep "SELINUX=disabled"
echo "3.Disable SELINUX completed."
echo -e "\n"
## 4. 设置操作系统字符集编码
echo "LANG=en_US.UTF-8" >> /etc/profile
source /etc/profile
echo $LANG
echo "4.Configure encoding completed."
echo -e "\n"
## 5. 设置操作系统时区
rm -fr /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
date -R
hwclock
echo "5.Configure Timezone completed."
echo -e "\n"
## 6. 关闭SWAP分区 [对于2G内存的设备,建议待安装完毕后再打开SWAP以间接 “扩容内存容量”]
sed -i '/swap/s/^/#/' /etc/fstab
swapoff -a
free -m
echo "6.Close swap partition completed."
echo -e "\n"
## 7. 配置SSH服务,关闭Banner,允许root远程登录
sed -i '/Banner/s/^/#/' /etc/ssh/sshd_config
sed -i '/PermitRootLogin/s/^/#/' /etc/ssh/sshd_config
echo -e "\n" >> /etc/ssh/sshd_config
echo "Banner none " >> /etc/ssh/sshd_config
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
cat /etc/ssh/sshd_config |grep -v ^#|grep -E 'PermitRoot|Banner'
echo "7.Configure SSH Service completed."
echo -e "\n"
## 8. 配置YUM源、安装依赖包、修改默认Python3版本
#mkdir /etc/yum.repos.d/bak
#mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak/
#wget -O /etc/yum.repos.d/openEulerOS.repo https://repo.huaweicloud.com/repository/conf/openeuler_x86_64.repo
yum clean all
yum install -y bzip2 python3
yum install -y libaio-devel libnsl flex bison ncurses-devel glibc-devel patch readline-devel net-tools tar
mv /usr/bin/python /usr/bin/python2_bak
ln -s /usr/bin/python3 /usr/bin/python
python -V
echo "8.Configure Install Packages and change default Python version completed."
echo -e "\n"
## 9. 配置 sysctl.conf 和 performance.sh
cat >> /etc/sysctl.conf << EOF
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
sed -i '/vm.min_free_kbytes/s/^/#/' /etc/profile.d/performance.sh ## Only for openEuler
cat /etc/profile.d/performance.sh|grep vm.min_free_kbytes
echo "9.Configure sysctl.conf and performance.sh completed."
echo -e "\n"
## 10. 配置资源限制
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.conf
echo "10.Configure resource limits completed."
echo -e "\n"
## 11. 关闭透明大页[Only for CentOS]
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
chmod +x /etc/rc.d/rc.local
/usr/bin/sh /etc/rc.d/rc.local
cat /sys/kernel/mm/transparent_hugepage/enabled
cat /sys/kernel/mm/transparent_hugepage/defrag
echo "11.Close transparent_hugepage completed."
echo -e "\n"
## 12. 禁用RemoveIPC[Only for openEuler]
sed -i '/^RemoveIPC/d' /etc/systemd/logind.conf
sed -i '/^RemoveIPC/d' /usr/lib/systemd/system/systemd-logind.service
echo "RemoveIPC=no" >> /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
echo "12.Disable RemoveIPC completed."
echo -e "\n"
## 13. 下载openGauss软件包
#mkdir -p $MY_SOFTWARE_DIRECTORY
#cd $MY_SOFTWARE_DIRECTORY
#wget $openGauss_Download_url
#echo "13.openGauss software download completed."
#echo -e "\n"
## 14. 配置XML文件
rm -fr $MY_XML
cat >> $MY_XML <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<!-- openGauss整体信息 -->
<CLUSTER>
<PARAM name="clusterName" value="dbCluster" />
<PARAM name="nodeNames" value="$MY_HOSTNAME" />
<PARAM name="backIp1s" value="$MY_HOSTIP"/>
<PARAM name="gaussdbAppPath" value="/gaussdb/app" />
<PARAM name="gaussdbLogPath" value="/gaussdb/log" />
<PARAM name="gaussdbToolPath" value="/gaussdb/om" />
<PARAM name="corePath" value="/gaussdb/corefile"/>
<PARAM name="clusterType" value="single-inst"/>
</CLUSTER>
<!-- 每台服务器上的节点部署信息 -->
<DEVICELIST>
<!-- node1上的节点部署信息 -->
<DEVICE sn="1000001">
<PARAM name="name" value="$MY_HOSTNAME"/>
<PARAM name="azName" value="AZ1"/>
<PARAM name="azPriority" value="1"/>
<!-- 如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP -->
<PARAM name="backIp1" value="$MY_HOSTIP"/>
<PARAM name="sshIp1" value="$MY_HOSTIP"/>
<!--dbnode-->
<PARAM name="dataNum" value="1"/>
<PARAM name="dataPortBase" value="26000"/>
<PARAM name="dataNode1" value="/gaussdb/data/db1"/>
</DEVICE>
</DEVICELIST>
</ROOT>
EOF
cat $MY_XML
echo "14.Configure XML file completed."
echo -e "\n"
## 15. 解压安装包并修改目录权限
echo "Begin to Uncompress openGauss Package and Modify directory permissions:"
cd $MY_SOFTWARE_DIRECTORY
tar -zxvf *all.tar.gz
tar -zxvf *om.tar.gz
ls -l
chmod -R 777 $MY_SOFTWARE_DIRECTORY/../
echo "15.Uncompress openGauss Package completed."
echo -e "\n"
## 16. 执行 gs_preinstall
echo "Begin to execute openGauss preinstall:"
python $MY_SOFTWARE_DIRECTORY/script/gs_preinstall -U omm -G dbgrp -X $MY_XML
echo "16.openGauss preinstall completed."
echo -e "\n"
## 17. 检查预安装环境
echo "Begin to Check OS environment:"
$MY_SOFTWARE_DIRECTORY/script/gs_checkos -i A -h $MY_HOSTNAME --detail
## 18. 执行 gs_install
echo "Begin to execute openGauss install:"
touch /home/omm/install_db
cat >> /home/omm/install_db <<EOF
source ~/.bashrc
gs_install -X $MY_XML --gsinit-parameter="--encoding=UTF8" --dn-guc="max_process_memory=2GB" --dn-guc="shared_buffers=128MB" --dn-guc="cstore_buffers=16MB"
EOF
chown -R omm:dbgrp /home/omm/install_db
su - omm -c "sh /home/omm/install_db"
echo "17.openGauss install completed."
echo -e "\n"
## 安装完毕!
echo "openGauss Install completed.congratulations"
echo "Congratulations!!!"
安装注意事项:
- 安装前需配置好系统地址。并在脚本中对应处修改IP地址。
- 上传系统镜像到系统中,并配置好本地yum源。
- 离线安装需要提前创建好数据库安装包存放目录:/soft/openGauss/。
- 安装过程中需要输入一次yes、输入两次omm用户密码、输入两次数据库密码。
- 运行脚本前根据实际系统内存在脚本中修改max_process_memory(内存70%80%)、shared_buffers(内存25%30%)
安装过程输出代码:
[root@gaussdb scripts]# ls
install_gaussdb.sh
[root@gaussdb scripts]# chmod +x install_gaussdb.sh
[root@gaussdb scripts]# ./install_gaussdb.sh
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.199 gaussdb #Gauss OM IP Hosts Mapping
1.Configure /etc/hosts completed.
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Firewalld Active: inactive (dead)
2.Disable firewalld service completed.
SELINUX=disabled
3.Disable SELINUX completed.
en_US.UTF-8
4.Configure encoding completed.
Thu, 27 Jun 2024 15:07:12 +0800
2024-06-27 15:07:11.872744+08:00
5.Configure Timezone completed.
total used free shared buff/cache available
Mem: 3409 350 2955 8 322 3059
Swap: 0 0 0
6.Close swap partition completed.
Banner none
PermitRootLogin yes
7.Configure SSH Service completed.
0 files removed
Server 98 MB/s | 3.4 MB 00:00
Last metadata expiration check: 0:00:01 ago on Thu 27 Jun 2024 03:07:12 PM CST.
Package bzip2-1.0.8-6.oe2203sp3.x86_64 is already installed.
Package python3-3.9.9-28.oe2203sp3.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
Last metadata expiration check: 0:00:01 ago on Thu 27 Jun 2024 03:07:12 PM CST.
No match for argument: libnsl
Package flex-2.6.4-5.oe2203sp3.x86_64 is already installed.
Package bison-3.8.2-2.oe2203sp3.x86_64 is already installed.
Package glibc-devel-2.34-143.oe2203sp3.x86_64 is already installed.
Package patch-2.7.6-13.oe2203sp3.x86_64 is already installed.
Package net-tools-2.10-3.oe2203sp3.x86_64 is already installed.
Package tar-2:1.34-5.oe2203sp3.x86_64 is already installed.
Error: Unable to find a match: libnsl
mv: cannot stat '/usr/bin/python': No such file or directory
Python 3.9.9
8.Configure Install Packages and change default Python version completed.
kernel.sysrq = 0
net.ipv4.ip_forward = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.default.secure_redirects = 0
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.tcp_syncookies = 1
kernel.dmesg_restrict = 1
net.ipv6.conf.all.accept_redirects = 0
net.ipv6.conf.default.accept_redirects = 0
net.ipv4.tcp_retries1 = 5
net.ipv4.tcp_syn_retries = 5
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
sed: can't read /etc/profile.d/performance.sh: No such file or directory
cat: /etc/profile.d/performance.sh: No such file or directory
9.Configure sysctl.conf and performance.sh completed.
* soft stack 3072
* hard stack 3072
* soft nofile 1000000
* hard nofile 1000000
* soft nproc unlimited
10.Configure resource limits completed.
always madvise [never]
always defer defer+madvise madvise [never]
11.Close transparent_hugepage completed.
RemoveIPC=no
RemoveIPC=no
12.Disable RemoveIPC completed.
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<!-- openGauss Ϣ -->
<CLUSTER>
<PARAM name="clusterName" value="dbCluster" />
<PARAM name="nodeNames" value="gaussdb" />
<PARAM name="backIp1s" value="192.168.1.199"/>
<PARAM name="gaussdbAppPath" value="/gaussdb/app" />
<PARAM name="gaussdbLogPath" value="/gaussdb/log" />
<PARAM name="gaussdbToolPath" value="/gaussdb/om" />
<PARAM name="corePath" value="/gaussdb/corefile"/>
<PARAM name="clusterType" value="single-inst"/>
</CLUSTER>
<!-- ÿ̨ ϵĽڵ㲿 Ϣ -->
<DEVICELIST>
<!-- node1 ϵĽڵ㲿 Ϣ -->
<DEVICE sn="1000001">
<PARAM name="name" value="gaussdb"/>
<PARAM name="azName" value="AZ1"/>
<PARAM name="azPriority" value="1"/>
<!-- ֻ һ ã backIP1 sshIP1 ó ͬһ IP -->
<PARAM name="backIp1" value="192.168.1.199"/>
<PARAM name="sshIp1" value="192.168.1.199"/>
<!--dbnode-->
<PARAM name="dataNum" value="1"/>
<PARAM name="dataPortBase" value="26000"/>
<PARAM name="dataNode1" value="/gaussdb/data/db1"/>
</DEVICE>
</DEVICELIST>
</ROOT>
14.Configure XML file completed.
Begin to Uncompress openGauss Package and Modify directory permissions:
openGauss-5.0.2-openEuler-64bit-cm.tar.gz
openGauss-5.0.2-openEuler-64bit-om.tar.gz
openGauss-5.0.2-openEuler-64bit.tar.bz2
openGauss-5.0.2-openEuler-64bit-cm.sha256
openGauss-5.0.2-openEuler-64bit-om.sha256
openGauss-5.0.2-openEuler-64bit.sha256
upgrade_sql.tar.gz
upgrade_sql.sha256
./lib/
./lib/_cffi_backend.so
./lib/six.py
./lib/paramiko/
./lib/paramiko/proxy.py
./lib/paramiko/pipe.py
./lib/paramiko/kex_curve25519.py
./lib/paramiko/sftp_attr.py
./lib/paramiko/buffered_pipe.py
./lib/paramiko/kex_gex.py
./lib/paramiko/client.py
./lib/paramiko/auth_handler.py
./lib/paramiko/kex_group14.py
./lib/paramiko/ber.py
./lib/paramiko/kex_group1.py
./lib/paramiko/sftp_handle.py
./lib/paramiko/agent.py
./lib/paramiko/ssh_exception.py
./lib/paramiko/__init__.py
./lib/paramiko/primes.py
./lib/paramiko/ed25519key.py
./lib/paramiko/ssh_gss.py
./lib/paramiko/sftp_client.py
./lib/paramiko/channel.py
./lib/paramiko/sftp.py
./lib/paramiko/config.py
./lib/paramiko/compress.py
./lib/paramiko/_winapi.py
./lib/paramiko/_version.py
./lib/paramiko/kex_ecdh_nist.py
./lib/paramiko/sftp_server.py
./lib/paramiko/rsakey.py
./lib/paramiko/ecdsakey.py
./lib/paramiko/py3compat.py
./lib/paramiko/dsskey.py
./lib/paramiko/packet.py
./lib/paramiko/sftp_file.py
./lib/paramiko/kex_gss.py
./lib/paramiko/file.py
./lib/paramiko/server.py
./lib/paramiko/win_pageant.py
./lib/paramiko/common.py
./lib/paramiko/util.py
./lib/paramiko/hostkeys.py
./lib/paramiko/transport.py
./lib/paramiko/message.py
./lib/paramiko/pkey.py
./lib/paramiko/sftp_si.py
./lib/paramiko/kex_group16.py
./lib/psutil/
./lib/psutil/_psposix.py
./lib/psutil/_common.py
./lib/psutil/_psutil_linux.so_3.7
./lib/psutil/_psosx.py
./lib/psutil/__init__.py
./lib/psutil/_compat.py
./lib/psutil/_pswindows.py
./lib/psutil/tests/
./lib/psutil/tests/__main__.py
./lib/psutil/tests/test_windows.py
./lib/psutil/tests/test_testutils.py
./lib/psutil/tests/test_linux.py
./lib/psutil/tests/test_posix.py
。
。去除部分输出。
。
./script/domain_utils/cluster_os/cluster_user.py
./script/domain_utils/cluster_file/
./script/domain_utils/cluster_file/profile_file.py
./script/domain_utils/cluster_file/config_param.py
./script/domain_utils/cluster_file/version_info.py
./script/domain_utils/cluster_file/__init__.py
./script/domain_utils/cluster_file/cluster_config_file.py
./script/domain_utils/cluster_file/cluster_dir.py
./script/domain_utils/cluster_file/package_info.py
./script/domain_utils/cluster_file/cluster_log.py
./script/domain_utils/__init__.py
./script/domain_utils/sql_handler/
./script/domain_utils/sql_handler/sql_executor.py
./script/domain_utils/sql_handler/sql_file.py
./script/domain_utils/sql_handler/__init__.py
./script/domain_utils/sql_handler/sql_result.py
./script/domain_utils/domain_common/
./script/domain_utils/domain_common/cluster_constants.py
./script/domain_utils/domain_common/__init__.py
./script/domain_utils/security/
./script/domain_utils/security/__init__.py
./script/domain_utils/security/random_value.py
./script/gs_uninstall
./script/gs_sshexkey
./version.cfg
total 264392
-rw-r--r--. 1 root root 1329 Jun 27 15:07 clusterconfig.xml
drwxr-x---. 14 root root 4096 May 14 10:37 lib
-rw-r--r--. 1 root root 134822604 Jun 27 15:05 openGauss-5.0.2-openEuler-64bit-all.tar.gz
-rw-r-----. 1 root root 108 May 14 10:38 openGauss-5.0.2-openEuler-64bit-cm.sha256
-rw-r-----. 1 root root 22571112 May 14 10:38 openGauss-5.0.2-openEuler-64bit-cm.tar.gz
-rw-r-----. 1 root root 65 May 14 10:37 openGauss-5.0.2-openEuler-64bit-om.sha256
-rw-r-----. 1 root root 11061713 May 14 10:37 openGauss-5.0.2-openEuler-64bit-om.tar.gz
-rw-r-----. 1 root root 65 May 14 10:38 openGauss-5.0.2-openEuler-64bit.sha256
-rw-r-----. 1 root root 101739653 May 14 10:38 openGauss-5.0.2-openEuler-64bit.tar.bz2
drwxr-x---. 10 root root 4096 May 14 10:37 script
-rw-------. 1 root root 65 May 14 10:36 upgrade_sql.sha256
-rw-------. 1 root root 501111 May 14 10:36 upgrade_sql.tar.gz
-rw-r-----. 1 root root 32 May 14 10:37 version.cfg
15.Uncompress openGauss Package completed.
Begin to execute openGauss preinstall:
/soft/openGauss/script/domain_utils/sql_handler/../../../lib/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
raise TypeError("%s and %s are not of the same version" (a, b))
Parsing the configuration file.
Successfully parsed the configuration file.
Installing the tools on the local node.
Successfully installed the tools on the local node.
Setting host ip env
Successfully set host ip env.
Are you sure you want to create the user[omm] (yes/no)? yes
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.
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 "/soft/openGauss/script/gs_checkos -i A -h gaussdb --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.
16.openGauss preinstall completed.
Begin to Check OS environment:
Checking items:
A1. [ OS version status ] : Normal
[gaussdb]
openEuler_22.03_64bit
A2. [ Kernel version status ] : Normal
The names about all kernel versions are same. The value is "5.10.0-182.0.0.95.oe2203sp3.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 ] : Normal
The value about swap memory is correct.
A6. [ System control parameters status ] : Normal
All values about system control parameters are correct.
A7. [ File system configuration status ] : Warning
[gaussdb]
Warning reason: variable 'open files' RealValue '1024' ExpectedValue '1000000'
Warning reason: variable 'max user processes' RealValue '13500' ExpectedValue 'unlimited'
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
[gaussdb]
BondMode Null
Warning reason: network 'enp0s3' 'mtu' RealValue '1500' ExpectedValue '8192'
A12.[ Time consistency status ] : Warning
[gaussdb]
The NTPD not detected on machine and local time is "2024-06-27 15:08:09".
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:3.
Begin to execute openGauss install:
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:
begin to create CA cert files
The sslcert will be generated in /gaussdb/app/share/sslcert/om
NO cm_server instance, no need to create CA for CM.
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.
Configuring pg_hba on all nodes.
Configuration is completed.
The cluster status is Normal.
Successfully started cluster.
Successfully installed application.
end deploy..
17.openGauss install completed.
openGauss Install completed.congratulations
Congratulations!!!
[root@gaussdb scripts]#
安装完成后登录数据库,验证是否成功。
[root@gaussdb openGauss]# su - omm
Last login: Thu Jun 27 15:08:09 CST 2024 on pts/1
Welcome to 5.10.0-182.0.0.95.oe2203sp3.x86_64
System information as of time: Thu Jun 27 03:22:13 PM CST 2024
System load: 0.02
Processes: 103
Memory used: 15.9%
Swap used: 0.0%
Usage On: 11%
IP address: 192.168.1.199
Users online: 2
To run a command as administrator(user "root"),use "sudo <command>".
[omm@gaussdb ~]$ gsql -d postgres -p 26000
gsql ((openGauss 5.0.2 build 48a25b11) compiled at 2024-05-14 10:26:01 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
openGauss=# select version();
version
------------------------------------------------------------------------------------------------------------------------------------------------------
(openGauss 5.0.2 build 48a25b11) compiled at 2024-05-14 10:26:01 commit 0 last mr on x86_64-unknown-linux-gnu, compiled by g++ (GCC) 7.3.0, 64-bit
(1 row)
openGauss=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+-------+----------+---------+-------+-------------------
postgres | omm | UTF8 | C | C |
template0 | omm | UTF8 | C | C | =c/omm +
| | | | | omm=CTc/omm
template1 | omm | UTF8 | C | C | =c/omm +
| | | | | omm=CTc/omm
(3 rows)
openGauss=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------------------------------------------------------------+-----------
omm | Sysadmin, Create role, Create DB, Replication, Administer audit, Monitoradmin, Operatoradmin, Policyadmin, UseFT | {}
openGauss=# \dt
No relations found.
openGauss=# show server_version;
server_version
----------------
9.2.4
(1 row)
报错处理
1.在omm用户下执行gs_ctl命令报错
[omm@znjc bin]$ ./gs_ctl restart
[2024-08-01 16:44:53.233][15775][][gs_ctl]: no database directory specified and environment variable PGDATA unset
Try "gs_ctl --help" for more information.
原因:没配置环境变量
解决方法:
临时解决:
[omm@znjc bin]$ ps -ef |grep gauss
omm 13032 1 3 16:24 ? 00:00:50 /gaussdb/app/bin/gaussdb -D /gaussdb/data/db1
omm 15844 15704 0 16:47 pts/1 00:00:00 grep --color=auto gauss
[omm@znjc bin]$ ./gs_ctl status -D /gaussdb/data/db1
[2024-08-01 16:47:52.279][15863][][gs_ctl]: gs_ctl status,datadir is /gaussdb/data/db1
gs_ctl: server is running (PID: 13032)
/gaussdb/app/bin/gaussdb "-D" "/gaussdb/data/db1"
[omm@znjc bin]$ ./gs_ctl restart -D /gaussdb/data/db1
添加环境变量解决:
[omm@znjc ~]$ cat .bash_profile
# Source /root/.bashrc if user has one
[ -f ~/.bashrc ] && . ~/.bashrc
export PGDATA=/gaussdb/data
[omm@znjc ~]$ source .bash_profile
[omm@znjc ~]$ gs_ctl status
[2024-08-02 09:14:27.902][43874][][gs_ctl]: gs_ctl status,datadir is /gaussdb/data
no server running