postgresql icon indicating copy to clipboard operation
postgresql copied to clipboard

Allow multiple clusters on RedHat

Open gclough opened this issue 8 years ago • 3 comments

Using multiple clusters in RedHat doesn't work, apparently due to SELinux. My testing shows that we can, so long as we use:

/var/lib/pgsql/{{ postgresql_version }}/{{ postgresql_cluster_name }}/data

By default this will end up in:

/var/lib/pgsql/{{ postgresql_version }}/main/data

Which also neatly allows us to separate out the pg_wal, pg_xlog into something like this, and stay within the SELinux restrictions:

/var/lib/pgsql/{{ postgresql_version }}/main/pg_wal

My changes include changes to:

  • Default RedHat variables (Remove the hardcoding of the cluster_name, and change data directory name)
  • configure.yml script (Change service name to include the cluster name)
  • Removal of the old template for the default service directory
  • Addition of a new template for the NEW service name

gclough avatar Mar 05 '18 16:03 gclough

It seems that the current playbook creates the "systemd" files on CentOS v6... even though they are ignored there. This change restricts those changes to CentOS v7 and later, whilst leaving the current behaviour for CentOS v6 "service".

To achieve this, I've had to add an extra layer to the system-wide variables, so now there is "vars/CentOS-7.yml", as well as the current "vars/CentOS.yml. It will pick the most detailed one.

gclough avatar Mar 06 '18 18:03 gclough

It seems that the current playbook creates the "systemd" files on CentOS v6... even though they are ignored there. This change restricts those changes to CentOS v7 and later, whilst leaving the current behaviour for CentOS v6 "service".

To achieve this, I've had to add an extra layer to the system-wide variables, so now there is "vars/CentOS-7.yml", as well as the current "vars/CentOS.yml. It will pick the most detailed one.

We can use ansible_service_mgr fact instead of using CentOS versions variables. This is more scalable.

dracic avatar Aug 27 '19 11:08 dracic