|
From: Neil M. <nm...@xu...> - 2012-06-22 12:47:00
|
Can anyone point out where I am going wrong here ? Here is a complete log of what i've done to setup , error at the end: Data/Coordinator machines: ========================== node1: ====== rm -fr /opt/postgres/data* mkdir -p /opt/postgres/data_coordinator1 mkdir -p /opt/postgres/data_datanode1 chown postgres: /opt/postgres/data_* su - postgres initdb -D /opt/postgres/data_coordinator1 --nodename coordinator1 initdb -D /opt/postgres/data_datanode1 --nodename datanode1 #configure /opt/postgres/data_coordinator1/postgres.conf with GTM server #configure /opt/postgres/data_datanode1/postgres.conf with GTM server postgres -X -p 15432 -D /opt/postgres/data_datanode1 >>logfile 2>&1 & postgres -C -D /opt/postgres/data_coordinator1 >>logfile 2>&1 & node2: ====== rm -fr /opt/postgres/data* mkdir -p /opt/postgres/data_coordinator2 mkdir -p /opt/postgres/data_datanode2 chown postgres: /opt/postgres/data_* su - postgres initdb -D /opt/postgres/data_coordinator2 --nodename coordinator2 initdb -D /opt/postgres/data_datanode2 --nodename datanode2 #configure /opt/postgres/data_coordinator2/postgres.conf with GTM server #configure /opt/postgres/data_datanode2/postgres.conf with GTM server postgres -X -p 15433 -D /opt/postgres/data_datanode2 >>logfile 2>&1 & postgres -C -D /opt/postgres/data_coordinator2 >>logfile 2>&1 & each coordinator node: ====================== postgres -C -D /opt/postgres/data_coordinator1 >>logfile 2>&1 & tail -f log GTM machine: ============= rm -fr /opt/postgres/data* mkdir -p /opt/postgres/data_gtm chown postgres: /opt/postgres/data* su - postgres initgtm -D /opt/postgres/data_gtm -Z gtm gtm -D /opt/postgres/data_gtm >logfile 2>&1 & Registering Nodes: (all datanodes ??? has been done on both, output below) ================== psql -c "CREATE NODE datanode1 WITH (TYPE = 'datanode', PORT = 15432)" postgres psql -c "CREATE NODE datanode2 WITH (TYPE = 'datanode', PORT = 15433)" postgres psql -c "SELECT pgxc_pool_reload()" postgres select oid,node_name from pgxc_node; #output node1: postgres=# select oid,node_name from pgxc_node; oid | node_name -------+-------------- 11129 | coordinator1 16384 | datanode1 16385 | datanode2 (3 rows) node2: [postgres@las1-app015 ~]$ psql -c "select oid,node_name from pgxc_node;" postgres oid | node_name -------+-------------- 11129 | coordinator2 16384 | datanode1 16385 | datanode2 (3 rows) Creating DB's : =============== [postgres@las1-app014 ~]$ createdb test createdb: database creation failed: ERROR: Failed to get pooled connections |
|
From: Abbas B. <abb...@en...> - 2012-06-22 13:06:59
|
You have 2 data nodes and 2 coordinators in the cluster. In this case you need to create coordinator1 on coordinator2 and coordinator2 on coordinator1. You need to add some thing similar to these queries when creating nodes on each of the coordinators. On coordinator1 CREATE NODE coordinator2 WITH (HOST = 'IP_OF_coordinator2_HERE', type = 'coordinator', PORT = 5432); and On coordinator2 CREATE NODE coordinator1 WITH (HOST = 'IP_OF_coordinator1_HERE', type = 'coordinator', PORT = 5432); Thanks. On Fri, Jun 22, 2012 at 5:30 PM, Neil Mooney <nm...@xu...> wrote: > Can anyone point out where I am going wrong here ? > > Here is a complete log of what i've done to setup , error at the end: > > Data/Coordinator machines: > ========================== > > node1: > ====== > > rm -fr /opt/postgres/data* > > mkdir -p /opt/postgres/data_coordinator1 > mkdir -p /opt/postgres/data_datanode1 > > chown postgres: /opt/postgres/data_* > > su - postgres > > initdb -D /opt/postgres/data_coordinator1 --nodename coordinator1 > initdb -D /opt/postgres/data_datanode1 --nodename datanode1 > > #configure /opt/postgres/data_coordinator1/postgres.conf with GTM server > #configure /opt/postgres/data_datanode1/postgres.conf with GTM server > > > postgres -X -p 15432 -D /opt/postgres/data_datanode1 >>logfile 2>&1 & > postgres -C -D /opt/postgres/data_coordinator1 >>logfile 2>&1 & > > node2: > ====== > > rm -fr /opt/postgres/data* > > mkdir -p /opt/postgres/data_coordinator2 > mkdir -p /opt/postgres/data_datanode2 > > chown postgres: /opt/postgres/data_* > > su - postgres > > initdb -D /opt/postgres/data_coordinator2 --nodename coordinator2 > initdb -D /opt/postgres/data_datanode2 --nodename datanode2 > > #configure /opt/postgres/data_coordinator2/postgres.conf with GTM server > #configure /opt/postgres/data_datanode2/postgres.conf with GTM server > > postgres -X -p 15433 -D /opt/postgres/data_datanode2 >>logfile 2>&1 & > postgres -C -D /opt/postgres/data_coordinator2 >>logfile 2>&1 & > > each coordinator node: > ====================== > > postgres -C -D /opt/postgres/data_coordinator1 >>logfile 2>&1 & > > > tail -f log > > GTM machine: > ============= > > rm -fr /opt/postgres/data* > > mkdir -p /opt/postgres/data_gtm > > chown postgres: /opt/postgres/data* > > su - postgres > > initgtm -D /opt/postgres/data_gtm -Z gtm > gtm -D /opt/postgres/data_gtm >logfile 2>&1 & > > Registering Nodes: (all datanodes ??? has been done on both, output below) > ================== > > psql -c "CREATE NODE datanode1 WITH (TYPE = 'datanode', PORT = 15432)" > postgres > psql -c "CREATE NODE datanode2 WITH (TYPE = 'datanode', PORT = 15433)" > postgres > psql -c "SELECT pgxc_pool_reload()" postgres > select oid,node_name from pgxc_node; > > #output > > node1: > postgres=# select oid,node_name from pgxc_node; > oid | node_name > -------+-------------- > 11129 | coordinator1 > 16384 | datanode1 > 16385 | datanode2 > (3 rows) > > > node2: > [postgres@las1-app015 ~]$ psql -c "select oid,node_name from pgxc_node;" > postgres > oid | node_name > -------+-------------- > 11129 | coordinator2 > 16384 | datanode1 > 16385 | datanode2 > (3 rows) > > > > > Creating DB's : > =============== > > [postgres@las1-app014 ~]$ createdb test > createdb: database creation failed: ERROR: Failed to get pooled > connections > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Postgres-xc-general mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postgres-xc-general > -- -- Abbas Architect EnterpriseDB Corporation The Enterprise PostgreSQL Company Phone: 92-334-5100153 Website: www.enterprisedb.com EnterpriseDB Blog: http://blogs.enterprisedb.com/ Follow us on Twitter: http://www.twitter.com/enterprisedb This e-mail message (and any attachment) is intended for the use of the individual or entity to whom it is addressed. This message contains information from EnterpriseDB Corporation that may be privileged, confidential, or exempt from disclosure under applicable law. If you are not the intended recipient or authorized to receive this for the intended recipient, any use, dissemination, distribution, retention, archiving, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and delete this message. |
|
From: Neil M. <nm...@xu...> - 2012-06-22 14:06:52
|
Thanks to Magorn and Abbass for their input. I followed your advice RE: creating new coordinator nodes in the db with the following query on both nodes: psql -c "DROP NODE coordinator1" postgres psql -c "DROP NODE coordinator2" postgres psql -c "CREATE NODE coordinator1 WITH (HOST = '10.152.14.24', type = 'coordinator', PORT = 5432);" postgres psql -c "CREATE NODE coordinator2 WITH (HOST = '10.152.14.25', type = 'coordinator', PORT = 5432);" postgres psql -c "SELECT pgxc_pool_reload()" postgres I am still seeing a problem, logfile indicates connectivity between the two data nodes, telnet-ing the port seems to work ok. [postgres@las1-app015 ~]$ cat logfile LOG: database system was interrupted; last known up at 2012-06-22 13:31:58 UTC LOG: database system was not properly shut down; automatic recovery in progress LOG: record with zero length at 0/1776A90 LOG: redo is not required LOG: autovacuum launcher started LOG: database system is ready to accept connections LOG: database system was interrupted; last known up at 2012-06-22 13:32:20 UTC LOG: database system was not properly shut down; automatic recovery in progress LOG: redo starts at 0/177F970 LOG: record with zero length at 0/177FB60 LOG: redo done at 0/177FB20 LOG: last completed transaction was at log time 2012-06-22 13:34:59.977913+00 LOG: autovacuum launcher started LOG: database system is ready to accept connections LOG: incomplete startup packet LOG: incomplete startup packet LOG: failed to connect to Datanode WARNING: can not connect to node 16384 LOG: failed to acquire connections STATEMENT: CREATE DATABASE test; ERROR: Failed to get pooled connections STATEMENT: CREATE DATABASE test; [postgres@las1-app015 ~]$ psql -c "select oid,node_name from pgxc_node;" postgres oid | node_name -------+-------------- 11129 | coordinator2 16384 | datanode1 16385 | datanode2 24583 | coordinator1 (4 rows) [postgres@las1-app015 ~]$ telnet las1-app014 15432 Trying 10.152.14.24... Connected to las1-app014. Escape character is '^]'. ^] telnet> quit Connection closed. |
|
From: Abbas B. <abb...@en...> - 2012-06-22 16:38:47
|
I just spotted another mistake in data node creation. You are creating both the data nodes on both the coordinators with the default IP i.e. 127.0.0.1 which is not true for datanode1 when created on coordinator2. Similarly it is not true for datanode2 on coordinator1. It would be good idea to create both data nodes by explicitly specifying the IP addresses. So the queries should look something like this. psql -c "CREATE NODE datanode1 WITH (HOST = 'IP_OF_datanode1', TYPE = 'datanode', PORT = 15432)" postgres psql -c "CREATE NODE datanode2 WITH (HOST = 'IP_OF_datanode2', TYPE = 'datanode', PORT = 15433)" postgres psql -c "CREATE NODE coordinator1 WITH (HOST = '10.152.14.24', type = 'coordinator', PORT = 5432);" postgres psql -c "CREATE NODE coordinator2 WITH (HOST = '10.152.14.25', type = 'coordinator', PORT = 5432);" postgres If this does not work and gives the same error please provide the output of psql -c "select oid,* from pgxc_node;" postgres by running on the coordinator2. On Fri, Jun 22, 2012 at 7:06 PM, Neil Mooney <nm...@xu...> wrote: > Thanks to Magorn and Abbass for their input. > > I followed your advice RE: creating new coordinator nodes in the db with > the following query on both nodes: > > psql -c "DROP NODE coordinator1" postgres > psql -c "DROP NODE coordinator2" postgres > psql -c "CREATE NODE coordinator1 WITH (HOST = '10.152.14.24', type = > 'coordinator', PORT = 5432);" postgres > psql -c "CREATE NODE coordinator2 WITH (HOST = '10.152.14.25', type = > 'coordinator', PORT = 5432);" postgres > psql -c "SELECT pgxc_pool_reload()" postgres > > I am still seeing a problem, logfile indicates connectivity between the > two data nodes, telnet-ing the port seems to work ok. > > [postgres@las1-app015 ~]$ cat logfile > > LOG: database system was interrupted; last known up at 2012-06-22 > 13:31:58 UTC > LOG: database system was not properly shut down; automatic recovery in > progress > LOG: record with zero length at 0/1776A90 > LOG: redo is not required > LOG: autovacuum launcher started > LOG: database system is ready to accept connections > LOG: database system was interrupted; last known up at 2012-06-22 > 13:32:20 UTC > LOG: database system was not properly shut down; automatic recovery in > progress > LOG: redo starts at 0/177F970 > LOG: record with zero length at 0/177FB60 > LOG: redo done at 0/177FB20 > LOG: last completed transaction was at log time 2012-06-22 > 13:34:59.977913+00 > LOG: autovacuum launcher started > LOG: database system is ready to accept connections > LOG: incomplete startup packet > LOG: incomplete startup packet > LOG: failed to connect to Datanode > WARNING: can not connect to node 16384 > LOG: failed to acquire connections > STATEMENT: CREATE DATABASE test; > > ERROR: Failed to get pooled connections > STATEMENT: CREATE DATABASE test; > > [postgres@las1-app015 ~]$ psql -c "select oid,node_name from pgxc_node;" > postgres > oid | node_name > -------+-------------- > 11129 | coordinator2 > 16384 | datanode1 > 16385 | datanode2 > 24583 | coordinator1 > (4 rows) > > [postgres@las1-app015 ~]$ telnet las1-app014 15432 > Trying 10.152.14.24... > Connected to las1-app014. > Escape character is '^]'. > ^] > > telnet> quit > Connection closed. > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Postgres-xc-general mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postgres-xc-general > -- -- Abbas Architect EnterpriseDB Corporation The Enterprise PostgreSQL Company Phone: 92-334-5100153 Website: www.enterprisedb.com EnterpriseDB Blog: http://blogs.enterprisedb.com/ Follow us on Twitter: http://www.twitter.com/enterprisedb This e-mail message (and any attachment) is intended for the use of the individual or entity to whom it is addressed. This message contains information from EnterpriseDB Corporation that may be privileged, confidential, or exempt from disclosure under applicable law. If you are not the intended recipient or authorized to receive this for the intended recipient, any use, dissemination, distribution, retention, archiving, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and delete this message. |
|
From: Michael P. <mic...@gm...> - 2012-06-25 01:07:27
|
I may be stepping someone's else answer... But here is some input. On Fri, Jun 22, 2012 at 9:30 PM, Neil Mooney <nm...@xu...> wrote: > Can anyone point out where I am going wrong here ? > > Here is a complete log of what i've done to setup , error at the end: > > Data/Coordinator machines: > ========================== > > node1: > ====== > > rm -fr /opt/postgres/data* > > mkdir -p /opt/postgres/data_coordinator1 > mkdir -p /opt/postgres/data_datanode1 > > chown postgres: /opt/postgres/data_* > > su - postgres > > initdb -D /opt/postgres/data_coordinator1 --nodename coordinator1 > initdb -D /opt/postgres/data_datanode1 --nodename datanode1 > > #configure /opt/postgres/data_coordinator1/postgres.conf with GTM server > #configure /opt/postgres/data_datanode1/postgres.conf with GTM server > > > postgres -X -p 15432 -D /opt/postgres/data_datanode1 >>logfile 2>&1 & > postgres -C -D /opt/postgres/data_coordinator1 >>logfile 2>&1 & > > node2: > ====== > > rm -fr /opt/postgres/data* > > mkdir -p /opt/postgres/data_coordinator2 > mkdir -p /opt/postgres/data_datanode2 > > chown postgres: /opt/postgres/data_* > > su - postgres > > initdb -D /opt/postgres/data_coordinator2 --nodename coordinator2 > initdb -D /opt/postgres/data_datanode2 --nodename datanode2 > > #configure /opt/postgres/data_coordinator2/postgres.conf with GTM server > #configure /opt/postgres/data_datanode2/postgres.conf with GTM server > > postgres -X -p 15433 -D /opt/postgres/data_datanode2 >>logfile 2>&1 & > postgres -C -D /opt/postgres/data_coordinator2 >>logfile 2>&1 & > > each coordinator node: > ====================== > > postgres -C -D /opt/postgres/data_coordinator1 >>logfile 2>&1 & > You already started your nodes at an earlier step, so this is not necessary. An error would be returned telling that node is already started like postgres. > GTM machine: > ============= > > rm -fr /opt/postgres/data* > > mkdir -p /opt/postgres/data_gtm > > chown postgres: /opt/postgres/data* > > su - postgres > > initgtm -D /opt/postgres/data_gtm -Z gtm > gtm -D /opt/postgres/data_gtm >logfile 2>&1 & > You should start GTM *before* starting your 2 Coordinators and your 2 Datanodes. Postgres-XC nodes need to register on GTM at start-up or they cannot start. > > Registering Nodes: (all datanodes ??? has been done on both, output below) > ================== > > psql -c "CREATE NODE datanode1 WITH (TYPE = 'datanode', PORT = 15432)" > postgres > psql -c "CREATE NODE datanode2 WITH (TYPE = 'datanode', PORT = 15433)" > postgres > psql -c "SELECT pgxc_pool_reload()" postgres > select oid,node_name from pgxc_node; > Here you have to launch CREATE NODE and pgxc_pool_reload on *each Coordinator*. When you start up a node this node knows only about itself, so you need to register all the other Coordinators and Datanodes. Registering other Coordinators on a Coordinator is mandatory or you won't be able to synchronize DDL among Coordinators, this could result in a table being created on a Coordinator and not another. So, in your case, launch the following queries: - On Coordinator 1: CREATE NODE datanode1 WITH (TYPE = 'datanode', PORT = 15432, HOST = '$node1_ip'); CREATE NODE datanode2 WITH (TYPE = 'datanode', PORT = 15433, HOST = '$node2_ip'); CREATE NODE coordinator2 WITH (TYPE = 'coordinator', PORT = 5432, HOST = '$node2_ip'); - On Coordinator 2: CREATE NODE datanode1 WITH (TYPE = 'datanode', PORT = 15432, HOST = '$node1_ip'); CREATE NODE datanode2 WITH (TYPE = 'datanode', PORT = 15433, HOST = '$node2_ip'); CREATE NODE coordinator1 WITH (TYPE = 'coordinator', PORT = 5432, HOST = '$node2_ip'); In the case of node1, datanode1 and coordinator1 are on the same node. So you can replace $node1_ip with localhost or 127.0.0.1 when defining datanode1 for coordinator1. Same for node node2, datanode2 and coordinator2 are on the same node. So you can replace $node2_ip with localhost or 127.0.0.1 when defining datanode2 for coordinator2. > #output > > node1: > postgres=# select oid,node_name from pgxc_node; > oid | node_name > -------+-------------- > 11129 | coordinator1 > 16384 | datanode1 > 16385 | datanode2 > (3 rows) > This output is incorrect. Coordinator 1 is not aware of Coordinator 2. Coordinator 1 also thinks that datanode2 is on node1 as you did not define an IP to redirect correctly. > > > node2: > [postgres@las1-app015 ~]$ psql -c "select oid,node_name from pgxc_node;" > postgres > oid | node_name > -------+-------------- > 11129 | coordinator2 > 16384 | datanode1 > 16385 | datanode2 > (3 rows) > Same here, Coordinator 1 is not aware of Coordinator2. Coordinator2 thinks that datanode1 is on the same server, which is not the case as it looks that coordinator2/datanode2 and coordinator1/datanode1 are grouped on 2 different nodes. > > Creating DB's : > =============== > > [postgres@las1-app014 ~]$ createdb test > createdb: database creation failed: ERROR: Failed to get pooled > connections > Here I guess you are connecting to coordinator1. This error happens because coordinator1 cannot connect to datanode2, as it is not located on local server but on server node2. Regards, -- Michael Paquier http://michael.otacoo.com |
|
From: Michael P. <mic...@gm...> - 2012-06-25 01:10:08
|
On Mon, Jun 25, 2012 at 10:07 AM, Michael Paquier <mic...@gm... > wrote: > I may be stepping someone's else answer... But here is some input. > > On Fri, Jun 22, 2012 at 9:30 PM, Neil Mooney <nm...@xu...> wrote: > >> Can anyone point out where I am going wrong here ? >> >> Here is a complete log of what i've done to setup , error at the end: >> >> Data/Coordinator machines: >> ========================== >> >> node1: >> ====== >> >> rm -fr /opt/postgres/data* >> >> mkdir -p /opt/postgres/data_coordinator1 >> mkdir -p /opt/postgres/data_datanode1 >> >> chown postgres: /opt/postgres/data_* >> >> su - postgres >> >> initdb -D /opt/postgres/data_coordinator1 --nodename coordinator1 >> initdb -D /opt/postgres/data_datanode1 --nodename datanode1 >> >> #configure /opt/postgres/data_coordinator1/postgres.conf with GTM server >> #configure /opt/postgres/data_datanode1/postgres.conf with GTM server >> >> >> postgres -X -p 15432 -D /opt/postgres/data_datanode1 >>logfile 2>&1 & >> postgres -C -D /opt/postgres/data_coordinator1 >>logfile 2>&1 & >> >> node2: >> ====== >> >> rm -fr /opt/postgres/data* >> >> mkdir -p /opt/postgres/data_coordinator2 >> mkdir -p /opt/postgres/data_datanode2 >> >> chown postgres: /opt/postgres/data_* >> >> su - postgres >> >> initdb -D /opt/postgres/data_coordinator2 --nodename coordinator2 >> initdb -D /opt/postgres/data_datanode2 --nodename datanode2 >> >> #configure /opt/postgres/data_coordinator2/postgres.conf with GTM server >> #configure /opt/postgres/data_datanode2/postgres.conf with GTM server >> >> postgres -X -p 15433 -D /opt/postgres/data_datanode2 >>logfile 2>&1 & >> postgres -C -D /opt/postgres/data_coordinator2 >>logfile 2>&1 & >> >> each coordinator node: >> ====================== >> >> postgres -C -D /opt/postgres/data_coordinator1 >>logfile 2>&1 & >> > You already started your nodes at an earlier step, so this is not > necessary. > An error would be returned telling that node is already started like > postgres. > >> GTM machine: >> ============= >> >> rm -fr /opt/postgres/data* >> >> mkdir -p /opt/postgres/data_gtm >> >> chown postgres: /opt/postgres/data* >> >> su - postgres >> >> initgtm -D /opt/postgres/data_gtm -Z gtm >> gtm -D /opt/postgres/data_gtm >logfile 2>&1 & >> > You should start GTM *before* starting your 2 Coordinators and your 2 > Datanodes. > Postgres-XC nodes need to register on GTM at start-up or they cannot start. > > >> >> Registering Nodes: (all datanodes ??? has been done on both, output below) >> ================== >> >> psql -c "CREATE NODE datanode1 WITH (TYPE = 'datanode', PORT = 15432)" >> postgres >> psql -c "CREATE NODE datanode2 WITH (TYPE = 'datanode', PORT = 15433)" >> postgres >> psql -c "SELECT pgxc_pool_reload()" postgres >> select oid,node_name from pgxc_node; >> > > Here you have to launch CREATE NODE and pgxc_pool_reload on *each > Coordinator*. When you start up a node this node knows only about itself, > so you need to register all the other Coordinators and Datanodes. > Registering other Coordinators on a Coordinator is mandatory or you won't > be able to synchronize DDL among Coordinators, this could result in a table > being created on a Coordinator and not another. > > So, in your case, launch the following queries: > - On Coordinator 1: > CREATE NODE datanode1 WITH (TYPE = 'datanode', PORT = 15432, HOST = > '$node1_ip'); > CREATE NODE datanode2 WITH (TYPE = 'datanode', PORT = 15433, HOST = > '$node2_ip'); > CREATE NODE coordinator2 WITH (TYPE = 'coordinator', PORT = 5432, HOST = > '$node2_ip'); > - On Coordinator 2: > CREATE NODE datanode1 WITH (TYPE = 'datanode', PORT = 15432, HOST = > '$node1_ip'); > CREATE NODE datanode2 WITH (TYPE = 'datanode', PORT = 15433, HOST = > '$node2_ip'); > CREATE NODE coordinator1 WITH (TYPE = 'coordinator', PORT = 5432, HOST = > '$node2_ip'); > There is a mistake here. On Coordinator 2, coordinator1 should be registered with a host set to $node1_ip, resulting in: CREATE NODE coordinator1 WITH (TYPE = 'coordinator', PORT = 5432, HOST = '$node1_ip'); -- Michael Paquier http://michael.otacoo.com |
|
From: Neil M. <nm...@xu...> - 2012-06-25 13:08:50
|
Thanks to all for the tips, all up and running now ! PS , on the short version of documentation, it does not mentioned the HOST parameter: http://postgres-xc.sourceforge.net/docs/1_0/install-short.html Though I am guessing it all works fine when installed on the same machine Thanks again Neil ________________________________________ From: Michael Paquier [mic...@gm...] Sent: Monday, June 25, 2012 2:09 AM To: Neil Mooney Cc: pos...@li... Subject: Re: [Postgres-xc-general] createdb: database creation failed: ERROR: Failed to get pooled connections On Mon, Jun 25, 2012 at 10:07 AM, Michael Paquier <mic...@gm...<mailto:mic...@gm...>> wrote: I may be stepping someone's else answer... But here is some input. On Fri, Jun 22, 2012 at 9:30 PM, Neil Mooney <nm...@xu...<mailto:nm...@xu...>> wrote: Can anyone point out where I am going wrong here ? Here is a complete log of what i've done to setup , error at the end: Data/Coordinator machines: ========================== node1: ====== rm -fr /opt/postgres/data* mkdir -p /opt/postgres/data_coordinator1 mkdir -p /opt/postgres/data_datanode1 chown postgres: /opt/postgres/data_* su - postgres initdb -D /opt/postgres/data_coordinator1 --nodename coordinator1 initdb -D /opt/postgres/data_datanode1 --nodename datanode1 #configure /opt/postgres/data_coordinator1/postgres.conf with GTM server #configure /opt/postgres/data_datanode1/postgres.conf with GTM server postgres -X -p 15432 -D /opt/postgres/data_datanode1 >>logfile 2>&1 & postgres -C -D /opt/postgres/data_coordinator1 >>logfile 2>&1 & node2: ====== rm -fr /opt/postgres/data* mkdir -p /opt/postgres/data_coordinator2 mkdir -p /opt/postgres/data_datanode2 chown postgres: /opt/postgres/data_* su - postgres initdb -D /opt/postgres/data_coordinator2 --nodename coordinator2 initdb -D /opt/postgres/data_datanode2 --nodename datanode2 #configure /opt/postgres/data_coordinator2/postgres.conf with GTM server #configure /opt/postgres/data_datanode2/postgres.conf with GTM server postgres -X -p 15433 -D /opt/postgres/data_datanode2 >>logfile 2>&1 & postgres -C -D /opt/postgres/data_coordinator2 >>logfile 2>&1 & each coordinator node: ====================== postgres -C -D /opt/postgres/data_coordinator1 >>logfile 2>&1 & You already started your nodes at an earlier step, so this is not necessary. An error would be returned telling that node is already started like postgres. GTM machine: ============= rm -fr /opt/postgres/data* mkdir -p /opt/postgres/data_gtm chown postgres: /opt/postgres/data* su - postgres initgtm -D /opt/postgres/data_gtm -Z gtm gtm -D /opt/postgres/data_gtm >logfile 2>&1 & You should start GTM before starting your 2 Coordinators and your 2 Datanodes. Postgres-XC nodes need to register on GTM at start-up or they cannot start. Registering Nodes: (all datanodes ??? has been done on both, output below) ================== psql -c "CREATE NODE datanode1 WITH (TYPE = 'datanode', PORT = 15432)" postgres psql -c "CREATE NODE datanode2 WITH (TYPE = 'datanode', PORT = 15433)" postgres psql -c "SELECT pgxc_pool_reload()" postgres select oid,node_name from pgxc_node; Here you have to launch CREATE NODE and pgxc_pool_reload on each Coordinator. When you start up a node this node knows only about itself, so you need to register all the other Coordinators and Datanodes. Registering other Coordinators on a Coordinator is mandatory or you won't be able to synchronize DDL among Coordinators, this could result in a table being created on a Coordinator and not another. So, in your case, launch the following queries: - On Coordinator 1: CREATE NODE datanode1 WITH (TYPE = 'datanode', PORT = 15432, HOST = '$node1_ip'); CREATE NODE datanode2 WITH (TYPE = 'datanode', PORT = 15433, HOST = '$node2_ip'); CREATE NODE coordinator2 WITH (TYPE = 'coordinator', PORT = 5432, HOST = '$node2_ip'); - On Coordinator 2: CREATE NODE datanode1 WITH (TYPE = 'datanode', PORT = 15432, HOST = '$node1_ip'); CREATE NODE datanode2 WITH (TYPE = 'datanode', PORT = 15433, HOST = '$node2_ip'); CREATE NODE coordinator1 WITH (TYPE = 'coordinator', PORT = 5432, HOST = '$node2_ip'); There is a mistake here. On Coordinator 2, coordinator1 should be registered with a host set to $node1_ip, resulting in: CREATE NODE coordinator1 WITH (TYPE = 'coordinator', PORT = 5432, HOST = '$node1_ip'); -- Michael Paquier http://michael.otacoo.com |