[pgpool-general: 6899] Re: PGPOOL-failover

Bo Peng pengbo at sraoss.co.jp
Wed Mar 4 12:55:20 JST 2020


Hello,

On Thu, 13 Feb 2020 11:11:13 +0200
Loai Abdallatif <loai.abdallatif at gmail.com> wrote:

> Hi
> 
> The OS version for three servers is: CentOS Linux release 7.7.1908 (Core)
> server1: 192.168.1.91
> server2: 192.168.1.92
> server3: 192.168.1.95
> virtual IP : 192.168.1.90
> 
> the pgpool config for three servers are attached with other config files
> 
> also the virtual IP issue seem fixed after I  changed the 24  CIDR to 32 as
> this if_up_cmd = '/usr/bin/sudo /sbin/ip addr add $_IP_$/*32* and fixed
> sudo issue in server1.( i got pgpool error sudo: sorry, you must have a tty
> to run sudo ) in /var/log/messages , by putting* ! *in the line of sudoers
> file  ( Defaults  *!*requiretty).

Great!
 
> the case now still server2, server3 seems down while services are up .

Could you try to add "-D" option in "/etc/sysconfig/pgpool" to ignore the pgpool_status file and restart pgpool?

-----------------------------
# vi /etc/sysconfig/pgpool 
...
OPTS=" -D -n"
-----------------------------

