[pgpool-general: 8194] Re: Setting up an streaming replication cluster is giving me trouble

Bo Peng pengbo at sraoss.co.jp
Mon May 30 20:26:19 JST 2022


Hello,

> I have managed to get a bit further, by adding
>      echo "listen_addresses = '*'" >> $CONF
> to pgpool_setup. Now I get the following error, for nodes 1 and 2:
> 
> recovery node 1...ERROR:  recovery is checking if postmaster is started
> DETAIL:  postmaster on hostname:"/tmp" database:"template1" 
> user:"postgres" failed to start in 90 second
> 
> There is no postgresql started on the data folder for those nodes, and I 
> see that in bash function create_followers there is a call to $STARTALL 
> if mode is not 's', but there is nothing like it in case the setup is 
> for stream replication. Could it be that there is a call to start those 
> other node's servers missing?

SSH login without password must be configured.
For example, if you run pgpool_setup using postgres user,
the postgres user must be allowed to ssh login to localhost without password.

Run ssh-keygen and add the public key to ".ssh/authorized_keys".

> Regards!
> 
> ---
> Felix Rubio
> "Don't believe what you're told. Double check."
> 
> On 2022-05-26 14:18, Felix Rubio wrote:
> > Hi everybody!
> > 
> > I am trying to set up a streaming replication cluster, using docker
> > containers based on alpine. Inside the container, this is what I am
> > doing right now:
> > 
> > apk add postgresql14
> > curl -s
> > https://raw.githubusercontent.com/pgpool/pgpool2/master/src/sample/pgpool.conf.sample-stream
> > > /etc/pgpool/pgpool.conf.sample
> > curl -s
> > https://raw.githubusercontent.com/pgpool/pgpool2/master/src/sample/pool_hba.conf.sample
> > > /etc/pgpool/pool_hba.conf.sample
> > cd /scratch
> > rm -rf * && su-exec postgres pgpool_setup -n 3
> > 
> > This is the output I am getting:
> > --------------------
> > /scratch # rm -rf * && su-exec postgres pgpool_setup -n 3
> > PostgreSQL major version: 140
> > Starting set up in streaming replication mode
> > creating startall and shutdownall
> > creating failover script
> > creating database cluster /scratch/data0...done.
> > update postgresql.conf
> > creating pgpool_remote_start
> > creating basebackup.sh
> > creating recovery.conf
> > creating database cluster /scratch/data1...done.
> > update postgresql.conf
> > creating pgpool_remote_start
> > creating basebackup.sh
> > creating recovery.conf
> > creating database cluster /scratch/data2...done.
> > update postgresql.conf
> > creating pgpool_remote_start
> > creating basebackup.sh
> > creating recovery.conf
> > temporarily start data0 cluster to create extensions
> > temporarily start pgpool-II to create standby nodes
> > 2022-05-26 12:13:04.670: main pid 1861: FATAL:  could not read pid file
> > psql: error: connection to server on socket "/tmp/.s.PGSQL.11000"
> > failed: No such file or directory
> > 	Is the server running locally and accepting connections on that 
> > socket?
> > psql: error: connection to server on socket "/tmp/.s.PGSQL.11000"
> > failed: No such file or directory
> > 	Is the server running locally and accepting connections on that 
> > socket?
> > psql: error: connection to server on socket "/tmp/.s.PGSQL.11000"
> > failed: No such file or directory
> > 	Is the server running locally and accepting connections on that 
> > socket?
> > [..... this message appears a number of times ....]
> > recovery node 1...ERROR: connection to host "localhost" failed with
> > error "Connection refused"
> > done.
> > recovery node 2...ERROR: connection to host "localhost" failed with
> > error "Connection refused"
> > done.
> > creating follow primary script
> > psql: error: connection to server on socket "/tmp/.s.PGSQL.11000"
> > failed: No such file or directory
> > 	Is the server running locally and accepting connections on that 
> > socket?
> > shutdown all
> > 
> > pgpool-II setting for streaming replication mode is done.
> > To start the whole system, use /scratch/startall.
> > To shutdown the whole system, use /scratch/shutdownall.
> > pcp command user name is "postgres", password is "postgres".
> > Each PostgreSQL, pgpool-II and pcp port is as follows:
> > #1 port is 11002
> > #2 port is 11003
> > #3 port is 11004
> > pgpool port is 11000
> > pcp port is 11001
> > The info above is in README.port.
> > --------------------
> > 
> > I have checked and, indeed, the socket /tmp/.s.PGSQL.11000 does not
> > exist. If I run a ps during the script execution, I can see the
> > postgres server running:
> > --------------------
> >  2247 postgres  0:00 /usr/libexec/postgresql14/postgres -D data0
> >  2248 postgres  0:00 postgres: logger
> >  2250 postgres  0:00 postgres: checkpointer
> >  2251 postgres  0:00 postgres: background writer
> >  2252 postgres  0:00 postgres: walwriter
> >  2253 postgres  0:00 postgres: autovacuum launcher
> >  2254 postgres  0:00 postgres: archiver
> >  2255 postgres  0:00 postgres: stats collector
> >  2256 postgres  0:00 postgres: logical replication launcher
> > --------------------
> > 
> > So... I am kind of lost here... what can I do? Thank you!
> _______________________________________________
> 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
http://www.sraoss.co.jp/



More information about the pgpool-general mailing list