Centos 7 安装系列(8):openGauss 3.0.0

安装依赖包:

bash 复制代码
yum -y install libaio-devel flex bison ncurses-devel glibc-devel patch redhat-lsb-core readline-devel openssl-devel sqlite-devel libnsl

安装插件:

bash 复制代码
yum install -y bzip2 net-tools

为什么要安装这两个?

安装bzip2 是因为openGauss 的压缩包比较特殊,需要用这个插件才能解压;安装net-tools 是因为在openGauss 初始化中会用到相应的命令。事先在这里安装好,后面就不用再操心这些了。

官方文档中提及了一个安装过程中的错误,实际中也会遇到,故先在这里坐下相应的配置:

sysctl -w kernel.sem="250 85000 250 330" 

关闭防火墙

systemctl stop firewalld.service

setenforce 0

创建用户

bash 复制代码
groupadd dbgroup
useradd -g dbgroup omm
passwd omm

创建数据目录

bash 复制代码
mkdir -p /opt/software/openGauss

具体目录可以根据个人喜好设置,不必追求一致。

配置环境变量

bash 复制代码
vi /etc/profile

添加以下配置:

bash 复制代码
export GAUSSHOME=/opt/software/openGauss/bin
export LD_LIBRARY_PATH=$GAUSSHOME/lib::$LD_LIBRARY_PATH
export PATH=$GAUSSHOME/bin:$PATH

使配置文件生效:

source /etc/profile

解压并初始化

bash 复制代码
tar -jxf openGauss-3.0.0-CentOS-64bit.tar.bz2 -C /opt/software/openGauss

修改目录所有者,因为/opt/software/openGauss 文件夹是用root 用户创建的,故所有者为root,在openGauss 初始化时会因为omm 用户权限不足导致失败,故需要事先修改该文件夹及其子文件夹的所有者为omm 。

bash 复制代码
chown -R omm:dbgroup /opt/software/openGauss

安装、初始化openGauss:

bash 复制代码
cd /opt/software/openGauss/simpleInstall
su omm
sh install.sh  -w "123qweASD~" &&source ~/.bashrc
yes

bash: ulimit: open files: cannot modify limit: Operation not permitted

初始化脚本执行成功后,查看openGauss 是否正常运行:

bash 复制代码
ps ux | grep gaussdb
gs_ctl query -D /opt/software/openGauss/data/single_node

修改配置

bash 复制代码
cd /opt/software/openGauss/data/single_node/
cp pg_hba.conf pg_hba.conf.cp
cp postgresql.conf postgresql.conf.cp
vi postgresql.conf
bash 复制代码
listen_addresses = '*'
ssl = off
password_encryption_type = 1

为什么要设置password_encryption_type = 1 ?因为navicat 连接openGauss 的时候需要的密码是openGauss 使用md5 加密的。

bash 复制代码
vi pg_hba.conf
host all all 0.0.0.0/0 sha256
host all all 0.0.0.0/0 md5

数据库重启

gs_ctl stop -D /opt/software/openGauss/data/single_node
gs_ctl start -D /opt/software/openGauss/data/single_node

创建openGauss新账号

openGauss 禁止使用omm用户进行远程连接:

进入openGauss 数据库:

gsql -d postgres

新建账号test ,密码为 Gauss_234,赋予全部权限:

CREATE USER test PASSWORD 'Gauss_234'; 
GRANT ALL PRIVILEGES TO  test;
\q
bash 复制代码
--开放5432端口

systemctl start firewalld 
firewall-cmd --add-port=5432/tcp --zone=public --permanent
firewall-cmd --reload
--查看开放端口列表:
firewall-cmd --zone=public --list-ports
--停止: 
systemctl stop firewalld

DBeaver使用 PostgreSQL 连接登录openGauss 数据库:

相关推荐
热爱嵌入式的小许17 分钟前
Linux基础项目开发1:量产工具——显示系统
linux·运维·服务器·韦东山量产工具
韩楚风4 小时前
【linux 多进程并发】linux进程状态与生命周期各阶段转换,进程状态查看分析,助力高性能优化
linux·服务器·性能优化·架构·gnu
陈苏同学4 小时前
4. 将pycharm本地项目同步到(Linux)服务器上——深度学习·科研实践·从0到1
linux·服务器·ide·人工智能·python·深度学习·pycharm
Ambition_LAO4 小时前
解决:进入 WSL(Windows Subsystem for Linux)以及将 PyCharm 2024 连接到 WSL
linux·pycharm
Pythonliu74 小时前
茴香豆 + Qwen-7B-Chat-Int8
linux·运维·服务器
你疯了抱抱我5 小时前
【RockyLinux 9.4】安装 NVIDIA 驱动,改变分辨率,避坑版本。(CentOS 系列也能用)
linux·运维·centos
追风赶月、5 小时前
【Linux】进程地址空间(初步了解)
linux
栎栎学编程5 小时前
Linux中环境变量
linux
挥剑决浮云 -5 小时前
Linux 之 安装软件、GCC编译器、Linux 操作系统基础
linux·服务器·c语言·c++·经验分享·笔记
小O_好好学6 小时前
CentOS 7文件系统
linux·运维·centos