gpt4 book ai didi

postgres-xl - 分布式环境下linux安装postgres-xl

转载 作者:行者123 更新时间:2023-12-01 10:42:22 27 4
gpt4 key购买 nike

我对 postgres-xl 很陌生。我打算将它用于我的应用程序。没有适当的文档可以在分布式模式下下载和安装。请指导我,从哪里下载,安装,配置,centOS 6支持postgres-xl的依赖包是什么,需要启动哪些服务以及如何启动它们,分布式环境的配置更改。在分布式环境中,要启动哪些服务以及如何启动。请指导我。谢谢..!

最佳答案

以下是安装 Postgres-XL 的关键点。详细信息请看https://ruihaijiang.wordpress.com/2015/09/17/postgres-xl-installation-example-on-linux/

1。规划您的主机、IP、端口等。例如,

GTM:
hostname=host1
nodename=gtm
IP=192.168.187.130
port=6666

Coordinator:
hostname=host2
nodename=coord1
IP=192.168.187.131
pooler_port=6668,port=5432

Datanode1:
hostname=host3
nodename=datanode1
IP=192.168.187.132
pooler_port=6669, port=15432

Datanode2:
hostname=host4
nodename=datanode2
IP=192.168.187.133
pooler_port=6670, port=15433

2。编写你的 pgxc_ctl.conf

#user and path
pgxcOwner=postgres
pgxcUser=$pgxcOwner
pgxcInstallDir=/usr/local/pgsql

#gtm and gtmproxy
gtmMasterDir=$HOME/pgxc/nodes/gtm
gtmMasterPort=6666
gtmMasterServer=192.168.187.130
gtmSlave=n

#gtm proxy
gtmProxy=n

#coordinator
coordMasterDir=$HOME/pgxc/nodes/coord
coordNames=(coord1)
coordPorts=(5432)
poolerPorts=(6668)
coordPgHbaEntries=(192.168.187.0/24)
coordMasterServers=(192.168.187.131)
coordMasterDirs=($coordMasterDir/coord1)
coordMaxWALsernder=0
coordMaxWALSenders=($coordMaxWALsernder)
coordSlave=n
coordSpecificExtraConfig=(none none none)
coordSpecificExtraPgHba=(none none none)

#datanode
datanodeNames=(datanode1 datanode2)
datanodePorts=(15432 15433)
datanodePoolerPorts=(6669 6670)
datanodePgHbaEntries=(192.168.187.0/24)
datanodeMasterServers=(192.168.187.132 192.168.187.133)
datanodeMasterDir=$HOME/pgxc/nodes/dn_master
datanodeMasterDirs=($datanodeMasterDir/datanode1 $datanodeMasterDir/datanode2)
datanodeMaxWalSender=0
datanodeMaxWALSenders=($datanodeMaxWalSender $datanodeMaxWalSender)
datanodeSlave=n
primaryDatanode=datanode1

3。配置 ssh 认证,避免为 pgxc_ctl 输入密码

This really spent me a few days.

On host1, generate the authentication key file,
ssh-keygen -t rsa (Just press ENTER for all input values)
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

On host1, upload file authorized_keys to host2, host3 and host3, as following,
scp ~/.ssh/authorized_keys postgres@192.168.187.131:~/.ssh/
scp ~/.ssh/authorized_keys postgres@192.168.187.132:~/.ssh/
scp ~/.ssh/authorized_keys postgres@192.168.187.133:~/.ssh/

On every host, run following commands,
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

On host1, try to connect host2, host3 and host4, make sure no password is needed,
ssh postgres@192.168.187.131
ssh postgres@192.168.187.132
ssh postgres@192.168.187.133

4。运行 pgxc_ctl 配置并启动集群

At host1, run following command:
pgxc_ctl init all

关于postgres-xl - 分布式环境下linux安装postgres-xl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29225743/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com