1. openEuler操作系统
https://www.openeuler.org/zh/download 选一个下载

| systemctl stop firewalld.service |
| systemctl disable firewalld.service |
修改文件 /etc/selinux/config
修改后执行setenforce 0
临时关闭,或者一会儿找时间重启一下服务。
修改/etc/pam.d/su
文件,注释掉下边两行。
| #auth sufficient pam_wheel.so trust use_uid |
| #auth required pam_wheel.so use_uid |
2. openGauss数据库
2.1 系统自带库
如果你刚才安装操作系统的时候选择了安装openGauss数据库,这里直接拿来用就可以了。
2.1.1 允许所有地址访问端口
这里配置文件实际就是postgres的,甚至连名字都没有改。
- 修改配置文件
/var/lib/opengauss/data/postgresql.conf
| listen_addresses = '*' |
| local_bind_address = '0.0.0.0' |
| password_encryption_type = 0 |
- 修改
/var/lib/opengauss/data/pg_hba.conf
文件
| host all all 0.0.0.0/0 md5 |
| systemctl restart opengauss.service |
| [root@localhost ~]# netstat -ntlp |
| Active Internet connections (only servers) |
| Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name |
| tcp 0 0 0.0.0.0:7655 0.0.0.0:* LISTEN 2224/gaussdb |
| tcp 0 0 0.0.0.0:7654 0.0.0.0:* LISTEN 2224/gaussdb |
| tcp6 0 0 :::7655 :::* LISTEN 2224/gaussdb |
| tcp6 0 0 :::7654 :::* LISTEN 2224/gaussdb |
| |
2.1.2 创建远程登录用户
sql用postgres的sql命令即可。
| ALTER ROLE openGauss PASSWORD 'liubei@161'; |
| CREATE USER liubei WITH PASSWORD 'liubei@161'; |
| ALTER USER liubei sysadmin; |
| gsql -d postgres -W 'liubei@161' |
| gsql -d postgres -U liubei -W 'liubei@161' |
- 远程登录测试

2.2 安装5.0 版本
2.2.1 下载
注意选择架构和操作系统

2.2.2 安装
程序禁止root用户安装
| [liubei@localhost openGauss-5.0.0]$ ll |
| 总用量 40 |
| drwxr-x--- 2 liubei liubei 4096 3月 29 03:46 bin |
| drwx------ 3 liubei liubei 4096 6月 20 19:07 data |
| drwxr-x--- 3 liubei liubei 4096 3月 29 03:46 etc |
| drwxr-x--- 3 liubei liubei 4096 3月 29 03:46 include |
| drwxr-x--- 4 liubei liubei 4096 3月 29 03:46 jre |
| drwxr-x--- 5 liubei liubei 4096 3月 29 03:46 lib |
| drwx------ 2 liubei liubei 4096 6月 20 19:07 logs |
| drwxr-x--- 5 liubei liubei 4096 3月 29 03:46 share |
| drwxr-x--- 2 liubei liubei 4096 6月 20 19:08 simpleInstall |
| -rw-r----- 1 liubei liubei 32 3月 29 03:46 version.cfg |
| [liubei@localhost openGauss-5.0.0]$ cd simpleInstall |
| [liubei@localhost simpleInstall]$ ll |
| 总用量 64 |
| -rw-r----- 1 liubei liubei 10827 3月 29 03:46 finance.sql |
| -rw-r----- 1 liubei liubei 13009 3月 29 03:46 install.sh |
| -rw-r--r-- 1 liubei liubei 4489 6月 20 19:08 load.log |
| -rw-r----- 1 liubei liubei 5056 3月 29 03:46 README.md |
| -rw-r----- 1 liubei liubei 19713 3月 29 03:46 school.sql |
| [liubei@localhost simpleInstall]$ |
| |
| [liubei@localhost simpleInstall]$ sh install.sh -w liubei@161 |
输出如下:
| [step 1]: check parameter |
| [step 2]: check install env and os setting |
| [step 3]: change_gausshome_owner |
| [step 4]: set environment variables |
| |
| [step 6]: init datanode |
| The files belonging to this database system will be owned by user "liubei". |
| This user must also own the server process. |
| |
| The database cluster will be initialized with locale "en_US.UTF-8". |
| The default database encoding has accordingly been set to "UTF8". |
| The default text search configuration will be set to "english". |
| |
| creating directory /home/liubei/openGauss-5.0.0/data/single_node ... 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/liubei/openGauss-5.0.0/data/single_node/base/1 ... The core dump path is an invalid directory |
| 2023-06-20 19:07:42.215 [unknown] [unknown] localhost 140505899286464 0[0:0#0] [BACKEND] WARNING: macAddr is 21076/3325712, sysidentifier is 1381236786/3205528920, randomNum is 1041071448 |
| 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 foreign-data wrapper for MOT access ... 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 |
| ...... |
| Success. You can now start the database server of single node using: |
| |
| gaussdb -D /home/liubei/openGauss-5.0.0/data/single_node --single_node |
| or |
| gs_ctl start -D /home/liubei/openGauss-5.0.0/data/single_node -Z single_node -l logfile |
| |
| [step 7]: start datanode |
| [2023-06-20 19:07:56.190][15116][][gs_ctl]: gs_ctl started,datadir is /home/liubei/openGauss-5.0.0/data/single_node |
| [2023-06-20 19:07:56.217][15116][][gs_ctl]: waiting for server to start... |
| .0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env. |
| ...... |
从上边输出我们可以知道启动/停止命令,以后切换到liubei
用户执行:
| gs_ctl start|stop|restart -D $GAUSSHOME/data/single_node -Z single_node |
按2.1 系统自带库
操作即可。
2.2.3 测试
按2.1 系统自带库
操作即可。

| dfceb252-4643-42bd-9d0f-e75594d598b9 |
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 【.NET】调用本地 Deepseek 模型
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
2022-06-25 06-其他用法