1

I am just leaning streaming replication using postgres Db, trying to achieve something as described here :- https://cloud.google.com/community/tutorials/setting-up-postgres-hot-standby

I have done all the configurations as mentioned for both master and standby server.But in my case I am using Postgres version 10.3.

So while running the pg_basebackup command I am getting below error:-

[vagrant@postgres1 bin]$ ./pg_basebackup -h /tmp/ -p 5432 -D /home/vagrant/postgres/data2 -P -v --wal-method=stream

pg_basebackup: initiating base backup, waiting for checkpoint to complete
pg_basebackup: checkpoint completed
pg_basebackup: write-ahead log start point: 0/2D000028 on timeline 1
pg_basebackup: starting background WAL receiver
33824/33824 kB (100%), 1/1 tablespace
pg_basebackup: write-ahead log end point: 0/2D0000F8
pg_basebackup: waiting for background process to finish streaming ...
pg_basebackup: could not send copy-end packet: no COPY in progress
pg_basebackup: child process exited with error 1
pg_basebackup: removing data directory "/home/vagrant/postgres/data2"

But while executing pg_basebackup with --wal-method=fetch option it completed successfully

[vagrant@postgres1 bin]$ ./pg_basebackup -h /tmp/ -p 5432 -D /home/vagrant/postgres/data2 -P -v --wal-method=fetch

pg_basebackup: initiating base backup, waiting for checkpoint to complete
pg_basebackup: checkpoint completed
pg_basebackup: write-ahead log start point: 0/2F000028 on timeline 1
50209/50209 kB (100%), 1/1 tablespace
pg_basebackup: write-ahead log end point: 0/2F0000F8
pg_basebackup: base backup completed

But what I want is the real time replication of the primary to the secondary, which is possible by --wal-method=stream option.

Please let if any has inputs for the same.

Thanks in advance

  • You might find a more complete error message in the master PostgreSQL server's log file. Also, you should use the most recent bug-fix version of whatever major version of the database you are using, which is 10.6, not 10.3. – jjanes Nov 30 '18 at 15:48
  • The error I am getting in the log file is something like :-2018-12-03 04:59:08.120 UTC [6898] LOG: could not receive data from client: Connection reset by peer 2018-12-03 04:59:08.120 UTC [6898] LOG: unexpected EOF on standby connection – Roshmi Bhattacharjee Dec 3 '18 at 5:07
  • This is often the type of message you get when a firewall or gateway is interfering with the connection. I suspect something is enforcing an unwise idle timeout, or something like that. – jjanes Dec 4 '18 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.