openGauss5.0企业版CentOS单节点安装-避坑指南

一、安装环境
CPU:2核
内存:4G
磁盘:20G
操作系统:CentOS 7.9
python版本:Python 3.6.8
主机名:node111
IP地址:172.16.1.111


二、依赖包
1、安装依赖包
yum install -y libaio-devel flex bison ncurses-devel glibc-devel patch lsb_release readline-devel expect bzip2 ntp lsof

2、检查是否已安装
rpm -qa libaio-devel flex bison ncurses-devel glibc-devel patch lsb_release readline-devel expect bzip2

注:redhat-lsb-core系统默认已安装

三、安装前准备1
1、修改操作系统参数
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
# 检查
cat /etc/sysctl.conf
使其生效
sysctl -p
如果有提示不存在的直接注释掉,再执行

2、关闭透明大页
-- 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
ifconfig ens32  mtu 8192
EOF

chmod 755 /etc/rc.d/rc.local
systemctl enable rc-local
systemctl start rc-local

-- 查看是否关闭:
cat /sys/kernel/mm/transparent_hugepage/enabled
cat /sys/kernel/mm/transparent_hugepage/defrag

3、关闭防火墙
systemctl disable firewalld.service
systemctl stop firewalld.service
# 检查防火墙状态
systemctl status firewalld

4、关闭SELINUX
sed -i 's/^SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
# 检查
cat /etc/selinux/config | grep SELINUX

5、修改字符集
cat>> /etc/profile<<EOF
export LANG=en_US.UTF-8
EOF
source /etc/profile
# 检查
cat /etc/profile | grep LANG

6、修改时区
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
-- 查看
date
如果出现情况,说明时区正常,可跳过

7、关闭swap
# 临时关闭
swapoff -a
# 永久关闭注释 swap 行
# vim /etc/fstab
# 查看swap一行全是 0 表示swap关闭
free -h

8、设置网卡MTU,要求数据库各节点的网卡MTU值设置为相同大小。MTU值推荐8192,要求不小于1500 
-- 设置网卡为8192
ifconfig ens32  mtu 8192

9、设置root用户远程登录
cat >>/etc/ssh/sshd_config<<EOF
PermitRootLogin yes
EOF
# 检查
cat /etc/ssh/sshd_config |grep PermitRootLogin

10、修改Banner配置
cat >>/etc/ssh/sshd_config<<EOF
Banner none
EOF
# 检查
cat /etc/ssh/sshd_config | grep Banner
# 重启生效
systemctl restart sshd.service

11、修改DNS,IP为网关IP,需要根据实际情况填写
# 节点一
cat >>/etc/resolv.conf<<EOF
nameserver 223.5.5.5
EOF
# 检查
cat /etc/resolv.conf

12.安装python3
yum install libaio-devel flex bison ncurses-devel glibc-devel patch redhat-lsb python3 bzip2 -y
#服务器需要用到Python-3.x命令,但CentOS 7.x 默认版本Python-2.7.x,需要切换到Python-3.x版本
mv /usr/bin/python /usr/bin/python.bak
ln -s /usr/bin/python3 /usr/bin/python

设置yum使用python2.7否则无法通过yum install安装软件
vim /usr/bin/yum
#!/usr/bin/python2.7
:wq! 保存退出

vim /usr/libexec/urlgrabber-ext-down
/usr/bin/python2.7
:wq! 保存退出

测试一下yum是否可以正常使用
yum makecache
#设置完成之后重启下系统,继续操作

四、安装前准备2
1、修改hostname,local_host替换为本机IP

# 主机名修改
cat > /etc/hostname<<EOF
node111
EOF
# 检查
cat /etc/hostname

2、创建目录
# 创建存放安装包的目录
mkdir -p /opt/software/openGauss
chmod 755 -R /opt/software

# 创建数据库软件相关目录
mkdir -p /opt/openGauss
chmod -R 755 /opt/openGauss

3、下载安装包
# 下载地址:openGauss
openGauss
或者直接命令行执行
wget https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.0.0/x86/openGauss-5.0.0-CentOS-64bit-all.tar.gz


4、解压安装包
# 将下载的安装包移到安装目录
mv openGauss-5.0.0-CentOS-64bit-all.tar.gz /opt/software/openGauss/
cd /opt/software/openGauss
tar -zxvf openGauss-5.0.0-CentOS-64bit-all.tar.gz
tar -zxvf openGauss-5.0.0-CentOS-64bit-om.tar.gz

五、安装
1、xml配置
安装openGauss前需要创建cluster_config.xml文件。cluster_config.xml文件包含部署openGauss的服务器信息、安装路径、IP地址以及端口号等。 用于告知openGauss如何部署。用户需根据不同场景配置对应的XML文件。

# 查找xml配置模板
find / -name cluster_config_template.xml

# 移动到安装目录
cp /root/gauss_om/omm/script/gspylib/etc/conf/cluster_config_template.xml /opt/software/openGauss/cluster_config.xml

# 编辑xml文件
vi /opt/software/openGauss/cluster_config.xml
<?xml version="1.0" encoding="utf-8"?>
<ROOT>
  <CLUSTER>
    <PARAM name="clusterName" value="opengauss" />
    <PARAM name="nodeNames" value="node111"/>
    <PARAM name="gaussdbAppPath" value="/opt/openGauss/app" />
    <PARAM name="gaussdbLogPath" value="/opt/openGauss/log/omm" />
    <PARAM name="tmpMppdbPath" value="/opt/openGauss/tmp"/>
    <PARAM name="gaussdbToolPath" value="/opt/openGauss/om" />
    <PARAM name="corePath" value="/opt/openGauss/corefile"/>
    <PARAM name="backIp1s" value="172.16.1.111"/>
  </CLUSTER>
  <DEVICELIST>
    <DEVICE sn="node111">
      <PARAM name="name" value="node111"/>
      <PARAM name="azName" value="AZ1"/>
      <PARAM name="azPriority" value="1"/>
      <PARAM name="backIp1" value="172.16.1.111"/>
      <PARAM name="sshIp1" value="172.16.1.111"/>
      <!-- dn -->
      <PARAM name="dataNum" value="1"/>
      <PARAM name="dataPortBase" value="15400"/>
      <PARAM name="dataNode1" value="/opt/openGauss/data/dn"/>
      <PARAM name="dataNode1_syncNum" value="0"/>
    </DEVICE>
  </DEVICELIST>
</ROOT>

2、预安装
2.1安装之前可以用以下脚本检查一下环境是否合格:
[root@node111 openGauss]# /opt/software/openGauss/script/gs_checkos -i A -h node111 --detail
Checking items:
    A1. [ OS version status ]                                   : Normal    
        [node111]
        centos_7.9.2009_64bit
    A2. [ Kernel version status ]                               : Normal    
        The names about all kernel versions are same. The value is "3.10.0-1160.el7.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 ]                    : Normal    
        Both soft nofile and hard nofile are correct.     
    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.    
    A11.[ Network card configuration status ]                   : Warning   
        [node111]
BondMode Null
        Warning reason: network 'ens32' 'mtu' RealValue '1500' ExpectedValue '8192'
    A12.[ Time consistency status ]                             : Warning   
        [node111]
        The NTPD not detected on machine and local time is "2023-06-19 16:26:01".
    A13.[ Firewall service status ]                             : Normal    
        The firewall service is stopped.                  
    A14.[ THP service status ]                                  : Normal    
        The THP service is stopped.                       
Total numbers:13. Abnormal numbers:0. Warning numbers:2.
注意:第一步的环境准备阶段参数设置后最后一定要重启,一定要重启,一定要重启,重要的事情说三篇,否则某些参数未生效会导致预安装失败,具体会有报错提提醒,
执行/opt/software/openGauss/script/gs_checkos -i A -h localhost --detail 就能看到报错信息,如果最后的Abnormal_numbers的值不为0,一定要找到对应项修改好,再次执行命令查看,直到Abnormal_numbers的值为0为止) 

2.2进行预安装:
/opt/software/openGauss/script/gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml
 
