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 |