0

I did setup streaming replication on the Ubuntu 12.04 LTS with rsyncing of the WAL files in case of failure. Now I was trying to do the same on the CentOS 6.5.

To do this I've added official RPM from postgresql.org and installed postgresql 9.1 using yum.

Everything is fine till the step where I should create the recovery.conf file.

It is enough just to create even empty recovery.conf file in the $PDATA directory so PostgreSQL won't start:

DEBUG:      PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
DEBUG:      MAIL=/var/spool/mail/root
DEBUG:      LC_IDENTIFICATION=pl_PL.UTF-8
DEBUG:      PWD=/var/lib/pgsql
DEBUG:      LANG=en_US.UTF-8
DEBUG:      LC_MEASUREMENT=pl_PL.UTF-8
DEBUG:      SELINUX_LEVEL_REQUESTED=
DEBUG:      HISTCONTROL=ignoredups
DEBUG:      HOME=/var/lib/pgsql
DEBUG:      SHLVL=2
DEBUG:      LOGNAME=postgres
DEBUG:      SSH_CONNECTION=10.255.0.142 41803 10.255.0.186 22
DEBUG:      LESSOPEN=|/usr/bin/lesspipe.sh %s
DEBUG:      LC_TIME=C
DEBUG:      G_BROKEN_FILENAMES=1
DEBUG:      LC_NAME=pl_PL.UTF-8
DEBUG:      _=/usr/pgsql-9.1/bin/postgres
DEBUG:      PGLOCALEDIR=/usr/pgsql-9.1/share/locale
DEBUG:      PGSYSCONFDIR=/etc/sysconfig/pgsql
DEBUG:      LC_COLLATE=en_US.UTF-8
DEBUG:      LC_CTYPE=en_US.UTF-8
DEBUG:      LC_MESSAGES=pl_PL.UTF-8
DEBUG:  -----------------------------------------
DEBUG:  invoking IpcMemoryCreate(size=39288832)
DEBUG:  usuwanie pliku "pg_notify/0000" # removing file
DEBUG:  max_safe_fds = 984, usable_fds = 1000, already_open = 6
DEBUG:  zatrzymanie rejestratora # means stop registry/registrator
DEBUG:  shmem_exit(0): 0 callbacks to make
DEBUG:  proc_exit(0): 0 callbacks to make
DEBUG:  exit(0)
DEBUG:  shmem_exit(-1): 0 callbacks to make
DEBUG:  proc_exit(-1): 0 callbacks to make

The same when running gdb:

DEBUG:  shmem_exit(0): 0 callbacks to make
DEBUG:  proc_exit(0): 0 callbacks to make
DEBUG:  exit(0)
DEBUG:  shmem_exit(-1): 0 callbacks to make
DEBUG:  proc_exit(-1): 0 callbacks to make

Program exited with code 01.
(gdb) bt
No stack.

with -d 5 and LC=C (too long to fit into post) http://pastebin.com/Z7t1CEwg

Without that recovery.conf file PostgreSQL is running normally.

Has anyone faced such issue?

mickula
  • 342
  • 1
  • 2
  • 10
  • Actually, from the translation file: ` #: postmaster/syslogger.c:517 #, c-format msgid "logger shutting down" msgstr "zatrzymanie rejestratora"` . So the message is `logger shutting down`. The real cause of the shutdown is much earlier in the logs. Run with a lower debug setting, or just look further back. Consider running the server with `LANG=C LC_ALL=C` as well, so you get English messages to paste here. – Craig Ringer Mar 20 '14 at 00:58
  • @CraigRinger thank you for suggestion. I've uploaded full debug info to pastebin: http://pastebin.com/Z7t1CEwg - seems like LC=C LANG=C LC_MESSAGES=C doesn't do anything :/ – mickula Mar 20 '14 at 09:08
  • Weird. And if you create a non-empty, valid recovery.conf do you see the same outcome? – Craig Ringer Mar 20 '14 at 09:26
  • Yup, even when I copy the recovery.conf from the Ubuntu where streaming replication works it's the same. I've been also messing with file permissions but looking at the source of postgres it's not the issue I believe. – mickula Mar 20 '14 at 09:34
  • That's bizarre. I'd expect to see _something_ in the logs. What's the exact command you use to start the server? – Craig Ringer Mar 20 '14 at 09:49
  • Normally i start it using `service postgresql-9.1 start` but to get debug I use `/usr/pgsql-9.1/bin/postgres -D /var/lib/pgsql/9.1/data -d 5` from the `postgres` user – mickula Mar 20 '14 at 10:25
  • SElinux? A mislabeled recovery.conf or other file? Try to `setenforce 0` before starting Postgres. I suppose you use self-compiled Postgres, so I don't think it is labeled correctly. But remember that running without SELinux disables many security features of CentOS. – Tometzky Mar 25 '14 at 22:44
  • As I stated I'm using postgresql from postgres official yum repository. – mickula Mar 26 '14 at 10:30

1 Answers1

0

The problem does not happen on CentOS x64. This is just temporal workaround but I'm accepting it not having better answer.

mickula
  • 342
  • 1
  • 2
  • 10
  • You mean you were not using 64 bit distro so far? 32 bit os aren't recommended nowadays except for embedded systems –  Apr 02 '14 at 06:10
  • well those were virtualized CentOSes on the Ubuntu 12.04 LTS 32 bit running on the CPU without virtualization support so I couldn't do it another way. What still does not explain why official yum repo from postgres contains x32 database distribution bugged or how-you-call-it in such weird way. – mickula Apr 02 '14 at 12:13