<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
/* List Definitions */
@list l0
        {mso-list-id:154536235;
        mso-list-type:hybrid;
        mso-list-template-ids:10667058 -855181316 68681731 68681733 68681729 68681731 68681733 68681729 68681731 68681733;}
@list l0:level1
        {mso-level-start-at:2008;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Arial;
        mso-fareast-font-family:"Times New Roman";}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>
</head>
<body lang=RO link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Hi everybody,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>I am trying to organize a highly available DB solution
using Postgresql(8.2.5) and pgCluster(1.7.7rc7).<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>I use 2 Ubuntu 7.04 (x32)machines, currently in
virtual machines.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Pg1 (192.168.123.31) <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Rep1<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Lb1<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Pg2(193.168.123.29)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Rep2<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Lb2<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>- I managed to make the replication working;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>- I checked the etc/hosts file;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>- When one node is recovering from failure (-R)
any operations executed on the other node is correctly replicated;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>But the load balancers seem to work in a wrong way
(at least not the way I am expecting them to work).<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial'><span
style='mso-list:Ignore'>-<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><font size=2 face=Arial><span
lang=EN-US style='font-size:10.0pt;font-family:Arial'>first all DB nodes are
initialized, as the <i><span style='font-style:italic'>pglb.sts</span></i> file
shows<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial'><span
style='mso-list:Ignore'>-<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><font size=2 face=Arial><span
lang=EN-US style='font-size:10.0pt;font-family:Arial'>immediately after:”
PGRscan_cluster:X ClusterDB can be used” decreases with one (X
-1)<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial'><span
style='mso-list:Ignore'>-<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><font size=2 face=Arial><span
lang=EN-US style='font-size:10.0pt;font-family:Arial'>I tried to add 3 DB nodes
in cluster, and I have the same problem: at the beginning “3 ClusterDB
nodes can be used” and immediately after that “2 ClusterDB..”,
even if all three DB nodes are running.<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial'><span
style='mso-list:Ignore'>-<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><font size=2 face=Arial><span
lang=EN-US style='font-size:10.0pt;font-family:Arial'>In the 3 nodes scenario,
when only the last DB node is up, the cluster is unreachable, but with any of
the first two DB nodes is alive, the cluster is running.<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial'><span
style='mso-list:Ignore'>-<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><font size=2 face=Arial><span
lang=EN-US style='font-size:10.0pt;font-family:Arial'>In the 2 nodes scenario,
when the first DB node is down the cluster is unreachable, even if the second
DB node is alive.<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:18.0pt'><font size=2 face=Arial><span
lang=EN-US style='font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Does anyone knows why “PGRscan_cluster:X
ClusterDB can be used” decreases, and when the X number is updated?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>A supplementary node must be always kept for safety
reasons? (E.g. from a 3 nodes cluster only 2 may be used)?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Below, some logs from load balancers, in the 2 nodes
scenario:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>On PG2, LB2 log: (PG1 DB node stopped):<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:35.4pt'><i><font size=2
face="Times New Roman"><span lang=EN-GB style='font-size:10.0pt;font-style:
italic'>2008-01-16 15:30:30 [13087]
DEBUG:PGRset_status_on_cluster_tbl():host:pg1 port:5432 max:32 use:0 status1<br>
2008-01-16 15:30:30 [13087] DEBUG:PGRset_status_on_cluster_tbl():host:pg2
port:5432 max:32 use:0 status1<br>
2008-01-16 15:30:30 [13087] DEBUG:init_pglb():Child_Tbl size is[49536]<br>
2008-01-16 15:31:07 [13087] <b><span style='font-weight:bold'>DEBUG:PGRscan_cluster:2
ClusterDB can be used</span></b><br>
2008-01-16 15:31:07 [13087] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->1
max->32 use_num->0<br>
<br>
2008-01-16 15:31:07 [13087] DEBUG:PGRset_status_on_cluster_tbl():host:pg1
port:5432 max:32 use:1 status2<br>
2008-01-16 15:31:07 [13116] DEBUG:PGRdo_child():I am 13116<br>
2008-01-16 15:31:07 [13116] DEBUG:do_accept():I am 13116 accept fd 6<br>
2008-01-16 15:31:07 [13116] DEBUG:read_startup_packet():Protocol Major: 3
Minor: 0 database: TEST user: postgres<br>
2008-01-16 15:31:07 [13116] ERROR:connect_inet_domain_socket(): connect()
failed: Connection refused<br>
2008-01-16 15:31:07 [13116] DEBUG:PGRset_status_on_cluster_tbl():host:pg1
port:5432 max:32 use:2 status98<br>
2008-01-16 15:31:09 [13087] <b><span style='font-weight:bold'>DEBUG:PGRscan_cluster:1
ClusterDB can be used</span></b><br>
2008-01-16 15:31:09 [13087] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->98
max->32 use_num->1<br>
<br>
2008-01-16 15:31:09 [13087] DEBUG:PGRscan_cluster:pg2 [5432],useFlag->1
max->32 use_num->0<br>
<br>
2008-01-16 15:31:09 [13087] DEBUG:PGRset_status_on_cluster_tbl():host:pg2
port:5432 max:32 use:1 status2<br>
2008-01-16 15:31:09 [13117] DEBUG:PGRdo_child():I am 13117<br>
2008-01-16 15:31:09 [13117] DEBUG:do_accept():I am 13117 accept fd 6<br>
2008-01-16 15:31:09 [13117] DEBUG:read_startup_packet():Protocol Major: 3
Minor: 0 database: TEST user: postgres<br>
2008-01-16 15:31:09 [13117] DEBUG:create_cp():[pg2] [pg2] is same<br>
2008-01-16 15:31:09 [13117] DEBUG:connect_unix_domain_socket():postmaster Unix
domain socket: /tmp/.s.PGSQL.5432<br>
2008-01-16 15:31:09 [13117] DEBUG:connect_unix_domain_socket():connected to
postmaster Unix domain socket: /tmp/.s.PGSQL.5432 fd: 7<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ### HERE I created a JDBC
connection from another host…………………………………<br>
2008-01-16 15:31:09 [13117] DEBUG:ReadyForQuery(): message length: 5<br>
2008-01-16 15:31:09 [13117] DEBUG:ReadyForQuery(): transaction state: I<br>
2008-01-16 15:31:09 [13117] DEBUG:ProcessFrontendResponse():read kind from
frontend X(58)<br>
2008-01-16 15:33:32 [13087] <b><span style='font-weight:bold'>DEBUG:PGRscan_cluster:0
ClusterDB can be used</span></b><br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->99
max->32 use_num->1<br>
<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:0 ClusterDB can be used<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->99
max->32 use_num->1<br>
<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:0 ClusterDB can be used<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->99
max->32 use_num->1<br>
<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:0 ClusterDB can be used<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->99
max->32 use_num->1<br>
<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:0 ClusterDB can be used<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->99
max->32 use_num->1<br>
<br>
2008-01-16 15:33:32 [13087] <b><span style='font-weight:bold'>ERROR:PGRload_balance():no
cluster available</span></b><br>
2008-01-16 15:33:32 [13087] ERROR:load_balance_main():load balance process
failed<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:0 ClusterDB can be used<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->99
max->32 use_num->1<br>
<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:0 ClusterDB can be used<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->99
max->32 use_num->1<br>
<br>
2008-01-16 15:33:32 [13087] ERROR:PGRload_balance():no cluster available<br>
2008-01-16 15:33:32 [13087] ERROR:load_balance_main():load balance process
failed<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:0 ClusterDB can be used<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->99
max->32 use_num->1<br>
<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:0 ClusterDB can be used<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->99
max->32 use_num->1<br>
……………………………………………….<br>
2008-01-16 15:33:32 [13087] ERROR:PGRload_balance():no cluster available<br>
2008-01-16 15:33:32 [13087] ERROR:load_balance_main():load balance process
failed<br>
2008-01-16 15:33:32 [13087] ERROR:load_balance_main():no cluster available<br>
2008-01-16 15:33:32 [13087] DEBUG:do_accept():I am 13087 accept fd 6<br>
2008-01-16 15:33:32 [13087] DEBUG:read_startup_packet():Protocol Major: 3
Minor: 0 database: TEST user: postgres<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:0 ClusterDB can be used<br>
2008-01-16 15:33:32 [13087] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->99
max->32 use_num->1<br>
<br>
<o:p></o:p></span></font></i></p>
<p class=MsoNormal><i><font size=2 face="Times New Roman"><span lang=EN-GB
style='font-size:10.0pt;font-style:italic'><o:p> </o:p></span></font></i></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>On PG1, LB1 log (both PG1 and PG2 DB services were
previously started on 5432 port, with postgres user):<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:35.4pt'><i><font size=2
face="Times New Roman"><span lang=EN-GB style='font-size:10.0pt;font-style:
italic'>2008-01-16 16:13:27 [29688]
DEBUG:PGRset_status_on_cluster_tbl():host:pg1 port:5432 max:42 use:0 status1<br>
2008-01-16 16:13:27 [29688] DEBUG:PGRset_status_on_cluster_tbl():host:pg2
port:5432 max:42 use:0 status1<br>
2008-01-16 16:13:27 [29688] DEBUG:init_pglb():Child_Tbl size is[65016]<br>
2008-01-16 16:13:28 [29688] <b><span style='font-weight:bold'>DEBUG:PGRscan_cluster:2
ClusterDB can be used</span></b><br>
2008-01-16 16:13:28 [29688] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->1
max->42 use_num->0<br>
<br>
2008-01-16 16:13:28 [29688] DEBUG:PGRset_status_on_cluster_tbl():host:pg1
port:5432 max:42 use:1 status2<br>
2008-01-16 16:13:28 [29695] DEBUG:PGRdo_child():I am 29695<br>
2008-01-16 16:13:28 [29695] DEBUG:do_accept():I am 29695 accept fd 6<br>
2008-01-16 16:13:28 [29695] ERROR:pool_read: read failed (Connection reset by
peer)<br>
2008-01-16 16:13:30 [29688] <b><span style='font-weight:bold'>DEBUG:PGRscan_cluster:1
ClusterDB can be used</span></b><br>
2008-01-16 16:13:30 [29688] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->2
max->42 use_num->0</span></font></i><i><font size=2 face=Arial><span
lang=EN-US style='font-size:10.0pt;font-family:Arial;font-style:italic'><o:p></o:p></span></font></i></p>
<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face=Arial><span
lang=EN-US style='font-size:10.0pt;font-family:Arial'>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:35.4pt'><i><font size=2
face="Times New Roman"><span lang=EN-GB style='font-size:10.0pt;font-style:
italic'>2008-01-16 16:24:58 [31526] DEBUG:PGRdo_child():I am 31526<br>
2008-01-16 16:24:58 [31526] DEBUG:do_accept():I am 31526 accept fd 6<br>
2008-01-16 16:24:58 [31526] ERROR:pool_read: read failed (Connection reset by
peer)<br>
2008-01-16 16:25:00 [29688] DEBUG:PGRscan_cluster:1 ClusterDB can be used<br>
2008-01-16 16:25:00 [29688] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->2
max->42 use_num->0<br>
<br>
2008-01-16 16:25:00 [31531] DEBUG:PGRdo_child():I am 31531<br>
2008-01-16 16:25:00 [31531] DEBUG:do_accept():I am 31531 accept fd 6<br>
2008-01-16 16:25:00 [31531] ERROR:pool_read: read failed (Connection reset by
peer)<br>
2008-01-16 16:25:02 [29688] DEBUG:PGRscan_cluster:1 ClusterDB can be used<br>
2008-01-16 16:25:02 [29688] DEBUG:PGRscan_cluster:pg1 [5432],useFlag->2
max->42 use_num->0<o:p></o:p></span></font></i></p>
<p class=MsoNormal style='margin-left:35.4pt'><i><font size=2
face="Times New Roman"><span lang=EN-GB style='font-size:10.0pt;font-style:
italic'><o:p> </o:p></span></font></i></p>
<p class=MsoNormal style='margin-left:35.4pt'><i><font size=2
face="Times New Roman"><span lang=EN-GB style='font-size:10.0pt;font-style:
italic'><o:p> </o:p></span></font></i></p>
<p class=MsoNormal style='margin-left:35.4pt'><font size=2
face="Times New Roman"><span lang=EN-GB style='font-size:10.0pt'> Thanks
in advance,<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:35.4pt'><font size=2
face="Times New Roman"><span lang=EN-GB style='font-size:10.0pt'> Lia
Domide.<o:p></o:p></span></font></p>
</div>
</body>
</html>