<div dir="ltr">to:<span style="font-family:arial,sans-serif;font-size:14px">&nbsp;</span><a href="mailto:pgpool-general-jp@sraoss.jp" style="font-family:arial,sans-serif;font-size:14px">pgpool-general-jp@sraoss.jp</a>&nbsp;$B8fCf(B<br><br>
pgpool-II$B$N%=!<%9%3!<%I!J(Bpgpool-II-3.3.1.tar.gz$B!K$r%@%&%s%m!<%I$7!"4D6-$r9=C[$7$F$*$j$^$9$,!"(B<br>$B$I$&$7$F$b%W%i%$%^%j%N!<%I>c32!J(Bpg_ctl stop -m immediate$B!K$rH/@8$5$;$F$b(Bfollow_master.sh<div>$B$,<B9T$5$l$:9T$-5M$C$F$7$^$$$^$7$?!#(B</div><div><br></div><div>$B9=C[Cf$N4D6-(B $B!'(B PostgreSQL 9.1 / pgpool-II 3.3.1$B$K$h$k(BSR/HS</div>
<div>$B!!%5!<%P#1!'(BPostgreSQL 9.1$B!J%W%i%$%^%j!K(B</div><div>$B!!%5!<%P#2!'(BPostgreSQL9.1$B!J%9%?%s%P%$!K!"(Bpgpool-II</div><div><br></div><div>PostgreSQL$B$N@_Dj%U%!%$%k(B<br>$B!!%5!<%P#1!'(Bpostgresql.conf</div><div>$B!!!!(Blisten_addresses = &#39;*&#39;</div><div>$B!!!!(Bport = 49152</div>
<div>$B!!!!(Bwal_level = hot_standby</div><div>$B!!!!(Bmax_wal_senders = 2</div><div>$B!!!!(Bwal_keep_segments = 8</div><div>$B!!!!(Bsynchronous_standby_names = &#39;DB02&#39;</div><div>$B!!%5!<%P#2!'(Bpostgresql.conf<br><div>$B!!!!(Blisten_addresses = &#39;*&#39;</div>
<div>$B!!!!(Bport = 49153</div><div>$B!!!!(Bwal_level = hot_standby</div><div>$B!!!!(Bhot_standby = on<br></div></div><div>$B!!"((Bpg_hba.conf$B$ON>%5!<%P$H$bA4$F$N%j%/%(%9%H$rDL$9$h$&$K@_Dj(B</div><div>pgpool-II$B$N@_Dj%U%!%$%k(B</div><div>$B!!%5!<%P#2!'(Bpgpool.conf<br>$B!!!!(Blisten_addresses = &#39;*&#39;</div>
<div>$B!!!!(Bport = 5432</div><div>$B!!!!(Bbackend_hostname0 = &#39;$B%5!<%P#1(B&#39;</div><div>$B!!!!(Bbackend_port0 = 49152</div><div>$B!!!!(Bbackend_hostname1 = &#39;$B%5!<%P#2(B&#39;</div><div>$B!!!!(Bbackend_port1 = 49153<br clear="all"><div>$B!!!!(Bmaster_slave_mode = on</div>
<div>$B!!!!(Bmaster_slave_sub_mode = &#39;stream&#39;</div><div>$B!!!!(Bfollow_master_command = &#39;/usr/local/pgpool-II/etc/follow_master.sh %d %h %p %D %m %M %H %P %r %R&#39;</div><div>$B!!!!(Bsr_check_user = &#39;postgres&#39;</div><div>
$B!!!!(Bhealth_check_period = 10</div><div>$B!!!!(Bhealth_check_user = &#39;postgres&#39;</div><div>$B!!!!(Bfailover_command = &#39;/usr/local/pgpool-II/etc/failover.sh %d %h %p %D %m %M %H %P %r %R&#39;</div><div>$B!!!!(Brecovery_1st_stage_command = &#39;/home/postgres/basebackup.sh&#39;</div>
<div><br></div><div>$B$3$N@_Dj$G!V(Bpsql -p 5432 -c &quot;show pool_nodes&quot;$B!W$r<B9T$9$k$H2<5-$N7k2L$K$J$j$^$9!#(B</div><div><div>&nbsp;node_id | &nbsp; &nbsp;hostname &nbsp; &nbsp; | port &nbsp;| status | lb_weight | &nbsp;role</div><div>---------+-----------------+-------+--------+-----------+---------</div>
<div>&nbsp;0 &nbsp; &nbsp; &nbsp; | $B%5!<%P#1(B | 49152 | 2 &nbsp; &nbsp; &nbsp;| 0.500000 &nbsp;| primary</div><div>&nbsp;1 &nbsp; &nbsp; &nbsp; | $B%5!<%P#2(B | 49153 | 2 &nbsp; &nbsp; &nbsp;| 0.500000 &nbsp;| standby</div><div>(2 rows)</div></div><div><br></div><div>$B$3$N>uBV$G%W%i%$%^%j%N!<%I>c32$rH/@8$5$;$k$H2<5-$N$h$&$J2<5-$N$h$&$J>uBV$K$J$j$^$9!#(B</div>
<div><div><br></div><div><div>2013-10-14 15:07:50 LOG: &nbsp; pid 9143: Backend status file /var/log/pgpool-II/pgpool_status discarded</div><div>2013-10-14 15:07:50 LOG: &nbsp; pid 9143: pgpool-II successfully started. version 3.3.1 (tokakiboshi)</div>
<div>2013-10-14 15:07:50 LOG: &nbsp; pid 9143: find_primary_node: primary node id is 0</div><div>2013-10-14 15:08:40 ERROR: pid 9143: connect_inet_domain_socket: getsockopt() detected error: Connection refused<br></div><div>2013-10-14 15:08:40 ERROR: pid 9143: make_persistent_db_connection: connection to $B%5!<%P#1(B(49152) failed</div>
<div>2013-10-14 15:08:40 ERROR: pid 9143: connect_inet_domain_socket: getsockopt() detected error: Connection refused</div><div>2013-10-14 15:08:40 ERROR: pid 9143: make_persistent_db_connection: connection to $B%5!<%P#1(B(49152) failed</div>
<div>2013-10-14 15:08:40 ERROR: pid 9143: health check failed. 0 th host $B%5!<%P#1(B at port 49152 is down</div><div>2013-10-14 15:08:40 LOG: &nbsp; pid 9143: set 0 th backend down status</div><div>2013-10-14 15:08:40 LOG: &nbsp; pid 9143: starting degeneration. shutdown host $B%5!<%P#1(B(49152)</div>
<div>2013-10-14 15:08:40 LOG: &nbsp; pid 9143: Restart all children</div><div>2013-10-14 15:08:40 LOG: &nbsp; pid 9143: execute command: /usr/local/pgpool-II/etc/failover.sh 0 $B%5!<%P#1(B 49152 /opt/PostgreSQL/9.1/data 1 0 $B%5!<%P#2(B 0 49153 /opt/PostgreSQL/9.1/data</div>
<div><br></div><div>real &nbsp; &nbsp;0m0.000s</div><div>user &nbsp; &nbsp;0m0.000s</div><div>sys &nbsp; &nbsp; 0m0.001s</div><div>2013-10-14 15:08:40 ERROR: pid 9178: connect_inet_domain_socket: getsockopt() detected error: Connection refused</div><div>
2013-10-14 15:08:40 ERROR: pid 9178: make_persistent_db_connection: connection to $B%5!<%P#2(B(49152) failed</div><div>2013-10-14 15:08:40 ERROR: pid 9178: check_replication_time_lag: could not connect to DB node 0, check sr_check_user and sr_check_password</div>
<div>pg_ctl: cannot be run as root</div><div>Please log in (using, e.g., &quot;su&quot;) as the (unprivileged) user that will</div><div>own the server process.</div><div>2013-10-14 15:08:40 LOG: &nbsp; pid 9143: find_primary_node_repeatedly: waiting for finding a primary node</div>
<div>2013-10-14 15:08:50 ERROR: pid 9178: connect_inet_domain_socket: getsockopt() detected error: Connection refused</div><div>2013-10-14 15:08:50 ERROR: pid 9178: make_persistent_db_connection: connection to $B%5!<%P#1(B(49152) failed</div>
<div>2013-10-14 15:08:50 ERROR: pid 9178: check_replication_time_lag: could not connect to DB node 0, check sr_check_user and sr_check_password</div><div>2013-10-14 15:08:50 LOG: &nbsp; pid 9143: failover: no follow backends are degenerated</div>
<div>2013-10-14 15:08:50 LOG: &nbsp; pid 9143: failover: set new primary node: -1</div><div>2013-10-14 15:08:50 LOG: &nbsp; pid 9143: failover: set new master node: 1</div><div>2013-10-14 15:08:50 LOG: &nbsp; pid 9178: worker process received restart request</div>
<div>2013-10-14 15:08:50 LOG: &nbsp; pid 9143: failover done. shutdown host $B%5!<%P#1(B(49152)</div><div>2013-10-14 15:08:51 LOG: &nbsp; pid 9177: pcp child process received restart request</div><div>2013-10-14 15:08:51 LOG: &nbsp; pid 9143: PCP child 9177 exits with status 256 in failover()</div>
<div>2013-10-14 15:08:51 LOG: &nbsp; pid 9143: fork a new PCP child pid 9313 in failover()</div><div>2013-10-14 15:08:51 LOG: &nbsp; pid 9143: worker child 9178 exits with status 256</div><div>2013-10-14 15:08:51 LOG: &nbsp; pid 9143: fork a new worker child pid 9314</div>
</div></div><div><br></div><div><div>&nbsp;node_id | &nbsp; &nbsp;hostname &nbsp; &nbsp; | port &nbsp;| status | lb_weight | &nbsp;role</div><div>---------+-----------------+-------+--------+-----------+---------</div><div>&nbsp;0 &nbsp; &nbsp; &nbsp; | $B%5!<%P#1(B | 49152 | 3 &nbsp; &nbsp; &nbsp;| 0.500000 &nbsp;| standby</div>
<div>&nbsp;1 &nbsp; &nbsp; &nbsp; | $B%5!<%P#2(B | 49153 | 2 &nbsp; &nbsp; &nbsp;| 0.500000 &nbsp;| standby</div><div>(2 rows)</div></div><div><br></div><div>failover.sh / follow_master.sh$B$O%=!<%9%3!<%I$K%P%s%I%k$5$l$F$$$k(B&rdquo;pgpool_setup&rdquo;$B$N$b$N$rMxMQ$7$F$$$^$9!#(B</div><div><br></div><div>$B$A$J$_$K!"(B&quot;pgpool_setup&quot;$B$G9=C[$7$?4D6-$G$bF1MM$NF0$-$K$J$C$$$^$9!#(B<br>
<br></div><div><br></div>
</div></div>