> [image: image.png]
> 
> Thanks for your help and time
> 
> Best Regards
> 
> 
> On Thu, Feb 13, 2020 at 7:45 AM Bo Peng <pengbo at sraoss.co.jp> wrote:
> 
> > Hi,
> >
> > Could you share your pgpool.conf and the OS version.
> >
> > On Wed, 12 Feb 2020 22:30:53 +0200
> > Loai Abdallatif <loai.abdallatif at gmail.com> wrote:
> >
> > > also from postgres promt:i see only server1 up as below
> > >
> > > -bash-4.2$ psql -h server1 -p 9999 -U pgpool postgres -c "show
> > pool_nodes"
> > >  node_id |   hostname   | port | status | lb_weight |  role   |
> > select_cnt
> > > | load_balance_node | replication_delay | replication_state |
> > > replication_sync_state | last_s
> > > tatus_change
> > >
> > ---------+--------------+------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+-------
> > > --------------
> > >  0       | 192.168.1.91 | 5432 | up     | 0.333333  | primary | 0
> > >  | true              | 0                 |                   |
> > >            | 2020-0
> > > 2-12 22:29:54
> > >  1       | 192.168.1.92 | 5432 | down   | 0.333333  | standby | 0
> > >  | false             | 0                 |                   |
> > >            | 2020-0
> > > 2-12 22:28:54
> > >  2       | 192.168.1.95 | 5432 | down   | 0.333333  | standby | 0
> > >  | false             | 0                 |                   |
> > >            | 2020-0
> > > 2-12 22:28:54
> > > (3 rows)
> > >
> > > On Wed, Feb 12, 2020 at 10:27 PM Loai Abdallatif <
> > loai.abdallatif at gmail.com>
> > > wrote:
> > >
> > > > Hello Peng, all
> > > >
> > > > I have followed the setup for pgpool on CentOS 7 as per this link
> > > > https://www.pgpool.net/docs/latest/en/html/example-cluster.html.
> > > >
> > > > [image: image.png]
> > > >
> > > > unfortunately i got virtual ip not assigned as per below image and i
> > see
> > > > pgpool logs in server1 ( master ) as below , and suddenly the interface
> > > > ba1> disappear
> > > >
> > > >
> > > >
> > > > Feb 12 22:26:12 server1 pgpool[1136]: [471-1] 2020-02-12 22:26:12: pid
> > > > 1136: LOG:  get_query_result falied: status: -1
> > > > Feb 12 22:26:12 server1 pgpool[1136]: [471-2] 2020-02-12 22:26:12: pid
> > > > 1136: CONTEXT:  while checking replication time lag
> > > > Feb 12 22:26:12 server1 pgpool[1136]: [472-1] 2020-02-12 22:26:12: pid
> > > > 1136: DEBUG:  do_query: extended:0 query:"SELECT pg_is_in_recovery()"
> > > > Feb 12 22:26:12 server1 pgpool[1136]: [473-1] 2020-02-12 22:26:12: pid
> > > > 1136: DEBUG:  verify_backend_node_status: there's no standby node
> > > > Feb 12 22:26:12 server1 pgpool[1136]: [474-1] 2020-02-12 22:26:12: pid
> > > > 1136: DEBUG:  node status[0]: 1
> > > > Feb 12 22:26:12 server1 pgpool[1136]: [475-1] 2020-02-12 22:26:12: pid
> > > > 1136: DEBUG:  node status[1]: 0
> > > > Feb 12 22:26:12 server1 pgpool[1136]: [476-1] 2020-02-12 22:26:12: pid
> > > > 1136: DEBUG:  node status[2]: 0
> > > > Feb 12 22:26:12 server1 pgpool[1131]: [203-1] 2020-02-12 22:26:12: pid
> > > > 1131: DEBUG:  watchdog heartbeat: send heartbeat signal to server2:9694
> > > > Feb 12 22:26:12 server1 pgpool[1133]: [203-1] 2020-02-12 22:26:12: pid
> > > > 1133: DEBUG:  watchdog heartbeat: send heartbeat signal to server3:9694
> > > > Feb 12 22:26:13 server1 pgpool[1132]: [203-1] 2020-02-12 22:26:13: pid
> > > > 1132: DEBUG:  received heartbeat signal from
> > "192.168.1.92(server2):9999"
> > > > node:server2:9999 Linux server2.post.ps
> > > >
> > > >
> > > > Feb 12 22:26:14 server1 pgpool[1131]: [204-1] 2020-02-12 22:26:14: pid
> > > > 1131: DEBUG:  watchdog heartbeat: send heartbeat signal to server2:9694
> > > > Feb 12 22:26:14 server1 pgpool[1133]: [204-1] 2020-02-12 22:26:14: pid
> > > > 1133: DEBUG:  watchdog heartbeat: send heartbeat signal to server3:9694
> > > > Feb 12 22:26:15 server1 pgpool[1132]: [204-1] 2020-02-12 22:26:15: pid
> > > > 1132: DEBUG:  received heartbeat signal from
> > "192.168.1.92(server2):9999"
> > > > node:server2:9999 Linux server2.post.ps
> > > > Feb 12 22:26:16 server1 pgpool[1131]: [205-1] 2020-02-12 22:26:16: pid
> > > > 1131: DEBUG:  watchdog heartbeat: send heartbeat signal to server2:9694
> > > > Feb 12 22:26:16 server1 pgpool[1133]: [205-1] 2020-02-12 22:26:16: pid
> > > > 1133: DEBUG:  watchdog heartbeat: send heartbeat signal to server3:9694
> > > > Feb 12 22:26:17 server1 pgpool[1090]: [767-1] 2020-02-12 22:26:17: pid
> > > > 1090: DEBUG:  STATE MACHINE INVOKED WITH EVENT = TIMEOUT Current State
> > =
> > > > MASTER
> > > > Feb 12 22:26:17 server1 pgpool[1090]: [768-1] 2020-02-12 22:26:17: pid
> > > > 1090: DEBUG:  sending packet, watchdog node:[server2:9999 Linux
> > > > server2.post.ps] command id:[50] type:[IAM COORDINATOR] state:[MASTER]
> > > > Feb 12 22:26:17 server1 pgpool[1090]: [769-1] 2020-02-12 22:26:17: pid
> > > > 1090: DEBUG:  sending watchdog packet to socket:9, type:[M], command
> > ID:50,
> > > > data Length:118
> > > > Feb 12 22:26:17 server1 pgpool[1090]: [770-1] 2020-02-12 22:26:17: pid
> > > > 1090: DEBUG:  received watchdog packet type:I
> > > > Feb 12 22:26:17 server1 pgpool[1090]: [771-1] 2020-02-12 22:26:17: pid
> > > > 1090: DEBUG:  reading packet type I of length 330
> > > > Feb 12 22:26:17 server1 pgpool[1090]: [772-1] 2020-02-12 22:26:17: pid
> > > > 1090: DEBUG:  STATE MACHINE INVOKED WITH EVENT = PACKET RECEIVED
> > Current
> > > > State = MASTER
> > > > Feb 12 22:26:17 server1 pgpool[1090]: [773-1] 2020-02-12 22:26:17: pid
> > > > 1090: DEBUG:  received packet, watchdog node:[server2:9999 Linux
> > > > server2.post.ps] command id:[50] type:[NODE INFO] state:[MASTER]
> > > > Feb 12 22:26:17 server1 pgpool[1090]: [774-1] 2020-02-12 22:26:17: pid
> > > > 1090: DEBUG:  packet I with command ID 50 is reply to the command M
> > > > Feb 12 22:26:17 server1 pgpool[1090]: [775-1] 2020-02-12 22:26:17: pid
> > > > 1090: DEBUG:  Watchdog node "server2:9999 Linux server2.post.ps" has
> > > > replied for command id 50
> > > > Feb 12 22:26:17 server1 pgpool[1090]: [776-1] 2020-02-12 22:26:17: pid
> > > > 1090: DEBUG:  command I with command id 50 is finished with
> > > > COMMAND_FINISHED_ALL_REPLIED
> > > > Feb 12 22:26:17 server1 pgpool[1090]: [777-1] 2020-02-12 22:26:17: pid
> > > > 1090: DEBUG:  STATE MACHINE INVOKED WITH EVENT = COMMAND FINISHED
> > Current
> > > > State = MASTER
> > > > Feb 12 22:26:17 server1 pgpool[1090]: [778-1] 2020-02-12 22:26:17: pid
> > > > 1090: DEBUG:  I am the cluster leader node command finished with
> > > > status:[ALL NODES REPLIED]
> > > > Feb 12 22:26:17 server1 pgpool[1090]: [778-2] 2020-02-12 22:26:17: pid
> > > > 1090: DETAIL:  The command was sent to 1 nodes and 1 nodes replied to
> > it
> > > > Feb 12 22:26:17 server1 pgpool[1137]: [469-1] 2020-02-12 22:26:17: pid
> > > > 1137: DEBUG:  health check: clearing alarm
> > > > Feb 12 22:26:17 server1 pgpool[1137]: [470-1] 2020-02-12 22:26:17: pid
> > > > 1137: DEBUG:  authenticate kind = 0
> > > > Feb 12 22:26:17 server1 pgpool[1137]: [471-1] 2020-02-12 22:26:17: pid
> > > > 1137: DEBUG:  authenticate backend: key data received
> > > > Feb 12 22:26:17 server1 pgpool[1137]: [472-1] 2020-02-12 22:26:17: pid
> > > > 1137: DEBUG:  authenticate backend: transaction state: I
> > > > Feb 12 22:26:17 server1 pgpool[1137]: [473-1] 2020-02-12 22:26:17: pid
> > > > 1137: DEBUG:  health check: clearing alarm
> > > > Feb 12 22:26:17 server1 pgpool[1137]: [474-1] 2020-02-12 22:26:17: pid
> > > > 1137: DEBUG:  health check: clearing alarm
> > > > Feb 12 22:26:17 server1 pgpool[1132]: [205-1] 2020-02-12 22:26:17: pid
> > > > 1132: DEBUG:  received heartbeat signal from
> > "192.168.1.92(server2):9999"
> > > > node:server2:9999 Linux server2.post.ps
> > > >
> > > > On Mon, Feb 10, 2020 at 10:10 AM Bo Peng <pengbo at sraoss.co.jp> wrote:
> > > >
> > > >> On Thu, 6 Feb 2020 12:39:48 +0200
> > > >> Loai Abdallatif <loai.abdallatif at gmail.com> wrote:
> > > >>
> > > >> > Dear Colleagues
> > > >> >
> > > >> > any one have a document for setup Pgpool-II's failover
> > functionality (
> > > >> > active-standby ) on Debian ?
> > > >>
> > > >>
> > > >> Below is a setup example on CentOS7.
> > > >> https://www.pgpool.net/docs/latest/en/html/example-cluster.html
> > > >>
> > > >> > thanks
> > > >>
> > > >>
> > > >> --
> > > >> Bo Peng <pengbo at sraoss.co.jp>
> > > >> SRA OSS, Inc. Japan
> > > >>
> > > >
> >
> >
> > --
> > Bo Peng <pengbo at sraoss.co.jp>
> > SRA OSS, Inc. Japan
> > _______________________________________________
> > pgpool-general mailing list
> > pgpool-general at pgpool.net
> > http://www.pgpool.net/mailman/listinfo/pgpool-general
> >


-- 
Bo Peng <pengbo at sraoss.co.jp>
SRA OSS, Inc. Japan


More information about the pgpool-general mailing list