异常:
[GAUSS-50202] : The /opt/openGauss must be empty. Or user [omm] has write permission to directory /opt/openGauss. Because it will create symbolic link [/opt/openGauss/app] to install path [/opt/openGauss/app_a07d57c3] in gs_install process with this user.
原因:之前预安装失败,产生的文件,需要删除,也可能是omm没有文件权限
rm -rf /opt/openGauss/*
chown omm:dbgrp -R /opt/openGauss
chown omm:dbgrp -R /opt/software/openGauss
重新执行一下:
[root@node1 openGauss]# ./script/gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml
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
这边会要求输入密码,密码规则如下:     
最少包含8个字符,最多包含16个字符。
不能和用户名、当前密码(ALTER)、或当前密码反序相同。
至少包含大写字母(A-Z)、小写字母(a-z)、数字、非字母数字字符(限定为~!@#$%^&*()-_=+\|[{}];:,<.>/?)四类字符中的三类字符
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 "/opt/software/openGauss/script/gs_checkos -i A -h node1 --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.
3、安装
切换到omm用户,设置数据库初始账号omm密码要求
[omm@node111 ~]$ su -  omm
[omm@node111 ~]$ gs_install -X /opt/software/openGauss/cluster_config.xml
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:Rscpass123.
Please repeat for database:Rscpass123.
begin to create CA cert files
The sslcert will be generated in /opt/openGauss/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.
Using omm:dbgrp to install database.
Using installation program path : /opt/openGauss/app_a07d57c3
$GAUSSHOME points to /opt/openGauss/app_a07d57c3, no need to create symbolic link.
Traceback (most recent call last):
  File "/opt/openGauss/om/script/local/Install.py", line 812, in <module>
    functionDict[g_opts.action]()
  File "/opt/openGauss/om/script/local/Install.py", line 743, in startCluster
    dn.start(self.time_out)
  File "/opt/openGauss/om/script/local/../gspylib/component/Kernel/Kernel.py", line 106, in start
    "failure details." + "\n" + output)
Exception: [GAUSS-51607] : Failed to start instance. Error: Please check the gs_ctl log for failure details.
[2023-06-19 15:53:54.986][5887][][gs_ctl]: gs_ctl started,datadir is /opt/openGauss/data/dn
[2023-06-19 15:53:55.075][5887][][gs_ctl]: waiting for server to start...
.0 LOG:  [Alarm Module]can not read GAUSS_WARNING_TYPE env.
0 LOG:  [Alarm Module]Host Name: node111
0 LOG:  [Alarm Module]Host IP: node111. Copy hostname directly in case of taking 10s to use 'gethostbyname' when /etc/hosts does not contain <HOST IP>
0 LOG:  [Alarm Module]Cluster Name: opengauss
0 LOG:  [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 58
0 WARNING:  failed to open feature control file, please check whether it exists: FileName=gaussdb.version, Errno=2, Errmessage=No such file or directory.
0 WARNING:  failed to parse feature control file: gaussdb.version.
0 WARNING:  Failed to load the product control file, so gaussdb cannot distinguish product version.
0 LOG:  bbox_dump_path is set to /opt/openGauss/corefile/
2023-06-19 15:53:55.288 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 DB010  0 [REDO] LOG:  Recovery parallelism, cpu count = 4, max = 4, actual = 4
2023-06-19 15:53:55.288 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 DB010  0 [REDO] LOG:  ConfigRecoveryParallelism, true_max_recovery_parallelism:4, max_recovery_parallelism:4
gaussdb.state does not exist, and skipt setting since it is optional.2023-06-19 15:53:55.308 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  [Alarm Module]can not read GAUSS_WARNING_TYPE env.
2023-06-19 15:53:55.308 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  [Alarm Module]Host Name: node111
2023-06-19 15:53:55.308 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  [Alarm Module]Host IP: node111. Copy hostname directly in case of taking 10s to use 'gethostbyname' when /etc/hosts does not contain <HOST IP>
2023-06-19 15:53:55.308 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  [Alarm Module]Cluster Name: opengauss
2023-06-19 15:53:55.308 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 58
2023-06-19 15:53:55.430 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  loaded library "security_plugin"
2023-06-19 15:53:55.445 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 01000  0 [BACKEND] WARNING:  could not create any HA TCP/IP sockets
2023-06-19 15:53:55.445 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 01000  0 [BACKEND] WARNING:  could not create any HA TCP/IP sockets
2023-06-19 15:53:55.452 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  InitNuma numaNodeNum: 1 numa_distribute_mode: none inheritThreadPool: 0.
2023-06-19 15:53:55.452 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 01000  0 [BACKEND] WARNING:  Failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (1024 Mbytes) or shared memory (3630 Mbytes) is larger.
2023-06-19 15:53:55.452 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 42809  0 [BACKEND] FATAL:  could not create shared memory segment: Cannot allocate memory
2023-06-19 15:53:55.452 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 42809  0 [BACKEND] DETAIL:  Failed system call was shmget(key=15400001, size=3806644552, 03600).
2023-06-19 15:53:55.452 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 42809  0 [BACKEND] HINT:  This error usually means that openGauss's request for a shared memory segment exceeded available memory or swap space, or exceeded your kernel's SHMALL parameter.  You can either reduce the request size or reconfigure the kernel with larger SHMALL.  To reduce the request size (currently 3806644552 bytes), reduce openGauss's shared memory usage, perhaps by reducing shared_buffers.
        The openGauss documentation contains more information about shared memory configuration.
2023-06-19 15:53:55.461 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  FiniNuma allocIndex: 0.
[2023-06-19 15:53:56.077][5887][][gs_ctl]: waitpid 5890 failed, exitstatus is 256, ret is 2
[2023-06-19 15:53:56.077][5887][][gs_ctl]: stopped waiting
[2023-06-19 15:53:56.077][5887][][gs_ctl]: could not start server
Examine the log output.
[GAUSS-51607] : Failed to start instance. Error: Please check the gs_ctl log for failure details.
[2023-06-19 15:53:54.986][5887][][gs_ctl]: gs_ctl started,datadir is /opt/openGauss/data/dn
[2023-06-19 15:53:55.075][5887][][gs_ctl]: waiting for server to start...
.0 LOG:  [Alarm Module]can not read GAUSS_WARNING_TYPE env.
0 LOG:  [Alarm Module]Host Name: node111
0 LOG:  [Alarm Module]Host IP: node111. Copy hostname directly in case of taking 10s to use 'gethostbyname' when /etc/hosts does not contain <HOST IP>
0 LOG:  [Alarm Module]Cluster Name: opengauss
0 LOG:  [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 58
0 WARNING:  failed to open feature control file, please check whether it exists: FileName=gaussdb.version, Errno=2, Errmessage=No such file or directory.
0 WARNING:  failed to parse feature control file: gaussdb.version.
0 WARNING:  Failed to load the product control file, so gaussdb cannot distinguish product version.
0 LOG:  bbox_dump_path is set to /opt/openGauss/corefile/
2023-06-19 15:53:55.288 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 DB010  0 [REDO] LOG:  Recovery parallelism, cpu count = 4, max = 4, actual = 4
2023-06-19 15:53:55.288 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 DB010  0 [REDO] LOG:  ConfigRecoveryParallelism, true_max_recovery_parallelism:4, max_recovery_parallelism:4
gaussdb.state does not exist, and skipt setting since it is optional.2023-06-19 15:53:55.308 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  [Alarm Module]can not read GAUSS_WARNING_TYPE env.
2023-06-19 15:53:55.308 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  [Alarm Module]Host Name: node111
2023-06-19 15:53:55.308 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  [Alarm Module]Host IP: node111. Copy hostname directly in case of taking 10s to use 'gethostbyname' when /etc/hosts does not contain <HOST IP>
2023-06-19 15:53:55.308 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  [Alarm Module]Cluster Name: opengauss
2023-06-19 15:53:55.308 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 58
2023-06-19 15:53:55.430 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  loaded library "security_plugin"
2023-06-19 15:53:55.445 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 01000  0 [BACKEND] WARNING:  could not create any HA TCP/IP sockets
2023-06-19 15:53:55.445 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 01000  0 [BACKEND] WARNING:  could not create any HA TCP/IP sockets
2023-06-19 15:53:55.452 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  InitNuma numaNodeNum: 1 numa_distribute_mode: none inheritThreadPool: 0.
2023-06-19 15:53:55.452 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 01000  0 [BACKEND] WARNING:  Failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (1024 Mbytes) or shared memory (3630 Mbytes) is larger.
2023-06-19 15:53:55.452 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 42809  0 [BACKEND] FATAL:  could not create shared memory segment: Cannot allocate memory
2023-06-19 15:53:55.452 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 42809  0 [BACKEND] DETAIL:  Failed system call was shmget(key=15400001, size=3806644552, 03600).
2023-06-19 15:53:55.452 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 42809  0 [BACKEND] HINT:  This error usually means that openGauss's request for a shared memory segment exceeded available memory or swap space, or exceeded your kernel's SHMALL parameter.  You can either reduce the request size or reconfigure the kernel with larger SHMALL.  To reduce the request size (currently 3806644552 bytes), reduce openGauss's shared memory usage, perhaps by reducing shared_buffers.
        The openGauss documentation contains more information about shared memory configuration.
2023-06-19 15:53:55.461 64900993.1 [unknown] 140546600235264 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  FiniNuma allocIndex: 0.
[2023-06-19 15:53:56.077][5887][][gs_ctl]: waitpid 5890 failed, exitstatus is 256, ret is 2
[2023-06-19 15:53:56.077][5887][][gs_ctl]: stopped waiting
[2023-06-19 15:53:56.077][5887][][gs_ctl]: could not start server
Examine the log output.
上面报错是因为虚拟机内存太低了
在/opt/openGauss/data/dn/postgresql.conf中调整以下参数:
shared_buffers = 128MB
cstore_buffers = 128MB         #min 16MB 
ssl = off

重新启动数据库:
[omm@node111 ~]$ gs_om -t start
Starting cluster.
=========================================
[SUCCESS] node111
2023-06-19 16:00:49.713 64900b31.1 [unknown] 140112666550528 [unknown] 0 dn_6001 01000  0 [BACKEND] WARNING:  could not create any HA TCP/IP sockets
2023-06-19 16:00:49.713 64900b31.1 [unknown] 140112666550528 [unknown] 0 dn_6001 01000  0 [BACKEND] WARNING:  could not create any HA TCP/IP sockets
2023-06-19 16:00:49.715 64900b31.1 [unknown] 140112666550528 [unknown] 0 dn_6001 01000  0 [BACKEND] WARNING:  Failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (256 Mbytes) or shared memory (1735 Mbytes) is larger.
=========================================
Successfully started.  

4、安装验证
[omm@node111 dn]$ gs_om -t status --detail
[   Cluster State   ]
cluster_state   : Normal
redistributing  : No
current_az      : AZ_ALL
[  Datanode State   ]
    node   node_ip         port      instance                       state
-----------------------------------------------------------------------------------------
1  node111 172.16.1.111    15400      6001 /opt/openGauss/data/dn   P Primary Normal 

5、数据库基本操作
# 关闭服务
gs_om -t stop
# 启动服务
gs_om -t start
# 登录数据库
gsql -d postgres -p 15400

# 查看数据库版本
select version();
[omm@node111 ~]$ gsql -d postgres -p 15400
gsql ((openGauss 5.0.0 build a07d57c3) compiled at 2023-03-29 03:07:56 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.0 build a07d57c3) compiled at 2023-03-29 03:07:56 commit 0 last mr   on x86_64-unknown-linux-gnu, compile
d by g++ (GCC) 7.3.0, 64-bit
(1 row)


openGauss=# \l
                          List of databases
   Name    | Owner | Encoding  | Collate | Ctype | Access privileges
-----------+-------+-----------+---------+-------+-------------------
postgres  | omm   | SQL_ASCII | C       | C     |
template0 | omm   | SQL_ASCII | C       | C     | =c/omm           +
           |       |           |         |       | omm=CTc/omm
template1 | omm   | SQL_ASCII | C       | C     | =c/omm           +
           |       |           |         |       | omm=CTc/omm
(3 rows)
 查看数据库的进程:
[omm@node111 opt]$ ps -ef | grep openGauss
omm       6829     1 10 16:00 ?        00:04:06 /opt/openGauss/app/bin/gaussdb -D /opt/openGauss/data/dn
omm      12936  3575  0 16:41 pts/0    00:00:00 grep --color=auto openGauss


查看端口号:
[root@node111 openGauss]# lsof -i:15400
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
gaussdb 6829  omm    8u  IPv6  46886      0t0  TCP localhost:15400 (LISTEN)
gaussdb 6829  omm    9u  IPv4  46887      0t0  TCP localhost:15400 (LISTEN)
gaussdb 6829  omm   12u  IPv4  46895      0t0  TCP node111:15400 (LISTEN)


openGauss=# \l
                          List of databases
   Name    | Owner | Encoding  | Collate | Ctype | Access privileges
-----------+-------+-----------+---------+-------+-------------------
postgres  | omm   | SQL_ASCII | C       | C     |
template0 | omm   | SQL_ASCII | C       | C     | =c/omm           +
           |       |           |         |       | omm=CTc/omm
template1 | omm   | SQL_ASCII | 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, U
seFT | {}


分割线
感谢打赏
江西数库信息技术有限公司
YWSOS.COM 平台代运维解决方案
 评论
 发表评论
姓   名:

Powered by AKCMS