openGauss-2.1.0部署文档
1.从openGauss开源社区下载对应平台的安装包。
通过https://opengauss.org/zh/download/登录openGauss开源社区,选择2.1.0版本对应平台极简版安装包。
2.解压安装包
tar -jxf openGauss-x.x.x-openEuler-64bit.tar.bz2 -C /opt/software/openGauss/
errer:
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
# 安装bzip2
yum -y install bzip2
3.软硬件环境要求
见官网
4.修改系统配置
4.1关闭防火墙
systemctl status firewalld
systemctl disable firewalld.service
systemctl stop firewalld.service
4.2关闭selinux
vim /etc/selinux/config
SELINUX=disabled
# 重启
reboot
4.3设置字符集参数
vim /etc/profile
export LANG=XXX”(XXX为Unicode编码)
4.4同步时区
4.5关闭swap交换内存(可选)
swapoff -a
4.6关闭RemoveIPC
vim /etc/systemd/logind.conf
RemoveIPC=no
vim /usr/lib/systemd/system/systemd-logind.service
RemoveIPC=no
# 重新加载配置参数。
systemctl daemon-reload
systemctl restart systemd-logind
# 检查修改是否生效。
loginctl show-session | grep RemoveIPC
systemctl show systemd-logind | grep RemoveIPC
5.创建用户、用户组文件夹
6.修改文件打开数
vi /etc/security/limits.conf
# 在最后添加
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
# 验证
ulimit -n
7.安装
cd /opt/software/openGauss/simpleInstall
sh install.sh -p 端口号 -w 密码
8.管理数据库
# 连接数据库
gsql -d 库 -p 端口号 -U 用户
# 启动
gs_ctl -D /opt/software/openGauss/data/single_node start
# 关闭
gs_ctl -D /opt/software/openGauss/data/single_node stop
# 重启
gs_ctl -D /opt/software/openGauss/data/single_node restart
# 创建用户
create user 新用户名 with password "你的密码"; 2790hhxL
# 导出数据
su omm
./gs_dump -f /docker-entrypoint-initdb.d/ficc.sql -p 5432 sigma_dev -n ficc -F p
# 导入数据
\i /xxx/ficc.sql
9.配置允许远程连接
cd /opt/software/openGauss/data/single_node
vi pg_hba.conf
# 允许所有网段连接 在IPv4 local connections下添加
host all all 0.0.0.0/0 md5
vi postgresql.conf
# 将前面#去掉,改为*
listen_addresses = '*'
# 允许navicat连接设置,password_encryption_type改为0
password_encryption_type = 1
# 重启
gs_ctl -D /opt/software/openGauss/data/single_node restart