<div dir="ltr">Hi Ishii-San<div><br></div><div>Thank you very much for testing and providing the log files. But apparently all the configuration</div><div>files are as they should be and found no issues in those.</div><div><br></div><div>There was only one thing in the example which was host dependent and that was creation of SSL</div><div>certificates, So I have updated the example and moved the certificates creation part to inside the</div><div>containers. Hopefully this should solve the problem.</div><div><br></div><div>So can you please give it one more try with the latest version when ever you get the free time.</div><div>Also you will notice that I have removed the build_all.sh script which is no more required. and now</div><div><font face="monospace, monospace">&#39;docker-compose build&#39;</font> and <font face="monospace, monospace">&#39;docker-compose run&#39;</font></div><div>are enough to execute the example</div><div><br></div><div>Thanks</div><div>Best regards</div><div>Muhammad Usama</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 20, 2018 at 6:16 AM Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Usama,<br>
<br>
F.Y.I. This is the output of &quot;docker-compose up&quot; by using your update<br>
to the git repository.<br>
<br>
$ docker-compose up<br>
Creating network &quot;pgpool_cert_auth_default&quot; with the default driver<br>
Creating network &quot;pgpool_cert_auth_app_net&quot; with driver &quot;bridge&quot;<br>
Creating pgsql-pgpool ... done<br>
Creating pgmaster     ... done<br>
Creating pgslave      ... done<br>
Creating pgpoolnode   ... done<br>
Creating clientnode   ... done<br>
Attaching to pgsql-pgpool, pgmaster, pgslave, pgpoolnode, clientnode<br>
pgsql-pgpool     | exiting<br>
pgslave          | + MASTER_IP=172.22.0.50<br>
pgslave          | + ROLE=standby<br>
pgslave          | + echo setting up server in standby role.<br>
pgslave          | + test -z standby<br>
pgpoolnode       | + IP=172.22.0.51<br>
pgpoolnode       | + PORT=5432<br>
pgpoolnode       | + echo checking for postgresql server at <a href="http://172.22.0.51:5432" rel="noreferrer" target="_blank">172.22.0.51:5432</a>.<br>
pgpoolnode       | + test -z 172.22.0.51<br>
pgslave          | setting up server in standby role.<br>
pgsql-pgpool exited with code 0<br>
pgslave          | + &#39;[&#39; standby = standby &#39;]&#39;<br>
pgslave          | + psql -h 172.22.0.50 -U postgres -c &#39;\q&#39;<br>
pgpoolnode       | + test -z 5432<br>
pgmaster         | + MASTER_IP=172.22.0.50<br>
pgmaster         | + ROLE=master<br>
clientnode       | + PGPOOL_IP=172.22.0.52<br>
clientnode       | + PGPOOL_PORT=9999<br>
clientnode       | + psql -h 172.22.0.52 -p 9999 -U postgres -c &#39;\q&#39;<br>
pgpoolnode       | checking for postgresql server at <a href="http://172.22.0.51:5432" rel="noreferrer" target="_blank">172.22.0.51:5432</a>.<br>
pgslave          | + echo &#39;mastar Postgres is up - executing basebackup command&#39;<br>
pgslave          | + rm -rf /var/lib/pgsql/10/data<br>
pgpoolnode       | + psql -h 172.22.0.51 -p 5432 -U postgres -c &#39;\q&#39;<br>
pgslave          | mastar Postgres is up - executing basebackup command<br>
pgslave          | + sudo -u postgres pg_basebackup -RP -p 5432 -h 172.22.0.50 -D /var/lib/pgsql/10/data<br>
pgmaster         | + echo setting up server in master role.<br>
clientnode       | Pgpool-II is up and running<br>
clientnode       | + echo &#39;Pgpool-II is up and running&#39;<br>
clientnode       | + sleep 5<br>
pgpoolnode       | + echo &#39;Postgres at <a href="http://172.22.0.51:5432" rel="noreferrer" target="_blank">172.22.0.51:5432</a> is up and running&#39;<br>
pgmaster         | + test -z master<br>
pgpoolnode       | Postgres at <a href="http://172.22.0.51:5432" rel="noreferrer" target="_blank">172.22.0.51:5432</a> is up and running<br>
pgmaster         | setting up server in master role.<br>
pgmaster         | + &#39;[&#39; master = standby &#39;]&#39;<br>
23215/23215 kB (100%), 1/1 tablespaceoint<br>
pgmaster         | Starting postgresql-10 service: [  OK  ]<br>
pgmaster         | Success. You can now start the database server using:<br>
pgmaster         | <br>
pgmaster         |     /usr/pgsql-10/bin/pg_ctl -D /var/lib/pgsql/10/data -l logfile start<br>
pgmaster         | <br>
pgmaster         | 2018-11-20 01:09:44.662 UTC [40] LOG:  listening on IPv4 address &quot;0.0.0.0&quot;, port 5432<br>
pgmaster         | 2018-11-20 01:09:44.662 UTC [40] LOG:  listening on IPv6 address &quot;::&quot;, port 5432<br>
pgmaster         | 2018-11-20 01:09:44.669 UTC [40] LOG:  listening on Unix socket &quot;/var/run/postgresql/.s.PGSQL.5432&quot;<br>
pgmaster         | 2018-11-20 01:09:44.677 UTC [40] LOG:  listening on Unix socket &quot;/tmp/.s.PGSQL.5432&quot;<br>
pgmaster         | 2018-11-20 01:09:44.695 UTC [40] LOG:  redirecting log output to logging collector process<br>
pgmaster         | 2018-11-20 01:09:44.695 UTC [40] HINT:  Future log output will appear in directory &quot;log&quot;.<br>
pgmaster         | tail: unrecognized file system type 0x794c7630 for `/var/lib/pgsql/10/pgstartup.log&#39;. Reverting to polling.<br>
pgslave          | Starting postgresql-10 service: [  OK  ]<br>
pgslave          | tail: unrecognized file system type 0x794c7630 for `/var/lib/pgsql/10/pgstartup.log&#39;. Reverting to polling.<br>
pgslave          | Success. You can now start the database server using:<br>
pgslave          | <br>
pgslave          |     /usr/pgsql-10/bin/pg_ctl -D /var/lib/pgsql/10/data -l logfile start<br>
pgslave          | <br>
pgslave          | 2018-11-20 01:09:46.328 UTC [44] LOG:  listening on IPv4 address &quot;0.0.0.0&quot;, port 5432<br>
pgslave          | 2018-11-20 01:09:46.329 UTC [44] LOG:  listening on IPv6 address &quot;::&quot;, port 5432<br>
pgslave          | 2018-11-20 01:09:46.336 UTC [44] LOG:  listening on Unix socket &quot;/var/run/postgresql/.s.PGSQL.5432&quot;<br>
pgslave          | 2018-11-20 01:09:46.343 UTC [44] LOG:  listening on Unix socket &quot;/tmp/.s.PGSQL.5432&quot;<br>
pgslave          | 2018-11-20 01:09:46.354 UTC [44] LOG:  redirecting log output to logging collector process<br>
pgslave          | 2018-11-20 01:09:46.354 UTC [44] HINT:  Future log output will appear in directory &quot;log&quot;.<br>
pgpoolnode       | Starting pgpool service: [  OK  ]<br>
pgpoolnode       | tail: unrecognized file system type 0x794c7630 for `/var/log/pgpool.log&#39;. Reverting to polling.<br>
pgpoolnode       | 2018-11-20 01:09:46: pid 44: WARNING:  pool key file &quot;/home/postgres/.pgpoolkey&quot; has group or world access; permissions should be u=rw (0600) or less<br>
pgpoolnode       |      <br>
pgpoolnode       | 2018-11-20 01:09:46: pid 44: LOG:  Backend status file /var/log/pgpool/pgpool_status does not exist<br>
pgpoolnode       | 2018-11-20 01:09:46: pid 44: LOG:  Setting up socket for <a href="http://0.0.0.0:9999" rel="noreferrer" target="_blank">0.0.0.0:9999</a><br>
pgpoolnode       | 2018-11-20 01:09:46: pid 44: LOG:  Setting up socket for :::9999<br>
pgpoolnode       | 2018-11-20 01:09:46: pid 44: WARNING:  failed to open status file at: &quot;/var/log/pgpool/pgpool_status&quot;<br>
pgpoolnode       | 2018-11-20 01:09:46: pid 44: DETAIL:  &quot;No such file or directory&quot;<br>
pgpoolnode       | 2018-11-20 01:09:46: pid 44: LOG:  pgpool-II successfully started. version 4.0.1 (torokiboshi)<br>
pgpoolnode       | 2018-11-20 01:09:47: pid 75: WARNING:  failed to open status file at: &quot;/var/log/pgpool/pgpool_status&quot;<br>
pgpoolnode       | 2018-11-20 01:09:47: pid 75: DETAIL:  &quot;No such file or directory&quot;<br>
clientnode       | + psql -h 172.22.0.52 -p 9999 -U postgres -c &#39;SET password_encryption = &#39;\&#39;&#39;scram-sha-256&#39;\&#39;&#39;; CREATE ROLE scramuser PASSWORD &#39;\&#39;&#39;scram_password&#39;\&#39;&#39;; ALTER ROLE scramuser WITH LOGIN;&#39; postgres<br>
clientnode       | ALTER ROLE<br>
clientnode       | + psql -h 172.22.0.52 -p 9999 -U postgres -c &#39;SET password_encryption = &#39;\&#39;&#39;scram-sha-256&#39;\&#39;&#39;; CREATE ROLE certuser PASSWORD &#39;\&#39;&#39;cert_password&#39;\&#39;&#39;; ALTER ROLE certuser WITH LOGIN;&#39; postgres<br>
pgpoolnode       | 2018-11-20 01:09:52: pid 76: WARNING:  failed to open status file at: &quot;/var/log/pgpool/pgpool_status&quot;<br>
pgpoolnode       | 2018-11-20 01:09:52: pid 76: DETAIL:  &quot;No such file or directory&quot;<br>
clientnode       | ALTER ROLE<br>
clientnode       | + echo &#39;testing if ssl connection without proper client certificate is rejected&#39;<br>
clientnode       | + sudo -u postgres psql &#39;sslmode=require port=9999 host=172.22.0.52 dbname=postgres user=scramuser&#39;<br>
clientnode       | testing if ssl connection without proper client certificate is rejected<br>
clientnode       | psql: server does not support SSL, but SSL was required<br>
clientnode       | + echo &#39;testing if ssl connection with proper client certificate works&#39;<br>
clientnode       | + sudo -u postgres psql &#39;sslmode=require port=9999 host=172.22.0.52 dbname=postgres user=certuser&#39;<br>
clientnode       | testing if ssl connection with proper client certificate works<br>
clientnode       | psql: server does not support SSL, but SSL was required<br>
clientnode       | + tail -f /dev/null<br>
pgpoolnode       | 2018-11-20 01:09:52: pid 75: WARNING:  failed to open status file at: &quot;/var/log/pgpool/pgpool_status&quot;<br>
pgpoolnode       | 2018-11-20 01:09:52: pid 75: DETAIL:  &quot;No such file or directory&quot;<br>
<br>
<br>
<br>
&gt; Sorry, 2.txt was empty. Attached again.<br>
&gt; <br>
&gt;&gt;&gt;&gt; Usama,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt; Hi<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; I have created a simple docker based example of using CERT authentication<br>
&gt;&gt;&gt;&gt; &gt; with Pgpool-II frontend connections  for the reference.<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; Please have a look and let me know what you think<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; <a href="https://github.com/codeforall/pgpool_cert_auth" rel="noreferrer" target="_blank">https://github.com/codeforall/pgpool_cert_auth</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Unfortunately it does not work for me.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; docker exec -it clientnode sudo -u postgres psql &quot;sslmode=require<br>
&gt;&gt;&gt;&gt; port=9999 host=172.22.0.52 dbname=postgres user=certuser&quot; -c &quot;show<br>
&gt;&gt;&gt;&gt; pool_nodes&quot;<br>
&gt;&gt;&gt;&gt; psql: server does not support SSL, but SSL was required<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt; This is very strange, I have rebuild the dockers by pulling the fresh code<br>
&gt;&gt;&gt; from repo and can run the test successfully.<br>
&gt;&gt;&gt; Seems like setting of ssl configuration is failing.<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; can you please help me identify the issue by sending the log of<br>
&gt;&gt;&gt; &quot;docker-compose up &quot; and of the output of following commands<br>
&gt;&gt; <br>
&gt;&gt; Sure. Log attached.<br>
&gt;&gt; <br>
&gt;&gt;&gt; docker exec -it pgmaster  /bin/bash -c &#39;cat $PGDATA/postgresql.conf&#39;<br>
&gt;&gt; <br>
&gt;&gt; Attached (1.txt).<br>
&gt;&gt; <br>
&gt;&gt;&gt; docker exec -it pgmaster  /bin/bash -c &#39;cd $PGDATA/log &amp;&amp; cat &quot;$(ls -1rt  |<br>
&gt;&gt;&gt; tail -n1)&quot;&#39;<br>
&gt;&gt; <br>
&gt;&gt; Attached (2.txt). <br>
&gt;&gt; <br>
&gt;&gt;&gt; docker exec -it pgslave  /bin/bash -c &#39;cat $PGDATA/postgresql.conf&#39;<br>
&gt;&gt; <br>
&gt;&gt; Attached (3.txt).<br>
&gt;&gt; <br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; docker exec -it pgslave  /bin/bash -c &#39;cd $PGDATA/log &amp;&amp; cat &quot;$(ls -1rt  |<br>
&gt;&gt;&gt; tail -n1)&quot;&#39;<br>
&gt;&gt; <br>
&gt;&gt; Attached (4.txt).<br>
&gt;&gt; <br>
&gt;&gt;&gt; docker exec -it pgpoolnode  /bin/bash -c &#39;cat ${PGPOOLCONF}/pgpool.conf&#39;<br>
&gt;&gt; <br>
&gt;&gt; Attached (5.txt).<br>
&gt;&gt; <br>
&gt;&gt;&gt;&gt; Also I noticed you do not use Pgpool-II RPMs provided by Pgpool-II<br>
&gt;&gt;&gt;&gt; community:<br>
&gt;&gt;&gt;&gt; <a href="https://pgpool.net/mediawiki/index.php/Yum_Repository" rel="noreferrer" target="_blank">https://pgpool.net/mediawiki/index.php/Yum_Repository</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Is there any reason for this?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; No reason as such, I just installed the Pgpool rpms from same repo from<br>
&gt;&gt;&gt; where I was getting the PG server.<br>
&gt;&gt;&gt; I have update the docker files to use the pgpool community rpms instead.<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; <a href="https://github.com/codeforall/pgpool_cert_auth/commit/218f7536330677597552330199d0fd637f88d5b0" rel="noreferrer" target="_blank">https://github.com/codeforall/pgpool_cert_auth/commit/218f7536330677597552330199d0fd637f88d5b0</a><br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; Thanks<br>
&gt;&gt;&gt; Best Regards<br>
&gt;&gt;&gt; Muhammad Usama<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt; Best regards,<br>
&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt; Tatsuo Ishii<br>
&gt;&gt;&gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt;&gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt;&gt;&gt;&gt; Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
&gt;&gt;&gt;&gt;<br>
</blockquote></div>