你好,我是一名数据库爱好者。最近试图搭建opengauss的DCF集群,用于学习,但总是需要问题,希望能得到指导。
软件环境:
构建方式:手动编译
系统版本:centos-7.6
仓库:
opengauss-server: v3.1.0
openGauss-third_party: v3.1.0
硬件环境:
三台服务器:
192.168.4.3 192.168.4.4 192.168.4.5
部署步骤:
1. 初始化数据目录:
gs_initdb --no-locale -D /data/hubin/openGauss-server/mppdb_temp_install/data --nodename=datanode1 -w password@123 -c2. 按照如下示例修改配置文件
192.168.4.3
listen_addresses = '192.168.4.3'
port = 15432
enable_dcf = on
dcf_node_id = 1
dcf_ssl=off
dcf_data_path = '/data/hubin/openGauss-server/mppdb_temp_install/data/dcf_data'
dcf_log_path= '/data/hubin/openGauss-server/mppdb_temp_install/data/dcf_log'
dcf_config='[{"stream_id":1,"node_id":1,"ip":"192.168.4.3","port":21000,"role":"LEADER"},{"stream_id":1,"node_id":2,"ip":"192.168.4.4","port":21000,"role":"FOLLOWER"},{"stream_id":1,"node_id":3,"ip":"192.168.4.5","port":21000,"role":"FOLLOWER"}]'
192.168.4.4
listen_addresses = '192.168.4.4'
port = 15432
enable_dcf = on
dcf_node_id = 2
dcf_ssl=off
dcf_data_path = '/data/hubin/openGauss-server/mppdb_temp_install/data/dcf_data'
dcf_log_path= '/data/hubin/openGauss-server/mppdb_temp_install/data/dcf_log'
dcf_config='[{"stream_id":1,"node_id":1,"ip":"192.168.4.3","port":21000,"role":"LEADER"},{"stream_id":1,"node_id":2,"ip":"192.168.4.4","port":21000,"role":"FOLLOWER"},{"stream_id":1,"node_id":3,"ip":"192.168.4.5","port":21000,"role":"FOLLOWER"}]
192.168.4.5
listen_addresses = '192.168.4.5'
port = 15432
enable_dcf = on
dcf_node_id = 3
dcf_ssl=off
dcf_data_path = '/data/hubin/openGauss-server/mppdb_temp_install/data/dcf_data'
dcf_log_path= '/data/hubin/openGauss-server/mppdb_temp_install/data/dcf_log'
dcf_config='[{"stream_id":1,"node_id":1,"ip":"192.168.4.3","port":21000,"role":"LEADER"},{"stream_id":1,"node_id":2,"ip":"192.168.4.4","port":21000,"role":"FOLLOWER"},{"stream_id":1,"node_id":3,"ip":"192.168.4.5","port":21000,"role":"FOLLOWER"}]'
3. 分别修改pg_hba.conf,在末尾添加:
host all all 192.168.4.3/32 trust
host all all 192.168.4.4/32 trust
host all all 192.168.4.5/32 trust
4. 分别执行如下命令启动实例:
gs_ctl start -D /data/hubin/openGauss-server/mppdb_temp_install/data -M standby
5. 观察结果:192.168.4.3
192.168.4.4
192.168.4.5
发现未选出leader,2个follower显示Disconnected
其中一个follower的pg_log日志:
dcf_log日志: