Chapter 2. Modifying the Postgresql Configuration
This procedure modifies the strategy used for making changes to the PostgreSQL configuration. Previously, changes were made directly to the postgresql.conf
file in the data directory. After switching to the new configuration, changes will be made by editing a separate file in the /etc/manageiq/postgresql.conf.d
directory. This modification allows future PostgreSQL configuration changes to be made more easily.
The 01_miq_overrides.conf
file in the /etc/manageiq/postgresql.conf.d
directory is reserved for application overrides and will be recreated on application updates; this file should not be edited. Additional files will be read by the PostgreSQL server process according to the documentation here: https://www.postgresql.org/docs/9.5/config-setting.html#CONFIG-INCLUDES.
Back up the
postgresql.conf
file so that you have any configuration changes:# cp $APPLIANCE_PG_DATA/postgresql.conf <file_location>
Copy the updated
postgresql.conf
file to thepg_data
directory:# cp $APPLIANCE_SOURCE_DIRECTORY/TEMPLATE/var/opt/rh/rh-postgresql95/lib/pgsql/data/postgresql.conf $APPLIANCE_PG_DATA/postgresql.conf
Optional: If you have made changes to the
postgresql.conf
file prior to following this procedure, create a new02_user_overrides.conf
file, and add any modifications you have from the originalpostgresql.conf
file. Example layout of the02_user_overrides.conf
file:#---------------------------------------------- # WRITE AHEAD LOG #---------------------------------------------- wal_level = 'logical' wal_log_hints = on wal_buffers = 16MB min_wal_size = 1GB max_wal_size = 2GB checkpoint_completion_target = 0.9
Once the
02_user_overrides.conf
file has been modified and saved, restart thepostgresql
service:# systemctl restart $APPLIANCE_PG_SERVICE
All postgresql.conf
customizations will now be made to files in the /etc/manageiq/postgresql.conf.d
directory due to the following include_dir
line in the default configuration. The settings in these new files will override ones in the postgresql.conf
file.
include_dir = '/etc/manageiq/postgresql.conf.d`