|
From: Juned K. <jkh...@gm...> - 2014-03-14 12:11:36
|
Hi all, I have just setup postgre-xc with four servers for testing. with this four system from GTM server i am able to connect to database and it selects one of coordinator,. it just works fine. But now i want to integrate this with my application where application is on separate server. so in this case where to connect in pgxc ? which IP and port i should set in my application to communicate with it? >From some documentation i came to know i should connect to coordinator but from other system i am not able connect to the database. i am getting this [postgres@localhost ~]$ psql -H 192.168.1.73 -U postgres -d dbname -p 20004 > psql: warning: extra command-line argument "192.168.1.73" ignored > psql: could not connect to server: No such file or directory > Is the server running locally and accepting > connections on Unix domain socket "/tmp/.s.PGSQL.20004"? > But on this server seems socket port is open > [root@localhost ~]# netstat -pan | grep postgre > tcp 0 0 0.0.0.0:20004 0.0.0.0:* > LISTEN 9454/postgres > tcp 0 0 0.0.0.0:20008 0.0.0.0:* > LISTEN 9522/postgres > tcp 0 0 192.168.1.73:20008 192.168.1.73:33950 > ESTABLISHED 10025/postgres > tcp 0 0 192.168.1.73:33950 192.168.1.73:20008 > ESTABLISHED 9459/postgres > tcp 0 0 192.168.1.73:35014 192.168.1.73:20001 > ESTABLISHED 9522/postgres > tcp 0 0 192.168.1.73:35006 192.168.1.73:20001 > ESTABLISHED 9454/postgres > tcp 0 0 192.168.1.73:57794 192.168.1.43:20009 > ESTABLISHED 9459/postgres > tcp 0 0 :::20004 > :::* LISTEN 9454/postgres > tcp 0 0 :::20008 > :::* LISTEN 9522/postgres > udp 0 0 ::1:60142 > ::1:60142 ESTABLISHED 9522/postgres > udp 0 0 ::1:59683 > ::1:59683 ESTABLISHED 9454/postgres > unix 2 [ ACC ] STREAM LISTENING 84606 > 9454/postgres /tmp/.s.PGSQL.20004 > unix 2 [ ACC ] STREAM LISTENING 84641 > 9459/postgres /tmp/.s.PGPOOL.20010 > unix 2 [ ACC ] STREAM LISTENING 85268 > 9522/postgres /tmp/.s.PGSQL.20008 > am i doing correct ? Please suggest. -- Thanks, Juned Khan iNextrix Technologies Pvt Ltd. www.inextrix.com |
|
From: Koichi S. <koi...@gm...> - 2014-03-14 22:29:49
|
Application can connect to ANY coordinator (not datanode). So most likely is to assign different coordinator to different application instance. You can use usual -p and -h parameter for different coordinator from your applications. All the coordinator provides the same database view and any updating transaction is propagated to all the node without conflict. Regards; --- Koichi Suzuki 2014-03-14 12:11 GMT+00:00 Juned Khan <jkh...@gm...>: > Hi all, > > I have just setup postgre-xc with four servers for testing. > with this four system from GTM server i am able to connect > to database and it selects one of coordinator,. it just works fine. > > But now i want to integrate this with my application where application > is on separate server. > > so in this case where to connect in pgxc ? > > which IP and port i should set in my application to communicate with it? > > From some documentation i came to know i should connect to coordinator > but from other system i am not able connect to the database. i am getting > this > >> [postgres@localhost ~]$ psql -H 192.168.1.73 -U postgres -d dbname -p >> 20004 >> psql: warning: extra command-line argument "192.168.1.73" ignored >> psql: could not connect to server: No such file or directory >> Is the server running locally and accepting >> connections on Unix domain socket "/tmp/.s.PGSQL.20004"? > > > > But on this server seems socket port is open >> >> [root@localhost ~]# netstat -pan | grep postgre >> tcp 0 0 0.0.0.0:20004 0.0.0.0:* >> LISTEN 9454/postgres >> tcp 0 0 0.0.0.0:20008 0.0.0.0:* >> LISTEN 9522/postgres >> tcp 0 0 192.168.1.73:20008 192.168.1.73:33950 >> ESTABLISHED 10025/postgres >> tcp 0 0 192.168.1.73:33950 192.168.1.73:20008 >> ESTABLISHED 9459/postgres >> tcp 0 0 192.168.1.73:35014 192.168.1.73:20001 >> ESTABLISHED 9522/postgres >> tcp 0 0 192.168.1.73:35006 192.168.1.73:20001 >> ESTABLISHED 9454/postgres >> tcp 0 0 192.168.1.73:57794 192.168.1.43:20009 >> ESTABLISHED 9459/postgres >> tcp 0 0 :::20004 :::* >> LISTEN 9454/postgres >> tcp 0 0 :::20008 :::* >> LISTEN 9522/postgres >> udp 0 0 ::1:60142 ::1:60142 >> ESTABLISHED 9522/postgres >> udp 0 0 ::1:59683 ::1:59683 >> ESTABLISHED 9454/postgres >> unix 2 [ ACC ] STREAM LISTENING 84606 9454/postgres >> /tmp/.s.PGSQL.20004 >> unix 2 [ ACC ] STREAM LISTENING 84641 9459/postgres >> /tmp/.s.PGPOOL.20010 >> unix 2 [ ACC ] STREAM LISTENING 85268 9522/postgres >> /tmp/.s.PGSQL.20008 > > > > > am i doing correct ? > > Please suggest. > > -- > Thanks, > Juned Khan > iNextrix Technologies Pvt Ltd. > www.inextrix.com > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/13534_NeoTech > _______________________________________________ > Postgres-xc-general mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postgres-xc-general > |
|
From: Juned K. <jkh...@gm...> - 2014-03-15 07:42:51
|
Hi koichi,zhangzl Thanks for your suggestions. So i have to connect my application to directly one of coordinator right. I thought i have to connect my application to GTM from where my application will use one of available coordinator. In this case if i connect my application to connect specific coordinator using port then what will happen if that coordinator goes down ? in the case of GTM when i execute simply Psql -dkoichi then it selects available coordinator automatically, this is not possible to setup with application? if i am able to connect my application to directly GTM and then it will select any of available coordinator. Please suggest. On Sat, Mar 15, 2014 at 4:59 AM, 张仲良 <zh...@li...> wrote: > Use h instead of H; > > Maybe you should check your pg_hba.conf file if you still cannot connect > to it. > > > > *发件人:* Juned Khan [mailto:jkh...@gm...] > *发送时间:* 2014年3月14日 20:11 > *收件人:* Postgres-XC mailing list > *主题:* [Postgres-xc-general] Where to connect to communicate pgxc with > Application > > > > Hi all, > > I have just setup postgre-xc with four servers for testing. > > with this four system from GTM server i am able to connect > > to database and it selects one of coordinator,. it just works fine. > > But now i want to integrate this with my application where application > > is on separate server. > > so in this case where to connect in pgxc ? > > which IP and port i should set in my application to communicate with it? > > From some documentation i came to know i should connect to coordinator > > but from other system i am not able connect to the database. i am getting > this > > > > [postgres@localhost ~]$ psql -H 192.168.1.73 -U postgres -d dbname -p > 20004 > psql: warning: extra command-line argument "192.168.1.73" ignored > psql: could not connect to server: No such file or directory > Is the server running locally and accepting > connections on Unix domain socket "/tmp/.s.PGSQL.20004"? > > > > > > But on this server seems socket port is open > > [root@localhost ~]# netstat -pan | grep postgre > tcp 0 0 0.0.0.0:20004 0.0.0.0:* > LISTEN 9454/postgres > tcp 0 0 0.0.0.0:20008 0.0.0.0:* > LISTEN 9522/postgres > tcp 0 0 192.168.1.73:20008 192.168.1.73:33950 > ESTABLISHED 10025/postgres > tcp 0 0 192.168.1.73:33950 192.168.1.73:20008 > ESTABLISHED 9459/postgres > tcp 0 0 192.168.1.73:35014 192.168.1.73:20001 > ESTABLISHED 9522/postgres > tcp 0 0 192.168.1.73:35006 192.168.1.73:20001 > ESTABLISHED 9454/postgres > tcp 0 0 192.168.1.73:57794 192.168.1.43:20009 > ESTABLISHED 9459/postgres > tcp 0 0 :::20004 > :::* LISTEN 9454/postgres > tcp 0 0 :::20008 > :::* LISTEN 9522/postgres > udp 0 0 ::1:60142 > ::1:60142 ESTABLISHED 9522/postgres > udp 0 0 ::1:59683 > ::1:59683 ESTABLISHED 9454/postgres > unix 2 [ ACC ] STREAM LISTENING 84606 > 9454/postgres /tmp/.s.PGSQL.20004 > unix 2 [ ACC ] STREAM LISTENING 84641 > 9459/postgres /tmp/.s.PGPOOL.20010 > unix 2 [ ACC ] STREAM LISTENING 85268 > 9522/postgres /tmp/.s.PGSQL.20008 > > > > am i doing correct ? > > Please suggest. > > > > -- > > Thanks, > Juned Khan > iNextrix Technologies Pvt Ltd. > www.inextrix.com > -- Thanks, Juned Khan iNextrix Technologies Pvt Ltd. www.inextrix.com |
|
From: 张仲良 <zh...@li...> - 2014-03-14 23:30:02
|
Use h instead of H;
Maybe you should check your pg_hba.conf file if you still cannot connect to
it.
发件人: Juned Khan [mailto:jkh...@gm...]
发送时间: 2014年3月14日 20:11
收件人: Postgres-XC mailing list
主题: [Postgres-xc-general] Where to connect to communicate pgxc with
Application
Hi all,
I have just setup postgre-xc with four servers for testing.
with this four system from GTM server i am able to connect
to database and it selects one of coordinator,. it just works fine.
But now i want to integrate this with my application where application
is on separate server.
so in this case where to connect in pgxc ?
which IP and port i should set in my application to communicate with it?
>From some documentation i came to know i should connect to coordinator
but from other system i am not able connect to the database. i am getting
this
[postgres@localhost ~]$ psql -H 192.168.1.73 -U postgres -d dbname -p 20004
psql: warning: extra command-line argument "192.168.1.73" ignored
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.20004"?
But on this server seems socket port is open
[root@localhost ~]# netstat -pan | grep postgre
tcp 0 0 0.0.0.0:20004 0.0.0.0:*
LISTEN 9454/postgres
tcp 0 0 0.0.0.0:20008 0.0.0.0:*
LISTEN 9522/postgres
tcp 0 0 192.168.1.73:20008 192.168.1.73:33950
ESTABLISHED 10025/postgres
tcp 0 0 192.168.1.73:33950 192.168.1.73:20008
ESTABLISHED 9459/postgres
tcp 0 0 192.168.1.73:35014 192.168.1.73:20001
ESTABLISHED 9522/postgres
tcp 0 0 192.168.1.73:35006 192.168.1.73:20001
ESTABLISHED 9454/postgres
tcp 0 0 192.168.1.73:57794 192.168.1.43:20009
ESTABLISHED 9459/postgres
tcp 0 0 :::20004 :::*
LISTEN 9454/postgres
tcp 0 0 :::20008 :::*
LISTEN 9522/postgres
udp 0 0 ::1:60142 ::1:60142
ESTABLISHED 9522/postgres
udp 0 0 ::1:59683 ::1:59683
ESTABLISHED 9454/postgres
unix 2 [ ACC ] STREAM LISTENING 84606 9454/postgres
/tmp/.s.PGSQL.20004
unix 2 [ ACC ] STREAM LISTENING 84641 9459/postgres
/tmp/.s.PGPOOL.20010
unix 2 [ ACC ] STREAM LISTENING 85268 9522/postgres
/tmp/.s.PGSQL.20008
am i doing correct ?
Please suggest.
--
Thanks,
Juned Khan
iNextrix Technologies Pvt Ltd.
<http://www.inextrix.com/> www.inextrix.com
|
|
From: Mason S. <ms...@tr...> - 2014-03-16 11:55:41
|
On Sat, Mar 15, 2014 at 3:42 AM, Juned Khan <jkh...@gm...> wrote: > Hi koichi,zhangzl > > Thanks for your suggestions. > > So i have to connect my application to directly one of coordinator right. > I thought i have to connect my application to GTM from where my application > will use one of available coordinator. > > In this case if i connect my application to connect specific coordinator > using port > then what will happen if that coordinator goes down ? > > in the case of GTM when i execute simply Psql -dkoichi then it selects > available > coordinator automatically, this is not possible to setup with application? > if i am able to > connect my application to directly GTM and then it will select any of > available coordinator. > > Please suggest. > > > That could possibly be an interesting extension to GTM... but then if GTM goes down you application would still not know where to look for the standby. You could also try the approach outlined in a blog posting here, essentially using DNS to load balance amongst multiple coordinators. http://www.translattice.com/blog/Load_Balancing_Postgres-XC.shtml -- Mason Sharp TransLattice - http://www.translattice.com Distributed and Clustered Database Solutions |
|
From: Koichi S. <koi...@gm...> - 2014-03-18 06:53:20
|
As Mason mentioned, yes automatic selection of a coordinator will help for load balancing as well. JDBC has some capability which selects one of the connection point from url list but libpq does not. Libpq/JDBC extension for load balancing (and to search for live coordinator) will be a nice extension. --- Koichi Suzuki 2014-03-16 20:55 GMT+09:00 Mason Sharp <ms...@tr...>: > > > > On Sat, Mar 15, 2014 at 3:42 AM, Juned Khan <jkh...@gm...> wrote: >> >> Hi koichi,zhangzl >> >> Thanks for your suggestions. >> >> So i have to connect my application to directly one of coordinator right. >> I thought i have to connect my application to GTM from where my >> application >> will use one of available coordinator. >> >> In this case if i connect my application to connect specific coordinator >> using port >> then what will happen if that coordinator goes down ? >> >> in the case of GTM when i execute simply Psql -dkoichi then it selects >> available >> coordinator automatically, this is not possible to setup with application? >> if i am able to >> connect my application to directly GTM and then it will select any of >> available coordinator. >> >> Please suggest. >> >> > > That could possibly be an interesting extension to GTM... but then if GTM > goes down you application would still not know where to look for the > standby. > > You could also try the approach outlined in a blog posting here, essentially > using DNS to load balance amongst multiple coordinators. > > http://www.translattice.com/blog/Load_Balancing_Postgres-XC.shtml > > > -- > Mason Sharp > > TransLattice - http://www.translattice.com > Distributed and Clustered Database Solutions > > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/13534_NeoTech > _______________________________________________ > Postgres-xc-general mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postgres-xc-general > |