<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" 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 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML con formato previo Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLconformatoprevioCar
        {mso-style-name:"HTML con formato previo Car";
        mso-style-priority:99;
        mso-style-link:"HTML con formato previo";
        font-family:"Courier New";
        mso-fareast-language:ES;}
span.EstiloCorreo20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EstiloCorreo21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ES link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hi everyone,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>I have hell of a headache configuring pgpool, i hope you can help me.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>Let me add a little bit of context:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>2 DB servers(DB1 and DB2) and 2 web tomcat servers (WEB1 and WEB2)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>DB1 is master and DB2 is slave with replication.<o:p></o:p></span></p><p class=MsoNormal>Replication is working fine.<o:p></o:p></p><p class=MsoNormal><span lang=EN-US>WEB1 and WEB2 both have pgpool installed and each tomcat connects to its own local pgpool. <br>pgpool is configured with the two backends, WD, load balance and master-slave in stream mode.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>Ok, now the problem:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>While testing pgpool configuration, I launched some easy queries(select 1) to WEB1&#8217;s pgpool in order to test the load balancing.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Pgpool shows the following log<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 03:47:00 LOG:&nbsp;&nbsp; pid 22005: connection received: host=[local]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 03:47:00 LOG:&nbsp;&nbsp; pid 22005: statement: select 1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 03:47:00 LOG:&nbsp;&nbsp; pid 22005: DB node id: 0 backend pid: 5228 statement: select 1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 03:47:07 LOG:&nbsp;&nbsp; pid 22021: connection received: host=[local]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 03:47:07 LOG:&nbsp;&nbsp; pid 22021: statement: select 1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 03:47:07 LOG:&nbsp;&nbsp; pid 22021: DB node id: 1 backend pid: 35193 statement: select 1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 03:47:15 LOG:&nbsp;&nbsp; pid 22017: connection received: host=[local]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 03:47:15 LOG:&nbsp;&nbsp; pid 22017: statement: select 1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 03:47:15 LOG:&nbsp;&nbsp; pid 22017: DB node id: 0 backend pid: 5231 statement: select 1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 03:47:20 LOG:&nbsp;&nbsp; pid 22016: connection received: host=[local]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 03:47:20 LOG:&nbsp;&nbsp; pid 22016: statement: select 1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 03:47:20 LOG:&nbsp;&nbsp; pid 22016: DB node id: 0 backend pid: 5232 statement: select 1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 03:47:27 LOG:&nbsp;&nbsp; pid 22012: connection received: host=[local]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 03:47:27 LOG:&nbsp;&nbsp; pid 22012: statement: select 1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 03:47:27 LOG:&nbsp;&nbsp; pid 22012: DB node id: 1 backend pid: 35196 statement: select 1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>Everything seems to be working, some queries goes to DB1 and others to DB2, but in postgres log I see the following:<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 10:47:00 CEST [35192]: [1-1] LOG:&nbsp; connection received: host=172.24.32.105 port=59021<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 10:47:00 CEST [35192]: [2-1] LOG:&nbsp; connection authorized: user=postgres database=postgres<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 10:47:00 CEST [35192]: [3-1] LOG:&nbsp; disconnection: session time: 0:00:00.032 user=postgres database=postgres host=172.24.32.105 port=59021<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 10:47:07 CEST [35193]: [1-1] LOG:&nbsp; connection received: host=172.24.32.105 port=59024<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 10:47:07 CEST [35193]: [2-1] LOG:&nbsp; connection authorized: user=postgres database=postgres<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 10:47:07 CEST [35193]: [3-1] LOG:&nbsp; disconnection: session time: 0:00:00.008 user=postgres database=postgres host=172.24.32.105 port=59024<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 10:47:15 CEST [35194]: [1-1] LOG:&nbsp; connection received: host=172.24.32.105 port=59026<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 10:47:15 CEST [35194]: [2-1] LOG:&nbsp; connection authorized: user=postgres database=postgres<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 10:47:15 CEST [35194]: [3-1] LOG:&nbsp; disconnection: session time: 0:00:00.008 user=postgres database=postgres host=172.24.32.105 port=59026<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 10:47:20 CEST [35195]: [1-1] LOG:&nbsp; connection received: host=172.24.32.105 port=59028<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 10:47:20 CEST [35195]: [2-1] LOG:&nbsp; connection authorized: user=postgres database=postgres<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 10:47:20 CEST [35195]: [3-1] LOG:&nbsp; disconnection: session time: 0:00:00.006 user=postgres database=postgres host=172.24.32.105 port=59028<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 10:47:27 CEST [35196]: [1-1] LOG:&nbsp; connection received: host=172.24.32.105 port=59030<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 10:47:27 CEST [35196]: [2-1] LOG:&nbsp; connection authorized: user=postgres database=postgres<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>2014-09-09 10:47:27 CEST [35196]: [3-1] LOG:&nbsp; disconnection: session time: 0:00:00.019 user=postgres database=postgres host=172.24.32.105 port=59030<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>Which means that pgpool is not load balancing, is sending all queries to all DB servers. I have tested many configurations but there is something I am missing and I cannot find it. Can anyone help me?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>Thank you very much!<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>