PostgreSQL Preparation
 | PostgreSQL version
RHQ currently supports versions 8.2.4 through 8.2.6 of PostgreSQL.
Earlier versions are not recommended. |
RHQ's usage of PostgreSQL requires a few changes to the database configuration. Edit the postgresql.conf file and change or add the following:
## performance changes for RHQ
shared_buffers = 10000
work_mem = 2048
statement_timeout = 30000
checkpoint_segments = 10
max_fsm_pages = 100000
See http://www.cyberciti.biz/tips/postgres-allow-remote-access-tcp-connection.html for information on setting up remote access to your PostgreSQL if you have the database server on a different box than your RHQ Server.
RHQ will use up to 110 database connections for the server. PostgreSQL also allows for connections reserved for administrators. Those connections are counted in the pool of max_connections, so they need to be added to the total number of max_connections. Assuming we have 5 connections reserved for the administrator, then change this in the postgresql.conf file as follows:
max_connections = 115
superuser_reserved_connections = 5
If you are using the PostgreSQL RHQ agent plugin to monitor this database instance, add one more connection per (logical) database you have in PostgreSQL - this extra connection will allow the agent to periodically probe the database.
Additionally, depending on the OS you are using, you may need to adjust some kernel parameters as described here.
You will need to create a role that RHQ will use to connect to PostgreSQL. For more details of how to do that, see here.
Finally you'll need to update the pg_hba.conf file to allow the role you just created to connect from the machine the RHQ Server will be installed on, e.g. localhost. For more details on how to do that, see here.
Restart PostgreSQL, so the changes take effect. The database is now ready to support a RHQ installation.