[Postgres-xl-general] Adding a data node with pgxc_ctl

Chan Ang Loon (I2R) chanal at i2r.a-star.edu.sg
Fri Jan 30 03:03:12 PST 2015


Hi,

Thanks for the tip – this is what I’ve done over my existing setup



-          Built a new version of pgxc_ctl

-          Deleted all coordinator and datanode working directories

-          Restarted GTM and reinit – my pgxc_ctl.conf file has 2 coordinators and 1 datanode

[pgxl at node2 ~]$ /usr/local/pgsql/bin/pgxc_ctl init all


-          Create database

postgres=# create database n1;
CREATE DATABASE
postgres=# \c n1
You are now connected to database "n1" as user "pgxl".
n1=# create table t1 (id int);
CREATE TABLE
n1=# select * from pgxc_node;
node_name | node_type | node_port | node_host | nodeis_primary | nodeis_preferred |   node_id
-----------+-----------+-----------+-----------+----------------+---------------
---+-------------
coord     | C         |      5432 | coord     | f              | f
   |  -629959615
coord2    | C         |      5432 | coord2    | f              | f
   | -1197102633
data      | D         |      5433 | data      | f              | f
   |  -636235013



-          Add new data node

/usr/local/pgsql/bin/pgxc_ctl add datanode master data2 data2 5433 6668 /home/pgxl/pgxc/nodes/dn_master none none none



-          New psql session with the pooled connections error. I’ve also put in some extra tests since some things work and others don’t.




[pgxl at node2 nodes]$ psql
psql (PGXL 9.2.0, based on PG 9.2.4 (Postgres-XL 9.2.0))
Type "help" for help.

postgres=# \c n1
You are now connected to database "n1" as user "pgxl".

n1=# create table t2 (id int);
ERROR:  Failed to get pooled connections

n1=# explain select * from t1;
                                QUERY PLAN
--------------------------------------------------------------------------
Remote Subquery Scan on all (data)  (cost=0.00..34.00 rows=2400 width=4)
   ->  Seq Scan on t1  (cost=0.00..34.00 rows=2400 width=4)


n1=# select * from pgxc_node;
node_name | node_type | node_port | node_host | nodeis_primary | nodeis_preferred |   node_id
-----------+-----------+-----------+-----------+----------------+---------------
---+-------------
coord     | C         |      5432 | coord     | f              | f
   |  -629959615
coord2    | C         |      5432 | coord2    | f              | f
   | -1197102633
data      | D         |      5433 | data      | f              | f
   |  -636235013
data2     | D         |      5433 | data2     | f              | f
   | -1370618993



-          This looks strange to me

n1=# create database n2;
ERROR:  Failed to get pooled connections
n1=# \c postgres;
You are now connected to database "postgres" as user "pgxl".
postgres=# create database n2;
CREATE DATABASE
postgres=# \c n2;
You are now connected to database "n2" as user "pgxl".
n2=# create table t2 (id int);
CREATE TABLE
n2=# explain select * from t2;
                                   QUERY PLAN
--------------------------------------------------------------------------------
Remote Subquery Scan on all (data,data2)  (cost=0.00..34.00 rows=2400 width=4)
   ->  Seq Scan on t2  (cost=0.00..34.00 rows=2400 width=4)

n2=# select * from pgxc_node;
node_name | node_type | node_port | node_host | nodeis_primary | nodeis_preferred |   node_id
-----------+-----------+-----------+-----------+----------------+---------------
---+-------------
coord     | C         |      5432 | coord     | f              | f
   |  -629959615
coord2    | C         |      5432 | coord2    | f              | f
   | -1197102633
data      | D         |      5433 | data      | f              | f
   |  -636235013
data2     | D         |      5433 | data2     | f              | f
   | -1370618993
(4 rows)


From: Mason Sharp [mailto:msharp at translattice.com]
Sent: Saturday, 24 January, 2015 12:36 AM
To: Chan Ang Loon (I2R)
Cc: postgres-xl-general at lists.sourceforge.net
Subject: Re: [Postgres-xl-general] Adding a data node with pgxc_ctl



On Fri, Jan 23, 2015 at 4:50 AM, Chan Ang Loon (I2R) <chanal at i2r.a-star.edu.sg<mailto:chanal at i2r.a-star.edu.sg>> wrote:
Hi, I tried to add a third data node to a running cluster using the pgxc_ctl utility but I find I cannot create anymore tables in the table that existed before I added the third data node. I’m trying to figure out if I missed a step or it is unexpected behavior –


-          I’ve set up a pgxl cluster using the pgxc_ctl utility. Initial installation done with rpm files version postgres-xl92-9.2-34.1.x86_64.rpm.
A primary area of focus since creating those RPMs has been to improve the pgxc_ctl utility.  We will create new RPMs soon, but please build the latest code from here and try again.

http://sourceforge.net/p/postgres-xl/postgres-xl/ci/master/tree/

You can git clone it or Download a Snapshot.

Regards,

Mason


Institute for Infocomm Research disclaimer:  "This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any purpose, or disclose its contents to any other person. Thank you."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.postgres-xl.org/private.cgi/postgres-xl-general-postgres-xl.org/attachments/20150130/cfb65abf/attachment.htm>


More information about the postgres-xl-general mailing list