Linux部署openGauss单机版

Linux部署openGauss单机版
1、官网下载版本,地址:https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.0.0/x86/openGauss-5.0.0-CentOS-64bit.tar.bz2
下载极简版
2、环境准备
(1)修改/etc/selinux/config文件中的“SELINUX”值为“disabled”
打开config文件

vi /etc/selinux/config

修改“SELINUX”的值“disabled”,执行**:wq**保存并退出修改。

SELINUX=disabled

(2)重启生效

reboot

(3) 关闭防火墙

systemctl stop firewalld

查看防火墙状态

systemctl status firewalld

若防火墙状态显示为active (running),则表示防火墙未关闭,请查看原因;
若防火墙状态显示为inactive (dead),则关闭防火墙成功。
在这里插入图片描述
(4)创建普遍用户gauss
*在Linux 中切换为普通用户登录,注意,不能使用root用户进行安装openGauss

groupadd gauss
useradd  -s /bin/bash -d /home/gauss -g gauss gauss
passwd gauss     #设置密码

(5)设置普通用户(gauss)文件句柄数
打开文件/etc/security/limits.conf

vi /etc/security/limits.conf

在文件最下面添加
gauss hard nofile 1000000
gauss soft nofile 1000000
gauss hard nproc 1000000
gauss soft nproc 1000000
(6)使用有root权限的用户执行命令

cat /etc/sysctl.conf
sysctl -w kernel.sem="250 85000 250 330"

2、安装openGauss
(1)创建安装目录

mkdir /usr/local/openGauss

(2)给安装目录赋权限

chmod 777 /usr/local/openGauss

以下使用普遍用户操作
(3)将下载的包上传到/usr/local/openGauss下,解压

tar -jxf openGauss-3.1.1-CentOS-64bit.tar.bz2 -C /usr/local/openGauss

(4)进入解压后目录下的simpleInstall

cd /usr/local/openGauss/simpleInstall

执行install.sh脚本安装openGauss,其中-w后面参数为设置数据库密码

sh install.sh  -w "xxxx" &&source ~/.bashrc

出现这个表示安装成功
在这里插入图片描述
3、使用Navicat连接openGauss
(1)文件 pg_hba.conf 修改

vi /usr/local/openGauss/data/single_node/pg_hba.conf

允许所有网段连接 在IPv4 local connections下添加

host all all 0.0.0.0/0 md5

(2)文件postgresql.conf 修改

vi /usr/local/openGauss/data/single_node/postgresql.conf

# password_encryption_type值设为0,即为md5。 将前面#去掉
# 输入【/】搜索 listen_addresses 变量,将前面#去掉,值修改为*

(3)重启openGauss

cd /usr/local/openGauss/simpleInstall
gs_ctl restart -D $GAUSSHOME/data/single_node -Z single_node

4、创建登录用户

//默认端口号是5432
//如果指定过端口号可以在/usr/local/openGauss/data/single_node/postgresql.conf配置文件查看指定的端口号
gsql -d postgres -p 5432
 
//创建用户testuser并设置密码,必须加分号
openGauss=# CREATE USER testuser WITH PASSWORD "test@pwd";  
 
//设置testuser用户为系统管理员,必须加分号
openGauss=# GRANT ALL PRIVILEGES TO testuser;  
 
//创建数据库。
openGauss=# CREATE DATABASE db_demo OWNER testuser; 
 
//退出postgres数据库 不需要分号
openGauss=# \q   
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值