欢迎来到魔幻小生的博客

CentOS7安装openGauss数据库企业版

准备工作

下载地址:https://opengauss.org/zh/download/

去官网下载对应安装包

image

将安装包放在/opt/software/openGauss目录下,并解压

cd /opt/software/openGauss
tar -zxvf openGauss-6.0.0-RC1-CentOS-64bit-all.tar.gz
tar -zxvf openGauss-6.0.0-RC1-CentOS-64bit-om.tar.gz

一站式安装

通过以下命令产生XML配置文件并检查安装环境

cd /opt/software/openGauss/script
./gs_preinstall -U omm -G dbgroup --one-stop-install --sep-env-file=ENVFILE

image

image

修改安装目录的权限

chmod 755 -R /opt/software/
chown omm:dbgrp -R /opt/software/

切换至omm用户安装数据库

su - omm
cd /opt/software/openGauss/script
source ENVFILE(若为环境变量分离的模式)
./gs_install -X /opt/software/openGauss/script/base_utils/template/cluster.xml

image

验证是否安装成功,Normal即为成功

image

可以把/opt/software/openGauss/script/ENVFILE全放到环境变量里

远程连接数据库

修改/opt/openGauss/install/data/dn1/postgresql.conf,改为*

image

修改/opt/openGauss/install/data/dn1/pg_hba.conf,添加红字标注的那行

image

修改会话超时时间(防止远程连接超时退出)

修改/opt/openGauss/install/data/dn1/postgresql.conf,改为0

image

重启数据库即可远程连接

gs_om -t stop
gs_om -t start

简单使用

[omm@localhost ~]$ gsql -d postgres -p 15000
openGauss=# CREATE USER joe WITH PASSWORD "xxxxxxxxx";
openGauss=# GRANT ALL PRIVILEGES TO joe;
openGauss=# CREATE DATABASE db_tpcc OWNER joe;
openGauss=# \c db_tpcc
db_tpcc=# \i xxx.sql

修改序列初始值

select setval('seq_logsn',1234); # 下个值为1235

修改序列缓存

alter sequence seq_logsn cache 1;

posted @   魔幻小生  阅读(116)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 解答了困扰我五年的技术问题。时代确实变了!
· PPT革命!DeepSeek+Kimi=N小时工作5分钟完成?
· What?废柴, 还在本地部署DeepSeek吗?Are you kidding?
· DeepSeek企业级部署实战指南:从服务器选型到Dify私有化落地
· 程序员转型AI:行业分析
点击右上角即可分享
微信分享提示