[pgpool-general: 5687] connecting to pgpool (3.6.4) via python pg8000 module

Shay Cohavi cohavisi at gmail.com
Mon Aug 7 03:58:49 JST 2017


Hi,

postgres9.3.5
pgpool 3.6.4

I having problem connecting to postgresql servers via pgpool using python
pg8000 module (which worked before on an older pgpool versions - 3.4.3):

# PGPASSWORD=postgres psql -h *10.65.150.86* -p *9999* -U postgres -c "show
pool_nodes"

 node_id |   hostname    | port | status | lb_weight |  role   | select_cnt
| load_balance_node | replication_delay
---------+---------------+------+--------+-----------+---------+------------+-------------------+-------------------
 0 | 10.65.150.200 | 5432 | up     | 0.500000  | standby | 712678     |
false             | 0
 1 | 10.65.150.201 | 5432 | up     | 0.500000  | primary | 51705100   |
true              | 0
(2 rows)


*connecting via cli to pgpool port is working as expected:*

# *PGPASSWORD=postgres psql -U postgres -h 10.65.150.86 -p 9999 -d postgres*
psql (9.3.5)
Type "help" for help.

postgres=#




*connecting via python pg8000 module:*

# python2.7
Python 2.7.5 (default, Aug 22 2013, 07:49:49)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pg8000

connecting to pgpool port (9999)

>>> *pg8000.Connection(user='postgres',password='postgres',host='10.65.150.86',
port=9999, database='manager')*
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/pg8000/interface.py", line 437, in
__init__
    self._begin = PreparedStatement(self, "BEGIN TRANSACTION")
  File "/usr/lib/python2.7/site-packages/pg8000/interface.py", line 108, in
__init__
    self._parse_row_desc = self.c.parse(self._statement_name, statement,
types)
  File "/usr/lib/python2.7/site-packages/pg8000/protocol.py", line 915, in
_fn
    self._sync()
  File "/usr/lib/python2.7/site-packages/pg8000/protocol.py", line 1208, in
_sync
    reader.handle_messages()
  File "/usr/lib/python2.7/site-packages/pg8000/protocol.py", line 876, in
handle_messages
    msg = self._conn._read_message()
  File "/usr/lib/python2.7/site-packages/pg8000/protocol.py", line 1000, in
_read_message
    bytes = self._read_bytes(5)
  File "/usr/lib/python2.7/site-packages/pg8000/protocol.py", line 988, in
_read_bytes
    self._sock_buf = self._sock.recv(1024)
socket.timeout: timed out


connecting to postgresql port:

>>> *pg8000.Connection(user='fabrix',password='fabrix',host='10.65.150.86',
port=5432, database='manager')*
<pg8000.interface.Connection object at 0x198bd10>

Please advice, since this issue didnt came up with the older pgpool (3.4.3)


Thanks,
cohavisi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20170806/1eb4c8d1/attachment.html>


More information about the pgpool-general mailing list