引言
近两年,国产数据库的发展有目共睹,随着技术的不断发展,政府、企业对于信息数据的安全的需求日益增强,国产化进程不断推进,贡献出来很多国产化数据库。安装数据库以及如何避坑也是我们作为运维人员的一项基础技能,今天想聊聊如何在安装 openGauss 数据库,9月30日,openGauss 6.0 LTS版本正式上线。
openGauss是怎样的数据库
openGauss 是一款开源关系型数据库管理系统,采用木兰宽松许可证 v2 发行。2019 年 9 月 19 日,在华为全联接大会上,华为宣布将开源其数据库产品,开源后命名为 openGauss。第二年,openGauss 数据库源代码正式开放。
openGauss 官网:https://opengauss.org/zh/
openGauss 组织仓库: https://gitee.com/opengauss
openGauss 镜像仓库: https://github.com/opengauss-mirror

openGauss优势特点
近期 openGauss 在市场数据库领迅速域崭露头角,主要有四个特点,分别是 高可靠、高性能、高安全、易运维。

- 高可靠:openGauss支持同城跨AZ(Available Zone)容灾,确保数据不丢失,且能在分钟级内恢复。它支持主备同步、异步以及级联备机等多种部署模式,具备强大的数据恢复和故障切换能力。多副本一致性协议的使用,进一步保证了数据的一致性和服务的持续性。
- 高性能:openGauss通过列存储、向量化执行引擎、融合引擎等关键技术,实现了百亿数据量查询秒级响应。同时,它提供了面向多核架构的并发控制技术,结合鲲鹏硬件优化,能够在两路鲲鹏下达到极高的TPCC Benchmark性能。此外,openGauss还支持Sql-bypass智能快速引擎技术,该技术能够针对特定场景下的查询需求,提供更快的查询响应速度。
- 高安全:openGauss提供了全方位端到端的数据安全保护,包括访问控制、加密认证、数据库审计、动态数据脱敏等安全特性。同时,它还支持TIMECAPSULE和RECYCLEBIN功能,允许用户通过指定时间戳进行闪回查询或表恢复,提高了用户数据的可靠性。此外,openGauss还支持全密态计算,能够在数据加密的状态下完成计算任务,保护数据的机密性和隐私性。
- 易运维:openGauss支持WDR诊断、慢SQL诊断、Session诊断等多种维护手段,帮助用户准确快速定位问题。此外,它还具备AI4DB能力,能够通过AI算法实现数据库自调优、自监控、自诊断等功能,降低了数据库的运维成本。
除了上述的优秀点,openGauss支持多种数据类型,支持水平扩展和垂直扩展,可以根据业务需求灵活扩展数据库的容量和性能,广泛应用于大并发、大数据量、以联机事务处理为主的交易型应用场景。
openGauss如何下载安装
下载 openGauss 6.0.0 (LTS) 可以从官方网站下载,官网地址为:https://opengauss.org/zh/download/。openGauss Server 支持 AArch x64位架构和 x86_64位架构。操作系统支持的情况就比较少,目前支持 openEuler 20.03 LTS 、openEuler 22.03 LTS 、CentOS 7.6、Kylin V10、Asianux 7.5(7.6)、UOS V20,目前我这里只有GUN/Linux(CentOS)操作系统(后续抽空再在Kylin V10、UOS V20 做一下安装的博文)。官方提供了四种类型的软件包,分别为企业版、极简版、轻量版和分布式镜像。可以按照自己极其的支撑情况,下载安装,尝试新鲜。具体的安装可以参考官网文档:安装 openGauss 。

