<ROOT>
<CLUSTER>
<PARAM name="clusterName" value="test"/>
<PARAM name="nodeNames" value="node1_hostname"/>
<PARAM name="gaussdbAppPath" value="/home/opengauss/app"/>
<PARAM name="gaussdbLogPath" value="/home/opengauss/log/omm"/>
<PARAM name="tmpMppdbPath" value="/home/opengauss/tmp"/>
<PARAM name="gaussdbToolPath" value="/home/opengauss/install/om"/>
<PARAM name="corePath" value="/home/opengauss/corefile"/>
<PARAM name="backIp1s" value="192.xxx.xxx.xxx"/>
CLUSTER>
<DEVICELIST>
<DEVICE sn="node1_hostname">
<PARAM name="name" value="node1_hostname"/>
<PARAM name="azName" value="AZ1"/>
<PARAM name="azPriority" value="1"/>
<PARAM name="backIp1" value="192.xxx.xxx.xxx"/>
<PARAM name="sshIp1" value="192.xxx.xxx.xxx"/>
<PARAM name="dataNum" value="1"/>
<PARAM name="dataPortBase" value="5432"/>
<PARAM name="dataNode1" value="/home/opengauss/install/data/dn"/>
<PARAM name="dataNode1_syncNum" value="0"/>
DEVICE>
DEVICELIST>
ROOT>
安装bzip2
创建db用户组、db用户
把软件要安装的目录以及安装包解压目录所有权限都给db用户
cd /opt/software/openGauss
tar -zxvf openGauss-x.x.x-openEuler-64bit-all.tar.gz
tar -zxvf openGauss-x.x.x-openEuler-64bit-om.tar.gz
cd /opt/software/openGauss/script
# cluster_config.xml就是刚刚那个配置文件
./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml
gs_install -X /opt/software/openGauss/cluster_config.xml
gs_om -t start
gs_om -t stop && gs_om -t start
# 默认创建者omm,
gsql -d postgres -p 15401
gsql -d test -p 15401 -U test
SHOW password_encryption_type;
password_encryption_type设置为0时,表示采用md5方式对密码加密。md5为不安全的加密算法,不建议使用。password_encryption_type设置为1时,表示采用sha256和md5方式对密码加密。其中包含md5为不安全的加密算法,不建议使用,。password_encryption_type设置为2时,表示采用sha256方式对密码加密,为默认配置。为了使用开源pgsql的驱动器连接,我还是建议使用password_encryption_type=1,使用默认配置将连接不上。
gs_guc reload -N all -I all -c "password_encryption_type=1";
注意:创建用户之前先设置加密算法
# 创建用户并授权
CREATE USER test IDENTIFIED BY 'test@123';
GRANT ALL ON TABLESPACE TEST_TABLE_SPACE TO test;
GRANT ALL ON DATABASE test TO test;
GRANT ALL ON SCHEMA test TO test;
\c dbname -- 切换数据库
\c -- 查看当前数据库
select current_database(); -- 查看当前数据库
CREATE SCHEMA test; -- 创建 schema
GRANT ALL ON SCHEMA test TO test; -- 授权schema
DROP USER test; --删除用户
ALTER USER test PASSWORD 'test@123' -- 修改密码
# 查看已开启的监听ip
gs_guc check -Z coordinator -I all -c "listen_addresses"
#修改监听ip命令
gs_guc set -I all -Z coordinator -c "listen_addresses='localhost,192.xxx.xxx.xxx' "
#或修改 postgresql.conf
vi /home/software/openGauss/install/data/dn/postgresql.conf
#开启远程连接ip命令
gs_guc set -N all -I all -h "host all omm 192.xxx.xxx.xxx/32 md5"
# 开启所有ip/网关
gs_guc set -N all -I all -h "host all all 0.0.0.0/0 md5"
# 或者直接编辑pg_hba.conf文件。
vi /home/software/openGauss/install/data/dn/pg_hba.conf
远程连接必须创建一个非软件安装的默认管理员用户,否则连接不上