YanChii / ansible-role-postgres-ha

Create postgresql HA auto-failover cluster using pcs, pacemaker and PAF
Apache License 2.0
33 stars 22 forks source link

Error in "init DB dir on master if necessary" step for Postgresql 10 #18

Closed benmccown closed 5 years ago

benmccown commented 5 years ago

I'm trying to use this role to deploy Postgres 10 after using it for quite a few 9.6 clusters over the last couple months.

The postgresql_sync.yml play fails on the "init DB dir on master if necessary" due to a change in the filename for postgres version 10 (and I'm guessing above.)

In the bin dir for postgres 9.6:

[root@sol-usgp2-postgres-service-01-d bin]# pwd
/usr/pgsql-9.6/bin
[root@sol-usgp2-postgres-service-01-d bin]# ls postgres*
postgres  postgresql96-check-db-dir  postgresql96-setup

Notice the "postgresql96-setup" script

Now in postgres 10's bin dir:

[root@sol-usgp2-postgres-test-01-d bin]# pwd
/usr/pgsql-10/bin
[root@sol-usgp2-postgres-test-01-d bin]# ls postgres*
postgres  postgresql-10-check-db-dir  postgresql-10-setup

Notice the added dash after "postgresql" in "postgresql-10-setup"

This seems to cause some obvious problems with the playbook.

benmccown commented 5 years ago

Note that this is with the latest version of CentOS (7.6)

benmccown commented 5 years ago

I have have committed a solution to my fork and will create a pull request shortly after some more testing

YanChii commented 5 years ago

It looks like there's more needed to have PG 10 fully operational. At least, we need a new version of PAF. I've pushed a new PR #21 to cover that. But there's an issue in PAF module itself with checking of notify parameter. The status can be seen here: ClusterLabs/PAF#141

Jan

benmccown commented 5 years ago

Sounds good. I have run out of time today but hope to test Postgres 10 more tomorrow (Friday) and through next week.

Thanks, Ben

YanChii commented 5 years ago

Done.

I've created a PR to ClusterLabs/PAF and meanwhile I've created a patch that is applied during the PAF install in this role. Tested and working with PG versions 9.6, 10, 11. Happy ansibling.

Jan

PS: together with this, I've pushed my additional optional PAF patch that helps to better handle cluster network splits. It can be enabled by postgres_ha_paf_geo_patch variable. More info here.