PostgreSQL
PostgreSQL Quick Start Installation
PostgreSQL PreparationIf you do not have PostgreSQL installed, refer to PostgreSQL Quick Start Installation for steps on how to install PostgreSQL. postgresql.confPostgreSQL requires minor changes to the database configuration. Make the following changes to the postgresql.conf file: ## not necessary if the database is started with the -i flag listen_addresses = '*' ## performance changes for RHQ shared_buffers = 80MB # default is 32MB work_mem = 2048 # default is 1MB statement_timeout = 30s # default is 0s checkpoint_segments = 10 # default is 3 # NOTE: If you are running Postgres 8.4 or later, comment out the below line, as the # max_fsm_pages parameter is no longer supported by 8.4 or later. max_fsm_pages = 100000 # default is 204800 RHQ can use up to 55 database connections for the server. PostgreSQL also allows for connections reserved for administrators. These connections are counted in the pool of max_connections and therefore need to be added to the total number of max_connections. Assuming we have 5 connections reserved for the administrator, edit the postgresql.conf file as follows: max_connections = 60 # default is 100 superuser_reserved_connections = 5 # default is 3 max_prepared_transactions = 60 # default is 5 (in v8.3) or 0 (in v8.4) Note that max_prepared_transactions is set to the same value as max_connections as per http://www.postgresql.org/docs/8.2/interactive/runtime-config-resource.html where it says: "If you are using prepared transactions, you will probably want max_prepared_transactions to be at least as large as max_connections, to avoid unwanted failures at the prepare step." If you are using the Postgres plugin to monitor this database instance, add one more connection per (logical) database you have setup in PostgreSQL. For further information about this plugin refer to the Postgres Server section of the Managed Resources Guide. Kernel parametersDepending on the OS you are using, you may need to adjust some kernel parameters. Refer to http://www.postgresql.org/docs/8.2/interactive/kernel-resources.html for more information. pg_hba.confUpdate the pg_hba.conf file to allow the newly created role to connect from the machine the RHQ Server is installed on, (for example localhost). For details on how to do this refer to http://www.postgresql.org/docs/8.2/interactive/client-authentication.html. After completing the above step, restart PostgreSQL for the changes to take effect. If no errors are displayed, the database is now ready to support a RHQ installation. For more information on tuning PostgreSQL, see http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server. Fixes for "Relation RHQ_Principal does not exist" errorSometimes the database connection is marked as valid but the install still fails with the "Relation RHQ_Principal does not exist" error. This occurs when a new database is created by running initdb in a non-C locale. To fix this error:
Another option is to specify the encoding of the created database as SQL-ASCII at creation time. For example: initdb -D /my/test/data -E SQL_ASCII --locale en_US.UTF-8 Replace the directory after -D with your target directory for the database. |