谢谢你的帮助。我未能构建 Postgres-XL 集群。我的 gtm.confg :
listen_addresses = '0.0.0.0'
port = 6668
在 10.80.19.47。我的 gtm_proxy.confg:
listen_addresses = '0.0.0.0'
port = 6666
gtm_host = '10.80.19.47'
gtm_port = 6668
启动 gtm 和 gtm_proxy 后,我使用lsof -i显示网络信息:
gtm 11730 postgres 6u IPv4 355914 0t0 TCP 10.80.19.47:ircu-4->10.80.19.46:44017 (ESTABLISHED
gtm 11730 postgres 7u IPv4 355915 0t0 TCP 10.80.19.47:ircu-4->10.80.19.46:44018 (ESTABLISHED)
gtm 11730 postgres 8u IPv4 355916 0t0 TCP 10.80.19.47:ircu-4->10.80.19.46:44019 (ESTABLISHED)
然后我像这样配置datanode:
listen_addresses = '0.0.0.0'
port = 5432
pooler_port = 20002
gtm_host = '127.0.0.1'
gtm_port = 6666
和协调员,例如:
listen_addresses = '0.0.0.0'
port = 3456
pooler_port = 20003
gtm_host = '127.0.0.1'
gtm_port = 6666
其他是默认的,然后我启动datanode:
/usr/postgres-xl-9.2/bin/postgres --datanode -D /data1/pgsql/data &
启动协调器:
/usr/postgres-xl-9.2/bin/postgres --coordinator -D /data1/pgsql/coordinator &
当我连接到 Postgres-XL 时,使用协调器:
psql -h 127.0.0.1 -p 3456 postgres;
当我想创建一个数据库时:
create database test;
但失败了,它显示:
No Datanode defined in cluster
You need to define at least 1 Datanode with CREATE NODE.
然后我检查集群:
psql -h 127.0.0.1 -p 3456 postgres -c "select * from pgxc_node order by 1";
它只显示一个节点,例如:
node_name | node_type | node_port | node_host | nodeis_primary | nodeis_preferred | node_id
-------------------+-----------+-----------+-----------+----------------+------------------+-----------
coordinator_node2 | C | 5432 | localhost | f | f | 738118815
我连接到端口 5432它显示类似的信息,如:
node_name | node_type | node_port | node_host | nodeis_primary | nodeis_preferred | node_id
------------+-----------+-----------+-----------+----------------+------------------+------------
data_node2 | C | 5432 | localhost | f | f | -923817565
我的配置有什么问题?谢谢大家。