thanks for your help. I failed to build a Postgres-XL cluster. My gtm.confg :
listen_addresses = '0.0.0.0'
port = 6668
at 10.80.19.47. My gtm_proxy.confg:
listen_addresses = '0.0.0.0'
port = 6666
gtm_host = '10.80.19.47'
gtm_port = 6668
after start gtm and gtm_proxy ,i show net information use 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)
Then i configure datanode like:
listen_addresses = '0.0.0.0'
port = 5432
pooler_port = 20002
gtm_host = '127.0.0.1'
gtm_port = 6666
and coordinator like:
listen_addresses = '0.0.0.0'
port = 3456
pooler_port = 20003
gtm_host = '127.0.0.1'
gtm_port = 6666
others are default ,then i start datanode with :
/usr/postgres-xl-9.2/bin/postgres --datanode -D /data1/pgsql/data &
start coordinator with:
/usr/postgres-xl-9.2/bin/postgres --coordinator -D /data1/pgsql/coordinator &
when i connect to Postgres-XL use coordinator with :
psql -h 127.0.0.1 -p 3456 postgres;
when i want to create a database with:
create database test;
but failed,it shows :
No Datanode defined in cluster
You need to define at least 1 Datanode with CREATE NODE.
then i check the cluster with :
psql -h 127.0.0.1 -p 3456 postgres -c "select * from pgxc_node order by 1";
it shows just one node like:
node_name | node_type | node_port | node_host | nodeis_primary | nodeis_preferred | node_id
-------------------+-----------+-----------+-----------+----------------+------------------+-----------
coordinator_node2 | C | 5432 | localhost | f | f | 738118815
and i connect to port 5432 it shows the similar information like:
node_name | node_type | node_port | node_host | nodeis_primary | nodeis_preferred | node_id
------------+-----------+-----------+-----------+----------------+------------------+------------
data_node2 | C | 5432 | localhost | f | f | -923817565
what wrong with my Configuration? Thanks all.
您需要定义datanode这样的东西。
./psql -c "CREATE NODE datanode1 WITH (TYPE = 'datanode', PORT = 7777)" postgres -p 3456 -h 127.0.0.1
I'm answering this question a year after. However, I'd suggest you to use pgxc_ctl command line tool as suggested by the Postgres XL developers themselves. It will keep you away from the hectic tasks of manually configuring the cluster.
You can refer to the official documentation of Postgres XL for this. After you successfully installed pgxc_ctl command line tool, type in
prepare config minimal
in order to generate a basic configuration file to configure the cluster. Edit your changes in pgxc_ctl/pgxc_ctl.conf accordingly. Type in exit
and finally you can initialize all the clusters if your configuration is okay. For this, type in
pgxc_ctl init all
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.