openGauss极简版安装
1 安装前软硬件准备
本次测试为 openGauss 6.0.0 LTS 轻量版。
- 下载软件:openGauss-Lite-6.0.0-CentOS7-x86_64.tar.gz
- 操作系统:CentOS 7.6
- 内存/磁盘:8G / 957G
- 软件依赖:主要有 libaio-devel 、grep readline-devel 、 grep expect.x86_64 、Python
[root@localhost ~]# yum list | grep libaio-devel
libaio-devel.i686 0.3.109-13.el7 os
libaio-devel.x86_64 0.3.109-13.el7 os
[root@localhost ~]#
[root@localhost ~]# yum list | grep readline-devel
readline-devel.i686 6.2-11.el7 os
readline-devel.x86_64 6.2-11.el7 os
tcl-tclreadline-devel.x86_64 2.1.0-3.el7 epel
[root@localhost ~]#
[root@localhost ~]# yum list | grep expect.x86_64
expect.x86_64 5.45-14.el7_1 os
[root@localhost ~]#
[root@localhost ~]# python --version
Python 2.7.5
[root@localhost ~]#2 操作系统配置检测
- 关闭安全服务
关闭安全服务后,需要重启服务器,
[root@localhost ~]# sudo sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config- 检查防火墙是否关闭
若防火墙状态显示为active (running),则表示防火墙未关闭,此时执行 systemctl stop firewalld.service关闭防火墙即可;
若防火墙状态显示为inactive (dead),则无需再关闭防火墙。
[root@localhost ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
[root@localhost ~]#- 检查机器字符集
如果没有设置,或者设置了其他字符集,尽量使用 zh_CN.UTF-8字符集 。程序会根据本地的默认字符集,程序根据配置的语言设置会显示对应语言的导航栏,用户在导航栏选择使用哪种语言来进行下面的安装(支持:中文,英文)。默认不设置的时候会是 en_
[root@localhost ~]# cat /etc/profile | grep LANG
export LANG="zh_CN.UTF-8"
[root@localhost ~]#
[root@localhost openGauss]# echo $LANG
zh_CN.UTF-8
[root@localhost openGauss]# - 检查SEMMNI的配置
检查SEMMNI的配置是否足够大,如果不够大,可以参考此处进行设置,请参考,修改配置即可:https://docs.opengauss.org/zh/docs/latest/docs/InstallationGuide/%E5%8D%95%E8%8A%82%E7%82%B9%E5%AE%89%E8%A3%85.html
[root@localhost openGauss]# cat /proc/sys/kernel/sem
250 85000 250 330
[root@localhost openGauss]#
[root@localhost openGauss]# 3 安装OpenGauss
3.1 创建测试目录并上传文件包
步骤一:在root帐号下,创建一个目录并给予普通用户设置权限
[root@localhost data]# mkdir -p /data/software/openGauss
[root@localhost data]# chown -R test:test /data/software/openGauss步骤二:切换test帐号下,上传文件包并在当前目录下解压
[test@localhost openGauss]$ tar -zxvf openGauss-Lite-6.0.0-CentOS7-x86_64.tar.gz
./dependency/
./dependency/libstdc++.so.6
./install.sh
./openGauss-Lite-6.0.0-CentOS7-x86_64.bin
./openGauss-Lite-6.0.0-CentOS7-x86_64.sha256
./opengauss_lite.conf
./uninstall.sh
./upgrade_common.sh
./upgrade_config.sh
./upgrade_errorcode.sh
./upgrade_GAUSSV5.sh
./upgrade_sql.sha256
./upgrade_sql.tar.gz
./version.cfg
[test@localhost openGauss]$
[test@localhost openGauss]$ ll
total 60056
drwxr-xr-x. 2 test test 28 Sep 29 19:05 dependency
-rw-r--r--. 1 test test 38901 Sep 29 19:05 install.sh
-rw-r--r--. 1 test test 30460994 Sep 29 19:05 openGauss-Lite-6.0.0-CentOS7-x86_64.bin
-rw-r--r--. 1 test test 65 Sep 29 19:05 openGauss-Lite-6.0.0-CentOS7-x86_64.sha256
-r--------. 1 test test 30353880 Nov 19 21:56 openGauss-Lite-6.0.0-CentOS7-x86_64.tar.gz
-rw-r--r--. 1 test test 785 Sep 29 19:05 opengauss_lite.conf
-rw-r--r--. 1 test test 2982 Sep 29 19:05 uninstall.sh
-rw-r--r--. 1 test test 1041 Sep 29 19:05 upgrade_GAUSSV5.sh
-rw-r--r--. 1 test test 41874 Sep 29 19:05 upgrade_common.sh
-rw-r--r--. 1 test test 610 Sep 29 19:05 upgrade_config.sh
-rw-r--r--. 1 test test 392 Sep 29 19:05 upgrade_errorcode.sh
-rw-------. 1 test test 65 Sep 29 19:05 upgrade_sql.sha256
-rw-------. 1 test test 560636 Sep 29 19:05 upgrade_sql.tar.gz
-rw-r--r--. 1 test test 45 Sep 29 19:05 version.cfg
[test@localhost openGauss]$ 3.2 执行安装
执行 install.sh脚本 安装openGauss轻量版安装包。单机版本需要执行下面的步骤,需要修改命令中的密码:
[test@localhost openGauss]$ echo "OpenGuass@2024" | sh ./install.sh --mode single -D ~/openGauss/data -R ~/openGauss/install --start
[test@localhost openGauss]$ sh install.sh -w "OpenGuass@2024" -p 5432 &&source ~/.bashrc幸运的话,你可以看到如下打印信息,安装还是蛮快的。
[test@localhost openGauss]$ echo "OpenGuass@2024" | sh ./install.sh --mode single -D ~/openGauss/data -R ~/openGauss/install --start
info:[check install env and os setting success.]
info:[set GAUSSDATA environment variables success.]
export PATH=/home/test/openGauss/install/bin:/home/test/openGauss/install/bin:/home/jdk8/bin:/home/test/openGauss/install/bin:/home/jdk8/bin:/home/test/openGauss/install/bin:/home/jdk8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin >> /home/test/.bashrc
export LD_LIBRARY_PATH=/home/test/openGauss/install/lib:/data/software/openGauss/dependency:/home/test/openGauss/install/lib: >> /home/test/.bashrc
info:[set GAUSSHOME environment variables success.]
info:[binary files already decompressed, pass.]
mode_type is single and mode is -Z single_node, node name is opengauss
info:cmd : gs_initdb -D /home/test/openGauss/data --nodename=opengauss -w ******
The files belonging to this database system will be owned by user "test".
This user must also own the server process.
The database cluster will be initialized with locale "zh_CN.UTF-8".
The default database encoding has accordingly been set to "UTF8".
gs_initdb: could not find suitable text search configuration for locale "zh_CN.UTF-8"
The default text search configuration will be set to "simple".
fixing permissions on existing directory /home/test/openGauss/data ... ok
creating subdirectories ... in ordinary occasionok
creating configuration files ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 1024MB
Begin init undo subsystem meta.
[INIT UNDO] Init undo subsystem meta successfully.
creating template1 database in /home/test/openGauss/data/base/1 ... 2024-11-19 22:32:43.643 [unknown] [unknown] localhost 140607326665472 0[0:0#0] [BACKEND] WARNING: macAddr is 12/693806842, sysidentifier is 797018/2801414674, randomNum is 4159582738
ok
initializing pg_authid ... ok
setting password ... ok
initializing dependencies ... ok
loading PL/pgSQL server-side language ... ok
creating system views ... ok
creating performance views ... ok
loading system objects' descriptions ... ok
creating collations ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
initialize global configure for bucketmap length ... ok
creating information schema ... ok
loading foreign-data wrapper for distfs access ... ok
loading foreign-data wrapper for log access ... ok
loading hstore extension ... ok
loading security plugin ... ok
update system tables ... ok
creating snapshots catalog ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
freezing database template0 ... ok
freezing database template1 ... ok
freezing database postgres ... ok
syncing data to disk ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run gs_initdb.
Success. You can now start the database server of single node using:
./gaussdb -D /home/test/openGauss/data --single_node
or
./gs_ctl start -D /home/test/openGauss/data -Z single_node -l logfile
[init primary datanode success.]
info:[install datanode success.]
info:cmd : ./gs_guc set -D /home/test/openGauss/data -c "thread_pool_attr='16,1,(nobind)'" -c "enable_asp=off" -c "enable_ustore=off" -c "asp_sample_num=10" -c "enable_incremental_checkpoint=off" -c "enable_double_write=off" -c "shared_buffers=64MB" -c "cstore_buffers=16MB" -c "num_internal_lock_partitions='CLOG_PART=1,CSNLOG_PART=1,LOG2_LOCKTABLE_PART=4,TWOPHASE_PART=1,FASTPATH_PART=20'" -c "max_locks_per_transaction=64" -c "max_prepared_transactions=0" -c "audit_file_remain_threshold=1024" -c "wal_buffers=16MB" -c "segment_buffers=16" -c "max_connections=200" -c "track_activity_query_size=200" -c "data_replicate_buffer_size=4096" -c "max_inner_tool_connections=10" -c "enable_stmt_track=off" -c "use_workload_manager=off" -c "enable_instr_rt_percentile=off" -c "enable_wdr_snapshot=off" -c "enable_global_syscache=on" -c "enable_thread_pool=on" -c "global_syscache_threshold=64MB" -c "local_syscache_threshold=16MB" -c "wal_flush_timeout=800" -c "wal_flush_delay=100"
The gs_guc run with the following arguments: [./gs_guc -D /home/test/openGauss/data -c thread_pool_attr='16,1,(nobind)' -c enable_asp=off -c enable_ustore=off -c asp_sample_num=10 -c enable_incremental_checkpoint=off -c enable_double_write=off -c shared_buffers=64MB -c cstore_buffers=16MB -c num_internal_lock_partitions='CLOG_PART=1,CSNLOG_PART=1,LOG2_LOCKTABLE_PART=4,TWOPHASE_PART=1,FASTPATH_PART=20' -c max_locks_per_transaction=64 -c max_prepared_transactions=0 -c audit_file_remain_threshold=1024 -c wal_buffers=16MB -c segment_buffers=16 -c max_connections=200 -c track_activity_query_size=200 -c data_replicate_buffer_size=4096 -c max_inner_tool_connections=10 -c enable_stmt_track=off -c use_workload_manager=off -c enable_instr_rt_percentile=off -c enable_wdr_snapshot=off -c enable_global_syscache=on -c enable_thread_pool=on -c global_syscache_threshold=64MB -c local_syscache_threshold=16MB -c wal_flush_timeout=800 -c wal_flush_delay=100 set ].
NOTICE: Enable to create ustore table
NOTICE: Every time a transaction is committed, the contents of WAL buffers are written to disk, it is set to a large value will not bring significant performance gains. If you set it to hundreds of megabytes, you may have written to the disk to improve performance on the server a lot of real-time transaction commits. According to experience, the default value is sufficient for most situations.
NOTICE: set timeout when iterator table entry.
NOTICE: set delay time when iterator table entry.
expected instance path: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: thread_pool_attr='16,1,(nobind)': [/home/test/openGauss/data/postgresql.conf]
gs_guc set: enable_asp=off: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: enable_ustore=off: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: asp_sample_num=10: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: enable_incremental_checkpoint=off: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: enable_double_write=off: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: shared_buffers=64MB: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: cstore_buffers=16MB: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: num_internal_lock_partitions='CLOG_PART=1,CSNLOG_PART=1,LOG2_LOCKTABLE_PART=4,TWOPHASE_PART=1,FASTPATH_PART=20': [/home/test/openGauss/data/postgresql.conf]
gs_guc set: max_locks_per_transaction=64: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: max_prepared_transactions=0: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: audit_file_remain_threshold=1024: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: wal_buffers=16MB: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: segment_buffers=16: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: max_connections=200: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: track_activity_query_size=200: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: data_replicate_buffer_size=4096: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: max_inner_tool_connections=10: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: enable_stmt_track=off: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: use_workload_manager=off: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: enable_instr_rt_percentile=off: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: enable_wdr_snapshot=off: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: enable_global_syscache=on: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: enable_thread_pool=on: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: global_syscache_threshold=64MB: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: local_syscache_threshold=16MB: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: wal_flush_timeout=800: [/home/test/openGauss/data/postgresql.conf]
gs_guc set: wal_flush_delay=100: [/home/test/openGauss/data/postgresql.conf]
Total instances: 1. Failed instances: 0.
Success to perform gs_guc!
guc config success.
info:cmd: gs_ctl start -D /home/test/openGauss/data -Z single_node | tee -a /data/software/openGauss/install.log
[2024-11-19 22:33:07.918][128291][][gs_ctl]: gs_ctl started,datadir is /home/test/openGauss/data
[2024-11-19 22:33:07.956][128291][][gs_ctl]: waiting for server to start...
.0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
0 LOG: [Alarm Module]Host Name: localhost.localdomain
0 LOG: [Alarm Module]Host IP: localhost.localdomain. Copy hostname directly in case of taking 10s to use 'gethostbyname' when /etc/hosts does not contain <HOST IP>
0 LOG: [Alarm Module]Get ENV GS_CLUSTER_NAME failed!
0 LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 57
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.
2024-11-19 22:33:08.067 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: when starting as multi_standby mode, we couldn't support data replicaton.
2024-11-19 22:33:08.067 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: base_page_saved_interval is 0, ori is 0.
gaussdb.state does not exist, and skipt setting since it is optional.2024-11-19 22:33:08.251 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
2024-11-19 22:33:08.251 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host Name: localhost.localdomain
2024-11-19 22:33:08.251 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host IP: localhost.localdomain. Copy hostname directly in case of taking 10s to use 'gethostbyname' when /etc/hosts does not contain <HOST IP>
2024-11-19 22:33:08.251 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Get ENV GS_CLUSTER_NAME failed!
2024-11-19 22:33:08.252 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 57
2024-11-19 22:33:08.256 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: loaded library "security_plugin"
2024-11-19 22:33:08.324 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets
2024-11-19 22:33:08.325 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets
2024-11-19 22:33:08.429 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: Max thread pool size 4096 should not be larger than max_connections 200, so reduce max thread pool size to max_connections
2024-11-19 22:33:08.431 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: InitNuma numaNodeNum: 1 numa_distribute_mode: none inheritThreadPool: 0.
2024-11-19 22:33:08.431 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: reserved memory for backend threads is: 220 MB
2024-11-19 22:33:08.431 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: reserved memory for WAL buffers is: 128 MB
2024-11-19 22:33:08.431 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: Set max backend reserve memory is: 348 MB, max dynamic memory is: 11773 MB
2024-11-19 22:33:08.431 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: shared memory 150 Mbytes, memory context 12121 Mbytes, max process memory 12288 Mbytes
2024-11-19 22:33:08.449 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [CACHE] LOG: set data cache size(12582912)
2024-11-19 22:33:08.457 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: Get stream thread proc num [3].
2024-11-19 22:33:08.489 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [SEGMENT_PAGE] LOG: Segment-page constants: DF_MAP_SIZE: 8156, DF_MAP_BIT_CNT: 65248, DF_MAP_GROUP_EXTENTS: 4175872, IPBLOCK_SIZE: 8168, EXTENTS_PER_IPBLOCK: 1021, IPBLOCK_GROUP_SIZE: 4090, BMT_HEADER_LEVEL0_TOTAL_PAGES: 8323072, BktMapEntryNumberPerBlock: 2038, BktMapBlockNumber: 25, BktBitMaxMapCnt: 512
2024-11-19 22:33:08.494 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: gaussdb: fsync file "/home/test/openGauss/data/gaussdb.state.temp" success
2024-11-19 22:33:08.494 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: create gaussdb state file success: db state(STARTING_STATE), server mode(Normal), connection index(1)
2024-11-19 22:33:08.518 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: max_safe_fds = 979, usable_fds = 1000, already_open = 11
2024-11-19 22:33:08.533 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: user configure file is not found, it will be created.
2024-11-19 22:33:08.544 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: the configure file /home/test/openGauss/install/etc/gscgroup_test.cfg doesn't exist or the size of configure file has changed. Please create it by root user!
2024-11-19 22:33:08.544 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [BACKEND] LOG: Failed to parse cgroup config file.
2024-11-19 22:33:08.545 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [EXECUTOR] WARNING: Failed to obtain environment value $GAUSSLOG!
2024-11-19 22:33:08.545 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [EXECUTOR] DETAIL: N/A
2024-11-19 22:33:08.545 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [EXECUTOR] CAUSE: Incorrect environment value.
2024-11-19 22:33:08.545 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [EXECUTOR] ACTION: Please refer to backend log for more details.
2024-11-19 22:33:08.546 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [EXECUTOR] WARNING: Failed to obtain environment value $GAUSSLOG!
2024-11-19 22:33:08.546 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [EXECUTOR] DETAIL: N/A
2024-11-19 22:33:08.546 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [EXECUTOR] CAUSE: Incorrect environment value.
2024-11-19 22:33:08.546 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [EXECUTOR] ACTION: Please refer to backend log for more details.
2024-11-19 22:33:08.546 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [EXECUTOR] WARNING: Failed to obtain environment value $GAUSSLOG!
2024-11-19 22:33:08.546 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [EXECUTOR] DETAIL: N/A
2024-11-19 22:33:08.546 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [EXECUTOR] CAUSE: Incorrect environment value.
2024-11-19 22:33:08.546 [unknown] [unknown] localhost 139981560232704 0[0:0#0] 0 [EXECUTOR] ACTION: Please refer to backend log for more details.
[2024-11-19 22:33:08.973][128291][][gs_ctl]: done
[2024-11-19 22:33:08.973][128291][][gs_ctl]: server started (/home/test/openGauss/data)
start datanode success.
[2024-11-19 22:33:14.046][128345][][gs_ctl]: gs_ctl query ,datadir is /home/test/openGauss/data
HA state:
local_role : Normal
static_connections : 0
db_state : Normal
detail_information : Normal
Senders info:
No information
Receiver info:
No information
info:run cmd 'source /home/test/.bashrc' to make the environment variables take effect.
[test@localhost openGauss]$ 这里我看到有failed信息打印,也有warn信息打印。
3.3 检查是否安装成功
执行查看进程是否已经在机器中运行,分为 2 步骤,执行命令:ps ux | grep gaussdb 和 gs_ctl query -D /opt/data 。
[test@localhost openGauss]$ ps ux | grep gaussdb
test 128295 0.6 2.6 2520176 215568 ? Ssl 22:33 0:00 /home/test/openGauss/install/bin/gaussdb -D /home/test/openGauss/data
test 128376 0.0 0.0 112732 980 pts/0 S+ 22:35 0:00 grep --color=auto gaussdb
[test@localhost openGauss]$
[test@localhost data]$ gs_ctl query -D /home/test/openGauss/data
[2024-11-19 22:55:20.810][128741][][gs_ctl]: gs_ctl query ,datadir is /home/test/openGauss/data
HA state:
local_role : Normal
static_connections : 0
db_state : Normal
detail_information : Normal
Senders info:
No information
Receiver info:
No information
[test@localhost data]$ 注意⚠️:这里需要注意一点,我在执行安装后,最后的安装文件在 /home/test/openGauss/data 下面找到了 *.pid 文件,我一开始一直以为是在 gs_ctl query -D /data/software/openGauss/data/single_node 和 gs_ctl query -D /data/software/openGauss/data/ 下面无法找到。这里希望能给予一个准确的答案。
安装过程出现问题
1 the maximum number of SEMMNI is not correct, please change it
[test@localhost openGauss]$ echo "OpenGuass@2024" | sh ./install.sh --mode single -D ~/openGauss/data -R ~/openGauss/install --start
the maximum number of SEMMNI is not correct, please change it (/proc/sys/kernel/sem)), ensure that the value of fourth sem is greater than 320.
[test@localhost openGauss]$
问题处理方法官方也给出了解答,请参考,修改配置即可:https://docs.opengauss.org/zh/docs/latest/docs/InstallationGuide/%E5%8D%95%E8%8A%82%E7%82%B9%E5%AE%89%E8%A3%85.html
2 init primary datanode failed
[test@localhost openGauss]$ echo "OpenGuass@2024" | sh ./install.sh --mode single -D ~/openGauss/data -R ~/openGauss/install --start
info:[check install env and os setting success.]
info:[set GAUSSDATA environment variables success.]
export PATH=/home/test/openGauss/install/bin:/home/jdk8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin >> /home/test/.bashrc
export LD_LIBRARY_PATH=/home/test/openGauss/install/lib:/data/software/openGauss/dependency: >> /home/test/.bashrc
info:[set GAUSSHOME environment variables success.]
kernel: CentOS
bin file: openGauss-Lite-6.0.0-CentOS7-x86_64.bin
verification file: openGauss-Lite-6.0.0-CentOS7-x86_64.sha256
info:[begin decompressing binary files success.]
mode_type is single and mode is -Z single_node, node name is opengauss
info:cmd : gs_initdb -D /home/test/openGauss/data --nodename=opengauss -w ******
gs_initdb: invalid locale settings; check LANG and LC_* environment variables
[init primary datanode failed.]
[test@localhost openGauss]$
官方这里也有这个问题的答案,可以参考此处:https://docs.opengauss.org/zh/docs/latest/docs/InstallationGuide/%E4%B8%80%E7%AB%99%E5%BC%8F%E5%AE%89%E8%A3%85%E6%8C%87%E5%8D%97.html
总结
终于安装完了,虽然是简单的版本,但是苦于openGuass文档众多,作为一个小白,只能摸索,大约搞了2h,还好最终都解决了问题(官方的解答还是蛮仔细,这个真得表扬,但是也是众多,查找比较麻烦,这里建议能分门别类给予链接可能更好,就像PostgreSQL官方那种,可以根据版本号就可以查阅,期待中~)
[引用]




