2

I've been running a CakePHP installation on OpenShift for six months. The database is PostgreSQL 9.2, i used to setup the postgresql.conf file via shell, editing postgresql/data/postgresql.conf (there is another postgresql.conf file in postgresql/conf/postgresql.conf that didn't keep the changes after db restarts), after setting up the file for the first time everything was ok until today that i git pushed some changes, restarted the application hence the database, and the application was showing me errors related with database datestyle, verifiyng that the postgresql/data/postgresql.conffile was reset, i tried to change the default configuration but after restarting the application it was overwrited by openshift to its defaults.

I'm using this git repository for the set up https://github.com/BanzaiMan/openshift-cakephp-example-postgresql

Did Openshift changed the way to configure postgresql.conf? Is there any other way to change postgresql.conf default values?

I need to change

#------------------------------------------------------------------------------
# CLIENT CONNECTION DEFAULTS
#------------------------------------------------------------------------------
# - Locale and Formatting -

datestyle = 'iso, mdy'  
lc_messages = 'en_US.utf8'  
lc_monetary = 'en_US.utf8'  
lc_numeric = 'en_US.utf8'  
lc_time = 'en_US.utf8'  
default_text_search_config = 'pg_catalog.english'  

to this

datestyle = 'iso, dmy'  
lc_messages = 'es_BO.utf8'  
lc_monetary = 'es_BO.utf8'  
lc_numeric = 'es_BO.utf8'  
lc_time = 'es_BO.utf8'  
default_text_search_config = 'pg_catalog.english'  

UPDATE

The issue has been reported: https://bugzilla.redhat.com/show_bug.cgi?id=1123587

3 Answers 3

1

You should not edit the data/postresql.conf directly as this configuration is regenerated after application start/restart.

I added OPENSHIFT_POSTGRESQL_LOCALE environment variable you can use to change the default locale. It should be available in the next release of Online.

https://github.com/openshift/origin-server/pull/5664

Thanks for reporting this! If you need more configuration tweaking, please open an bug :-)

Sign up to request clarification or add additional context in comments.

1 Comment

Can i ask when is it going to be the next release of Online?
1

Some of the values can be changed as mentioned in the following article https://www.openshift.com/blogs/more-online-features-for-april-2014. Here's how I changed the max number of connections.

SHOW max_connections;
max_connections 
-----------------
100
(1 row)

Then set the environment variable:

rhc env-set OPENSHIFT_POSTGRESQL_MAX_CONNECTIONS=200 -a ruby
Setting environment variable(s) ... done

Restart the application

rhc app restart ruby

Then re-check the parameters:

 SHOW max_connections;
 max_connections 
 -----------------
 200
 (1 row)

Comments

0

You can add any modifications you want to a ConfigMap and then mount it to /opt/app-root/src/postgresql-cfg/yourModifications.conf

All the *.conf files from that folder will be included at the bottom of the generated postgresql.conf on runtime.

Source: https://github.com/sclorg/postgresql-container/tree/master/examples/custom-config

I have tested it on OpenShift 3.9 and 3.11.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.