ANXS / postgresql

Fairly full featured Ansible role for Postgresql.
http://anxs.io/
MIT License
855 stars 576 forks source link

During database crash, RedHat can't find pg_ident.conf #309

Open gclough opened 6 years ago

gclough commented 6 years ago

If the database crashes, then during crash recovery it looks for pg_ident.conf... and fails:

2018-03-20 15:07:25 UTC [11965]: [3-1] user=,db=,app=,client= LOG:  could not open usermap file "/etc/postgresql/9.6/data/pg_ident.conf": No such file or directory
2018-03-20 15:07:25 UTC [11967]: [1-1] user=,db=,app=,client= LOG:  database system was interrupted while in recovery at 2018-03-20 15:05:24 UTC
2018-03-20 15:07:25 UTC [11967]: [2-1] user=,db=,app=,client= HINT:  This probably means that some data is corrupted and you will have to use the last backup for recovery.

By default on RedHat/CentOS this should be in $PGDATA, but because of the "Ubuntu" layout this file is expected to be in /etc/postgresql/{{ postgresql_version }}/data:

ident_file = '/etc/postgresql/9.6/data/pg_ident.conf' # ident configuration file

... but it's currently in $PGDATA/pg_ident.conf

Personally I'd prefer to see this playbook configure more of a "RedHat" layout, which means putting everything into $PGDATA, and not scattering things into /etc/postgresql...

aoyawale commented 6 years ago

agreed. will have to make a change somewhere were each distro can have their default location.

gclough commented 6 years ago

This should get fixed by #288, but will likely need a lot of merging due to the recent changes. I'll see what I can sort out.