上一篇的问题还没有解决,继续尝试,试一试openGauss。
想部署一个openGauss,结果发现系统里面预装了~~
[root@PengFei ~]# whereis opengauss
opengauss: /usr/local/opengauss
[root@PengFei ~]# cd /usr/local/opengauss
[root@PengFei opengauss]# ll
total 24
drwxr-xr-x. 2 root root 4096 May 3 22:44 bin
drwxr-xr-x. 4 root root 4096 May 3 22:44 etc
drwxr-xr-x. 4 root root 4096 May 3 22:44 include
drwxr-xr-x. 4 root root 4096 May 3 22:44 lib
drwxr-xr-x. 2 root root 4096 May 3 22:44 script
drwxr-xr-x. 5 root root 4096 Jun 6 2023 share
[root@PengFei opengauss]#
对于企业版、极简版和轻量版也是baidu了区别~~
openGauss 企业版、 极简版 和 轻量版 的主要区别在于功能、性能、部署方式以及适用场景等方面。
1. 功能差异:
o 企业版:功能最为齐全,支持强大的集群管理和监控功能,包括在线扩容、在线备份与恢复、性能调优、分布式事务处理等。适用于大规模、高性能的业务场景。
o 极简版:功能相对简单,注重轻量级和简单易用,适合小型项目或测试环境。它去掉了某些非核心组件,适合资源有限的环境。
o 轻量版:功能进一步简化,精简了安装包大小和内存占用,适用于对数据库性能要求不高、存储空间有限的边缘计算场景,如基层医疗机构的传染病数据初步收集节点。
2. 性能差异:
o 企业版:性能更强,具备更好的并发处理能力和更高的吞吐量,适合处理复杂和高负载的业务。
o 极简版:性能较为有限,适合轻量级应用和测试环境。
o 轻量版:由于功能简化,性能要求更低,适用于边缘计算场景。
3. 部署差异:
o 企业版:支持复杂的部署架构,如多主多备、读写分离等,但部署相对复杂,需要一定的专业知识和经验。
o 极简版:更适合单节点或简单集群的部署,安装配置简单,适合个人开发者或小型项目。
o 轻量版:部署方式简单,主要用于边缘计算场景,安装解压即可使用。
4. 适用场景:
o 企业版:适用于大规模、高性能的业务场景,需要复杂管理和高并发处理能力的企业用户。
o 极简版:适合小型项目、测试环境或资源有限的环境,如小型医疗机构。
已经安装的版本是2.1.0-8
[root@PengFei opt]# rpm -q opengauss
opengauss-2.1.0-8.oe2203.aarch64
[root@PengFei opt]# yum list installed | grep opengauss
opengauss.aarch64 2.1.0-8.oe2203 @update
并且服务是启动的
[root@PengFei opt]# systemctl status opengauss
● opengauss.service - Start openGauss server
Loaded: loaded (/usr/lib/systemd/system/opengauss.service; enabled; vendor preset: disabled)
Active: active (exited) since Mon 2025-05-19 22:10:31 CST; 3 weeks 0 days ago
Main PID: 960 (code=exited, status=0/SUCCESS)
Tasks: 26 (limit: 42430)
Memory: 276.8M
CGroup: /system.slice/opengauss.service
└─ 3498 /usr/local/opengauss/bin/gaussdb -D /var/lib/opengauss/data
May 19 22:10:31 PengFei systemd[1]: Started Start openGauss server.
May 19 22:10:37 PengFei su[2486]: (to opengauss) root on none
May 19 22:10:37 PengFei su[2486]: pam_unix(su-l:session): session opened for user opengauss(uid=1000) by (>
May 19 22:10:41 PengFei su[2486]: pam_unix(su-l:session): session closed for user opengauss
May 19 22:10:41 PengFei autostart.sh[960]: Start openGauss database success.
[root@PengFei opt]#
所以现在就想着对其操作一番:
su - opengauss命令的作用是切换当前用户到opengauss用户。
[root@PengFei ~]# su - opengauss
Last login: Mon Jun 9 22:28:17 CST 2025 on pts/0
Welcome to 5.10.0-60.139.0.166.oe2203.aarch64
System information as of time: Tue Jun 10 06:32:19 PM CST 2025
System load: 1.00
Processes: 248
Memory used: 66.6%
Swap used: 28.1%
Usage On: 10%
IP address: 192.168.90.203
IP address: 192.168.122.1
IP address: 172.17.0.1
Users online: 1
To run a command as administrator(user "root"),use "sudo <command>".
[opengauss@PengFei ~]$
寻找gauss进程
[opengauss@PengFei ~]$ ps ux | grep gauss
opengau+ 3498 86.5 3.6 2048940 245660 ? Sl May19 27245:42 /usr/local/opengauss/bin/gaussdb -D /var/lib/opengauss/data
opengau+ 2279498 0.0 0.0 21716 1928 pts/0 S+ 18:34 0:00 grep --color=auto gauss
[opengauss@PengFei ~]$ ps ux | grep gaussdb
opengau+ 3498 86.5 3.6 2048940 245660 ? Sl May19 27247:26 /usr/local/opengauss/bin/gaussdb -D /var/lib/opengauss/data
opengau+ 2279712 0.0 0.0 21716 1948 pts/0 S+ 18:36 0:00 grep --color=auto gaussdb
[opengauss@PengFei ~]$
编辑postgresql.conf文件,配置数据库
[opengauss@PengFei data]$ vim /var/lib/opengauss/data/postgresql.conf
其中具体的参数意义,可以参照:
https://docs.opengauss.org/zh/docs/2.1.0/docs/Developerguide/%E5%AE%89%E5%85%A8%E5%92%8C%E8%AE%A4%E8%AF%81_postgresql-conf.html
修改连接许可
[opengauss@PengFei data]$ vim pg_hba.conf

重启openGauss服务
[opengauss@PengFei data]$ /usr/local/opengauss/bin/gs_ctl restart
[2025-06-10 19:32:59.128][2284016][][gs_ctl]: gs_ctl restarted ,datadir is /var/lib/opengauss/data
waiting for server to shut down... failed
[2025-06-10 19:33:59.202][2284016][][gs_ctl]: server does not shut down
[2025-06-10 19:33:59.224][2284016][][gs_ctl]: port:7654 already in use. /proc/net/tcp:
sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode
6: 0100007F:1DE6 00000000:0000 0A 00000000:00000000 00:00000000 00000000 1000 0 36050 1 0000000066daa642 100 0 0 10 0
[2025-06-10 19:33:59.225][2284016][][gs_ctl]: CheckPort: popen(command:lsof -i:7654 | grep -E 'COMMAND|LISTEN').
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
gaussdb 3498 opengauss 4u IPv4 36050 0t0 TCP localhost:7654 (LISTEN)
[2025-06-10 19:33:59.318][2284016][][gs_ctl]: port conflict when start server
[2025-06-10 19:33:59.318][2284016][][gs_ctl]: waiting for server to start...
.0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
0 LOG: [Alarm Module]Host Name: PengFei
0 LOG: [Alarm Module]Host IP: 192.168.90.203
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: 55
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.
The core dump path is an invalid directory
2025-06-10 11:33:59.713 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] LOG: when starting as multi_standby mode, we couldn't support data replicaton.
2025-06-10 11:33:59.722 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
2025-06-10 11:33:59.722 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host Name: PengFei
2025-06-10 11:33:59.723 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host IP: 192.168.90.203
2025-06-10 11:33:59.723 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Get ENV GS_CLUSTER_NAME failed!
2025-06-10 11:33:59.724 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 55
2025-06-10 11:33:59.727 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] FATAL: lock file "postmaster.pid" already exists
2025-06-10 11:33:59.727 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] HINT: Is another postmaster (PID 3498) running in data directory "/var/lib/opengauss/data"?
[2025-06-10 19:34:00.320][2284016][][gs_ctl]: waitpid 2284042 failed, exitstatus is 256, ret is 2
[2025-06-10 19:34:00.320][2284016][][gs_ctl]: stopped waiting
[2025-06-10 19:34:00.320][2284016][][gs_ctl]: could not start server
Examine the log output.
可以使用以下命令来查看所有运行的进程:
[opengauss@PengFei data]$ ps aux | grep opengauss
opengau+ 3498 86.6 2.6 1785772 177760 ? Sl May19 27309:55 /usr/local/opengauss/bin/gaussdb -D /var/lib/opengauss/data
root 2279384 0.0 0.0 32004 5136 pts/0 S 18:32 0:00 su - opengauss
opengau+ 2284310 0.0 0.0 21848 1944 pts/0 S+ 19:38 0:00 grep --color=auto opengauss
[opengauss@PengFei data]$
或者查看端口是否被占用:
[opengauss@PengFei data]$ netstat -tulnp | grep 7654
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 127.0.0.1:7654 0.0.0.0:* LISTEN 3498/gaussdb
[opengauss@PengFei data]$
强制关闭进程
[opengauss@PengFei data]$ kill -9 3498
[opengauss@PengFei data]$ ps aux | grep opengauss
root 2279384 0.0 0.0 32004 5136 pts/0 S 18:32 0:00 su - opengauss
opengau+ 2284608 0.0 0.0 21716 1888 pts/0 S+ 19:44 0:00 grep --color=auto opengauss
[opengauss@PengFei data]$
重启openGauss服务
[opengauss@PengFei data]$ /usr/local/opengauss/bin/gs_ctl restart
[2025-06-10 19:45:12.466][2284811][][gs_ctl]: gs_ctl restarted ,datadir is /var/lib/opengauss/data
[2025-06-10 19:45:12.466][2284811][][gs_ctl]: old server process (PID: 3498) seems to be gone
[2025-06-10 19:45:12.466][2284811][][gs_ctl]: starting server anyway
[2025-06-10 19:45:12.467][2284811][][gs_ctl]: waiting for server to start...
.0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
0 LOG: [Alarm Module]Host Name: PengFei
0 LOG: [Alarm Module]Host IP: 192.168.90.203
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: 55
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.
The core dump path is an invalid directory
2025-06-10 11:45:12.504 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: when starting as multi_standby mode, we couldn't support data replicaton.
2025-06-10 11:45:12.505 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
2025-06-10 11:45:12.505 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host Name: PengFei
2025-06-10 11:45:12.506 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host IP: 192.168.90.203
2025-06-10 11:45:12.506 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Get ENV GS_CLUSTER_NAME failed!
2025-06-10 11:45:12.506 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 55
2025-06-10 11:45:12.545 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: loaded library "security_plugin"
2025-06-10 11:45:12.545 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets
2025-06-10 11:45:12.573 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] WARNING: No explicit IP is configured for listen_addresses GUC.
2025-06-10 11:45:12.601 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: InitNuma numaNodeNum: 1 numa_distribute_mode: none inheritThreadPool: 0.
2025-06-10 11:45:12.601 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: reserved memory for backend threads is: 220 MB
2025-06-10 11:45:12.601 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: reserved memory for WAL buffers is: 128 MB
2025-06-10 11:45:12.601 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: Set max backend reserve memory is: 348 MB, max dynamic memory is: 11870 MB
2025-06-10 11:45:12.601 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: shared memory 53 Mbytes, memory context 12218 Mbytes, max process memory 12288 Mbytes
2025-06-10 11:45:12.613 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [CACHE] LOG: set data cache size(12582912)
2025-06-10 11:45:12.614 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [CACHE] LOG: set metadata cache size(4194304)
2025-06-10 11:45:12.644 [unknown] [unknown] localhost 281472567971872 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
2025-06-10 11:45:12.650 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: gaussdb: fsync file "/var/lib/opengauss/data/gaussdb.state.temp" success
2025-06-10 11:45:12.650 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: create gaussdb state file success: db state(STARTING_STATE), server mode(Normal)
2025-06-10 11:45:12.722 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: max_safe_fds = 980, usable_fds = 1000, already_open = 10
The core dump path is an invalid directory
2025-06-10 11:45:12.727 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: the configure file /usr/local/opengauss/etc/gscgroup_opengauss.cfg doesn't exist or the size of configure file has changed. Please create it by root user!
2025-06-10 11:45:12.727 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: Failed to parse cgroup config file.
2025-06-10 11:45:12.728 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] WARNING: Failed to obtain environment value $GAUSSLOG!
2025-06-10 11:45:12.728 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] DETAIL: N/A
2025-06-10 11:45:12.728 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] CAUSE: Incorrect environment value.
2025-06-10 11:45:12.728 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] ACTION: Please refer to backend log for more details.
2025-06-10 11:45:12.730 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] WARNING: Failed to obtain environment value $GAUSSLOG!
2025-06-10 11:45:12.730 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] DETAIL: N/A
2025-06-10 11:45:12.730 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] CAUSE: Incorrect environment value.
2025-06-10 11:45:12.730 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] ACTION: Please refer to backend log for more details.
[2025-06-10 19:45:13.625][2284811][][gs_ctl]: done
[2025-06-10 19:45:13.625][2284811][][gs_ctl]: server started (/var/lib/opengauss/data)
[opengauss@PengFei data]$
[opengauss@PengFei data]$ netstat -tulnp | grep 7654
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:7654 0.0.0.0:* LISTEN 2284812/gaussdb
tcp6 0 0 :::7654 :::* LISTEN 2284812/gaussdb
[opengauss@PengFei data]$ ps aux | grep opengauss
root 2279384 0.0 0.0 32004 5136 pts/0 S 18:32 0:00 su - opengauss
opengau+ 2284812 0.5 4.1 2021296 280892 pts/0 Sl 19:45 0:00 /usr/local/opengauss/bin/gaussdb -D /var/lib/opengauss/data
opengau+ 2284874 0.0 0.0 21716 1928 pts/0 S+ 19:46 0:00 grep --color=auto opengauss
[opengauss@PengFei data]$
[opengauss@PengFei data]$ gslq -d postgres
-bash: gslq: command not found
[opengauss@PengFei data]$ ^C
[opengauss@PengFei data]$ yum install gsl-devel
Error: This command has to be run with superuser privileges (under the root user on most systems).
[opengauss@PengFei data]$ su - root
Password:
su: Permission denied
[opengauss@PengFei data]$ su - root
Password:
su: Permission denied
[opengauss@PengFei data]$
[root@PengFei ~]# yum install gsl-devel
Last metadata expiration check: 0:41:32 ago on Tue 10 Jun 2025 07:11:40 PM CST.
Dependencies resolved.
===========================================================================================================
Package Architecture Version Repository Size
===========================================================================================================
Installing:
gsl-devel aarch64 2.4-9.oe2203 OS 557 k
Installing dependencies:
gsl aarch64 2.4-9.oe2203 OS 842 k
Transaction Summary
===========================================================================================================
Install 2 Packages
Total download size: 1.4 M
Installed size: 4.2 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): gsl-devel-2.4-9.oe2203.aarch64.rpm 795 kB/s | 557 kB 00:00
(2/2): gsl-2.4-9.oe2203.aarch64.rpm 1.1 MB/s | 842 kB 00:00
-----------------------------------------------------------------------------------------------------------
Total 1.7 MB/s | 1.4 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : gsl-2.4-9.oe2203.aarch64 1/2
Running scriptlet: gsl-2.4-9.oe2203.aarch64 1/2
Installing : gsl-devel-2.4-9.oe2203.aarch64 2/2
Running scriptlet: gsl-devel-2.4-9.oe2203.aarch64 2/2
Verifying : gsl-2.4-9.oe2203.aarch64 1/2
Verifying : gsl-devel-2.4-9.oe2203.aarch64 2/2
Installed:
gsl-2.4-9.oe2203.aarch64 gsl-devel-2.4-9.oe2203.aarch64
Complete!
[root@PengFei ~]#
进入postgres数据库
[opengauss@PengFei ~]$ gsql -d postgres -r
gsql ((GaussDB Kernel V500R002C00 build ) compiled at 2023-06-26 21:14:53 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
openGauss=#
查看数据库端口
openGauss=# show port;
ERROR: Please use "ALTER ROLE user_name PASSWORD 'password';" to set the password of user opengauss before other operation!
openGauss=#
修改管理员密码
openGauss=# ALTER USER opengauss IDENTIFIED BY "********";
NOTICE: The encrypted password contains MD5 ciphertext, which is not secure.
ALTER ROLE
openGauss=#
查看端口
openGauss=# show port;
port
------
7654
(1 row)
openGauss=#
创建用户
openGauss=# CREATE USER pantest IDENTIFIED BY "*******";
ERROR: Password must contain at least 8 characters.
openGauss=# CREATE USER pantest IDENTIFIED BY "*********";
NOTICE: The encrypted password contains MD5 ciphertext, which is not secure.
CREATE ROLE
openGauss=#
查询
openGauss=# SELECT * FROM pg_user;
usename | usesysid | usecreatedb | usesuper | usecatupd | userepl | passwd | valbegin | valuntil | r
espool | parent | spacelimit | useconfig | nodegroup | tempspacelimit | spillspacelimit | usemonitoradmi
n | useoperatoradmin | usepolicyadmin
-----------+----------+-------------+----------+-----------+---------+----------+----------+----------+----
----------+--------+------------+-----------+-----------+----------------+-----------------+---------------
--+------------------+----------------
opengauss | 10 | t | t | t | t | ******** | | | def
ault_pool | 0 | | | | | | t
| t | t
pantest | 16385 | f | f | f | f | ******** | | | def
ault_pool | 0 | | | | | | f
| f | f
(2 rows)
openGauss=#
创建成功了
给管理员权限
openGauss=# ALTER USER pantest SYSADMIN;
ALTER ROLE
openGauss=#

退出数据库
openGauss=# \q
[opengauss@PengFei ~]$
注销用户
[opengauss@PengFei ~]$ exit
logout
[root@PengFei ~]#
[root@PengFei ~]# 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@PengFei ~]#
上一篇的问题还没有解决,继续尝试,试一试openGauss。
想部署一个openGauss,结果发现系统里面预装了~~
[root@PengFei ~]# whereis opengauss
opengauss: /usr/local/opengauss
[root@PengFei ~]# cd /usr/local/opengauss
[root@PengFei opengauss]# ll
total 24
drwxr-xr-x. 2 root root 4096 May 3 22:44 bin
drwxr-xr-x. 4 root root 4096 May 3 22:44 etc
drwxr-xr-x. 4 root root 4096 May 3 22:44 include
drwxr-xr-x. 4 root root 4096 May 3 22:44 lib
drwxr-xr-x. 2 root root 4096 May 3 22:44 script
drwxr-xr-x. 5 root root 4096 Jun 6 2023 share
[root@PengFei opengauss]#
对于企业版、极简版和轻量版也是baidu了区别~~
openGauss 企业版、 极简版 和 轻量版 的主要区别在于功能、性能、部署方式以及适用场景等方面。
1. 功能差异:
o 企业版:功能最为齐全,支持强大的集群管理和监控功能,包括在线扩容、在线备份与恢复、性能调优、分布式事务处理等。适用于大规模、高性能的业务场景。
o 极简版:功能相对简单,注重轻量级和简单易用,适合小型项目或测试环境。它去掉了某些非核心组件,适合资源有限的环境。
o 轻量版:功能进一步简化,精简了安装包大小和内存占用,适用于对数据库性能要求不高、存储空间有限的边缘计算场景,如基层医疗机构的传染病数据初步收集节点。
2. 性能差异:
o 企业版:性能更强,具备更好的并发处理能力和更高的吞吐量,适合处理复杂和高负载的业务。
o 极简版:性能较为有限,适合轻量级应用和测试环境。
o 轻量版:由于功能简化,性能要求更低,适用于边缘计算场景。
3. 部署差异:
o 企业版:支持复杂的部署架构,如多主多备、读写分离等,但部署相对复杂,需要一定的专业知识和经验。
o 极简版:更适合单节点或简单集群的部署,安装配置简单,适合个人开发者或小型项目。
o 轻量版:部署方式简单,主要用于边缘计算场景,安装解压即可使用。
4. 适用场景:
o 企业版:适用于大规模、高性能的业务场景,需要复杂管理和高并发处理能力的企业用户。
o 极简版:适合小型项目、测试环境或资源有限的环境,如小型医疗机构。
已经安装的版本是2.1.0-8
[root@PengFei opt]# rpm -q opengauss
opengauss-2.1.0-8.oe2203.aarch64
[root@PengFei opt]# yum list installed | grep opengauss
opengauss.aarch64 2.1.0-8.oe2203 @update
并且服务是启动的
[root@PengFei opt]# systemctl status opengauss
● opengauss.service - Start openGauss server
Loaded: loaded (/usr/lib/systemd/system/opengauss.service; enabled; vendor preset: disabled)
Active: active (exited) since Mon 2025-05-19 22:10:31 CST; 3 weeks 0 days ago
Main PID: 960 (code=exited, status=0/SUCCESS)
Tasks: 26 (limit: 42430)
Memory: 276.8M
CGroup: /system.slice/opengauss.service
└─ 3498 /usr/local/opengauss/bin/gaussdb -D /var/lib/opengauss/data
May 19 22:10:31 PengFei systemd[1]: Started Start openGauss server.
May 19 22:10:37 PengFei su[2486]: (to opengauss) root on none
May 19 22:10:37 PengFei su[2486]: pam_unix(su-l:session): session opened for user opengauss(uid=1000) by (>
May 19 22:10:41 PengFei su[2486]: pam_unix(su-l:session): session closed for user opengauss
May 19 22:10:41 PengFei autostart.sh[960]: Start openGauss database success.
[root@PengFei opt]#
所以现在就想着对其操作一番:
su - opengauss命令的作用是切换当前用户到opengauss用户。
[root@PengFei ~]# su - opengauss
Last login: Mon Jun 9 22:28:17 CST 2025 on pts/0
Welcome to 5.10.0-60.139.0.166.oe2203.aarch64
System information as of time: Tue Jun 10 06:32:19 PM CST 2025
System load: 1.00
Processes: 248
Memory used: 66.6%
Swap used: 28.1%
Usage On: 10%
IP address: 192.168.90.203
IP address: 192.168.122.1
IP address: 172.17.0.1
Users online: 1
To run a command as administrator(user "root"),use "sudo <command>".
[opengauss@PengFei ~]$
寻找gauss进程
[opengauss@PengFei ~]$ ps ux | grep gauss
opengau+ 3498 86.5 3.6 2048940 245660 ? Sl May19 27245:42 /usr/local/opengauss/bin/gaussdb -D /var/lib/opengauss/data
opengau+ 2279498 0.0 0.0 21716 1928 pts/0 S+ 18:34 0:00 grep --color=auto gauss
[opengauss@PengFei ~]$ ps ux | grep gaussdb
opengau+ 3498 86.5 3.6 2048940 245660 ? Sl May19 27247:26 /usr/local/opengauss/bin/gaussdb -D /var/lib/opengauss/data
opengau+ 2279712 0.0 0.0 21716 1948 pts/0 S+ 18:36 0:00 grep --color=auto gaussdb
[opengauss@PengFei ~]$
编辑postgresql.conf文件,配置数据库
[opengauss@PengFei data]$ vim /var/lib/opengauss/data/postgresql.conf
其中具体的参数意义,可以参照:
https://docs.opengauss.org/zh/docs/2.1.0/docs/Developerguide/%E5%AE%89%E5%85%A8%E5%92%8C%E8%AE%A4%E8%AF%81_postgresql-conf.html
修改连接许可
[opengauss@PengFei data]$ vim pg_hba.conf
重启openGauss服务
[opengauss@PengFei data]$ /usr/local/opengauss/bin/gs_ctl restart
[2025-06-10 19:32:59.128][2284016][][gs_ctl]: gs_ctl restarted ,datadir is /var/lib/opengauss/data
waiting for server to shut down... failed
[2025-06-10 19:33:59.202][2284016][][gs_ctl]: server does not shut down
[2025-06-10 19:33:59.224][2284016][][gs_ctl]: port:7654 already in use. /proc/net/tcp:
sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode
6: 0100007F:1DE6 00000000:0000 0A 00000000:00000000 00:00000000 00000000 1000 0 36050 1 0000000066daa642 100 0 0 10 0
[2025-06-10 19:33:59.225][2284016][][gs_ctl]: CheckPort: popen(command:lsof -i:7654 | grep -E 'COMMAND|LISTEN').
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
gaussdb 3498 opengauss 4u IPv4 36050 0t0 TCP localhost:7654 (LISTEN)
[2025-06-10 19:33:59.318][2284016][][gs_ctl]: port conflict when start server
[2025-06-10 19:33:59.318][2284016][][gs_ctl]: waiting for server to start...
.0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
0 LOG: [Alarm Module]Host Name: PengFei
0 LOG: [Alarm Module]Host IP: 192.168.90.203
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: 55
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.
The core dump path is an invalid directory
2025-06-10 11:33:59.713 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] LOG: when starting as multi_standby mode, we couldn't support data replicaton.
2025-06-10 11:33:59.722 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
2025-06-10 11:33:59.722 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host Name: PengFei
2025-06-10 11:33:59.723 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host IP: 192.168.90.203
2025-06-10 11:33:59.723 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Get ENV GS_CLUSTER_NAME failed!
2025-06-10 11:33:59.724 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 55
2025-06-10 11:33:59.727 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] FATAL: lock file "postmaster.pid" already exists
2025-06-10 11:33:59.727 [unknown] [unknown] localhost 281472591601696 0[0:0#0] 0 [BACKEND] HINT: Is another postmaster (PID 3498) running in data directory "/var/lib/opengauss/data"?
[2025-06-10 19:34:00.320][2284016][][gs_ctl]: waitpid 2284042 failed, exitstatus is 256, ret is 2
[2025-06-10 19:34:00.320][2284016][][gs_ctl]: stopped waiting
[2025-06-10 19:34:00.320][2284016][][gs_ctl]: could not start server
Examine the log output.
可以使用以下命令来查看所有运行的进程:
[opengauss@PengFei data]$ ps aux | grep opengauss
opengau+ 3498 86.6 2.6 1785772 177760 ? Sl May19 27309:55 /usr/local/opengauss/bin/gaussdb -D /var/lib/opengauss/data
root 2279384 0.0 0.0 32004 5136 pts/0 S 18:32 0:00 su - opengauss
opengau+ 2284310 0.0 0.0 21848 1944 pts/0 S+ 19:38 0:00 grep --color=auto opengauss
[opengauss@PengFei data]$
或者查看端口是否被占用:
[opengauss@PengFei data]$ netstat -tulnp | grep 7654
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 127.0.0.1:7654 0.0.0.0:* LISTEN 3498/gaussdb
[opengauss@PengFei data]$
强制关闭进程
[opengauss@PengFei data]$ kill -9 3498
[opengauss@PengFei data]$ ps aux | grep opengauss
root 2279384 0.0 0.0 32004 5136 pts/0 S 18:32 0:00 su - opengauss
opengau+ 2284608 0.0 0.0 21716 1888 pts/0 S+ 19:44 0:00 grep --color=auto opengauss
[opengauss@PengFei data]$
重启openGauss服务
[opengauss@PengFei data]$ /usr/local/opengauss/bin/gs_ctl restart
[2025-06-10 19:45:12.466][2284811][][gs_ctl]: gs_ctl restarted ,datadir is /var/lib/opengauss/data
[2025-06-10 19:45:12.466][2284811][][gs_ctl]: old server process (PID: 3498) seems to be gone
[2025-06-10 19:45:12.466][2284811][][gs_ctl]: starting server anyway
[2025-06-10 19:45:12.467][2284811][][gs_ctl]: waiting for server to start...
.0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
0 LOG: [Alarm Module]Host Name: PengFei
0 LOG: [Alarm Module]Host IP: 192.168.90.203
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: 55
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.
The core dump path is an invalid directory
2025-06-10 11:45:12.504 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: when starting as multi_standby mode, we couldn't support data replicaton.
2025-06-10 11:45:12.505 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
2025-06-10 11:45:12.505 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host Name: PengFei
2025-06-10 11:45:12.506 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host IP: 192.168.90.203
2025-06-10 11:45:12.506 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Get ENV GS_CLUSTER_NAME failed!
2025-06-10 11:45:12.506 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 55
2025-06-10 11:45:12.545 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: loaded library "security_plugin"
2025-06-10 11:45:12.545 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets
2025-06-10 11:45:12.573 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] WARNING: No explicit IP is configured for listen_addresses GUC.
2025-06-10 11:45:12.601 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: InitNuma numaNodeNum: 1 numa_distribute_mode: none inheritThreadPool: 0.
2025-06-10 11:45:12.601 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: reserved memory for backend threads is: 220 MB
2025-06-10 11:45:12.601 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: reserved memory for WAL buffers is: 128 MB
2025-06-10 11:45:12.601 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: Set max backend reserve memory is: 348 MB, max dynamic memory is: 11870 MB
2025-06-10 11:45:12.601 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: shared memory 53 Mbytes, memory context 12218 Mbytes, max process memory 12288 Mbytes
2025-06-10 11:45:12.613 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [CACHE] LOG: set data cache size(12582912)
2025-06-10 11:45:12.614 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [CACHE] LOG: set metadata cache size(4194304)
2025-06-10 11:45:12.644 [unknown] [unknown] localhost 281472567971872 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
2025-06-10 11:45:12.650 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: gaussdb: fsync file "/var/lib/opengauss/data/gaussdb.state.temp" success
2025-06-10 11:45:12.650 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: create gaussdb state file success: db state(STARTING_STATE), server mode(Normal)
2025-06-10 11:45:12.722 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: max_safe_fds = 980, usable_fds = 1000, already_open = 10
The core dump path is an invalid directory
2025-06-10 11:45:12.727 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: the configure file /usr/local/opengauss/etc/gscgroup_opengauss.cfg doesn't exist or the size of configure file has changed. Please create it by root user!
2025-06-10 11:45:12.727 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [BACKEND] LOG: Failed to parse cgroup config file.
2025-06-10 11:45:12.728 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] WARNING: Failed to obtain environment value $GAUSSLOG!
2025-06-10 11:45:12.728 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] DETAIL: N/A
2025-06-10 11:45:12.728 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] CAUSE: Incorrect environment value.
2025-06-10 11:45:12.728 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] ACTION: Please refer to backend log for more details.
2025-06-10 11:45:12.730 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] WARNING: Failed to obtain environment value $GAUSSLOG!
2025-06-10 11:45:12.730 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] DETAIL: N/A
2025-06-10 11:45:12.730 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] CAUSE: Incorrect environment value.
2025-06-10 11:45:12.730 [unknown] [unknown] localhost 281472567971872 0[0:0#0] 0 [EXECUTOR] ACTION: Please refer to backend log for more details.
[2025-06-10 19:45:13.625][2284811][][gs_ctl]: done
[2025-06-10 19:45:13.625][2284811][][gs_ctl]: server started (/var/lib/opengauss/data)
[opengauss@PengFei data]$
[opengauss@PengFei data]$ netstat -tulnp | grep 7654
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:7654 0.0.0.0:* LISTEN 2284812/gaussdb
tcp6 0 0 :::7654 :::* LISTEN 2284812/gaussdb
[opengauss@PengFei data]$ ps aux | grep opengauss
root 2279384 0.0 0.0 32004 5136 pts/0 S 18:32 0:00 su - opengauss
opengau+ 2284812 0.5 4.1 2021296 280892 pts/0 Sl 19:45 0:00 /usr/local/opengauss/bin/gaussdb -D /var/lib/opengauss/data
opengau+ 2284874 0.0 0.0 21716 1928 pts/0 S+ 19:46 0:00 grep --color=auto opengauss
[opengauss@PengFei data]$
[opengauss@PengFei data]$ gslq -d postgres
-bash: gslq: command not found
[opengauss@PengFei data]$ ^C
[opengauss@PengFei data]$ yum install gsl-devel
Error: This command has to be run with superuser privileges (under the root user on most systems).
[opengauss@PengFei data]$ su - root
Password:
su: Permission denied
[opengauss@PengFei data]$ su - root
Password:
su: Permission denied
[opengauss@PengFei data]$
[root@PengFei ~]# yum install gsl-devel
Last metadata expiration check: 0:41:32 ago on Tue 10 Jun 2025 07:11:40 PM CST.
Dependencies resolved.
===========================================================================================================
Package Architecture Version Repository Size
===========================================================================================================
Installing:
gsl-devel aarch64 2.4-9.oe2203 OS 557 k
Installing dependencies:
gsl aarch64 2.4-9.oe2203 OS 842 k
Transaction Summary
===========================================================================================================
Install 2 Packages
Total download size: 1.4 M
Installed size: 4.2 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): gsl-devel-2.4-9.oe2203.aarch64.rpm 795 kB/s | 557 kB 00:00
(2/2): gsl-2.4-9.oe2203.aarch64.rpm 1.1 MB/s | 842 kB 00:00
-----------------------------------------------------------------------------------------------------------
Total 1.7 MB/s | 1.4 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : gsl-2.4-9.oe2203.aarch64 1/2
Running scriptlet: gsl-2.4-9.oe2203.aarch64 1/2
Installing : gsl-devel-2.4-9.oe2203.aarch64 2/2
Running scriptlet: gsl-devel-2.4-9.oe2203.aarch64 2/2
Verifying : gsl-2.4-9.oe2203.aarch64 1/2
Verifying : gsl-devel-2.4-9.oe2203.aarch64 2/2
Installed:
gsl-2.4-9.oe2203.aarch64 gsl-devel-2.4-9.oe2203.aarch64
Complete!
[root@PengFei ~]#
进入postgres数据库
[opengauss@PengFei ~]$ gsql -d postgres -r
gsql ((GaussDB Kernel V500R002C00 build ) compiled at 2023-06-26 21:14:53 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
openGauss=#
查看数据库端口
openGauss=# show port;
ERROR: Please use "ALTER ROLE user_name PASSWORD 'password';" to set the password of user opengauss before other operation!
openGauss=#
修改管理员密码
openGauss=# ALTER USER opengauss IDENTIFIED BY "********";
NOTICE: The encrypted password contains MD5 ciphertext, which is not secure.
ALTER ROLE
openGauss=#
查看端口
openGauss=# show port;
port
------
7654
(1 row)
openGauss=#
创建用户
openGauss=# CREATE USER pantest IDENTIFIED BY "*******";
ERROR: Password must contain at least 8 characters.
openGauss=# CREATE USER pantest IDENTIFIED BY "*********";
NOTICE: The encrypted password contains MD5 ciphertext, which is not secure.
CREATE ROLE
openGauss=#
查询
openGauss=# SELECT * FROM pg_user;
usename | usesysid | usecreatedb | usesuper | usecatupd | userepl | passwd | valbegin | valuntil | r
espool | parent | spacelimit | useconfig | nodegroup | tempspacelimit | spillspacelimit | usemonitoradmi
n | useoperatoradmin | usepolicyadmin
-----------+----------+-------------+----------+-----------+---------+----------+----------+----------+----
----------+--------+------------+-----------+-----------+----------------+-----------------+---------------
--+------------------+----------------
opengauss | 10 | t | t | t | t | ******** | | | def
ault_pool | 0 | | | | | | t
| t | t
pantest | 16385 | f | f | f | f | ******** | | | def
ault_pool | 0 | | | | | | f
| f | f
(2 rows)
openGauss=#
创建成功了
给管理员权限
openGauss=# ALTER USER pantest SYSADMIN;
ALTER ROLE
openGauss=#
退出数据库
openGauss=# \q
[opengauss@PengFei ~]$
注销用户
[opengauss@PengFei ~]$ exit
logout
[root@PengFei ~]#
[root@PengFei ~]# 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@PengFei ~]#