当前位置: 首页 > news >正文

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

安装依赖包:

yum -y install libaio-devel flex bison ncurses-devel glibc-devel patch redhat-lsb-core readline-devel openssl-devel sqlite-devel libnsl

安装插件:

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

创建用户

groupadd dbgroup
useradd -g dbgroup omm
passwd omm

创建数据目录

mkdir -p /opt/software/openGauss

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

配置环境变量

vi /etc/profile

添加以下配置:


export GAUSSHOME=/opt/software/openGauss/bin
export LD_LIBRARY_PATH=$GAUSSHOME/lib::$LD_LIBRARY_PATH
export PATH=$GAUSSHOME/bin:$PATH

使配置文件生效:

source /etc/profile

解压并初始化

tar -jxf openGauss-3.0.0-CentOS-64bit.tar.bz2 -C /opt/software/openGauss

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

chown -R omm:dbgroup /opt/software/openGauss

安装、初始化openGauss:

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 是否正常运行:

ps ux | grep gaussdb
gs_ctl query -D /opt/software/openGauss/data/single_node

修改配置

cd /opt/software/openGauss/data/single_node/
cp pg_hba.conf pg_hba.conf.cp
cp postgresql.conf postgresql.conf.cp
vi postgresql.conf

listen_addresses = ‘*’
ssl = off
password_encryption_type = 1

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

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
--开放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 数据库:

 

 

http://www.lryc.cn/news/135993.html

相关文章:

  • NOIP真题讲解 传球游戏 接水问题
  • 《论文阅读18》 SSD: Single Shot MultiBox Detector
  • NOIP2016普及组第四题 魔法阵
  • uniapp-滑块验证组件wo-slider
  • NPM 管理组织成员
  • 设计模式(3)抽象工厂模式
  • 【C++】早绑定、析构与多态 | 一道关于多态的选择题记录
  • mac下安装tomcat
  • 【小梦C嘎嘎——启航篇】string常用接口的模拟实现
  • 【Jenkins】持续集成部署学习
  • Redis数据结构之List
  • SpringCloud Alibaba实战和源码(7)Skywalking
  • MySQL索引可能失效之or、is null、is not null、不等于(!=,<>)、联合索引
  • 无人机电力巡检:探索电力设施维护的新模式
  • ethers.js1:ethers的安装和使用
  • 小程序中的页面配置和网络数据请求
  • 使用ImageMagick实现多张图片拼接为gif(多线程版)
  • 解释 RESTful API,以及如何使用它构建 web 应用程序。
  • 远程端口转发 实践 如何将物理机某一端口的服务转发到vps上,使得外网能访问到
  • 【uniapp 监听键盘弹起与收回】
  • 【Unity】如何制作小地图
  • 基于IMX6ULLmini的linux裸机开发系列八:按键处理实验
  • 数据结构好题总结
  • Java串口开发
  • Python nohup 启动python脚本,后台没有日志
  • 完美解决微信小程序使用复选框van-checkbox无法选中
  • IDEA报错:类文件具有错误的版本 61.0,应为52.0
  • Linux 挂载局域网内共享目录
  • FFmpeg解码32k大分辨率出现如下错误:Picture size 32768x32768 is invalid
  • EasyExcel+POI制作带有有效性校验及下拉联动的Excel模板