From 9cd5216dfcb8594c29197161b87769d4b15466c5 Mon Sep 17 00:00:00 2001 From: Alexis Mousset Date: Tue, 30 Aug 2016 13:29:08 +0200 Subject: [PATCH] Fixes #8908: Document separate database configuration in Rudder --- 4_advanced_usage/75_separate_database.txt | 79 +++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/4_advanced_usage/75_separate_database.txt b/4_advanced_usage/75_separate_database.txt index 6660dae7..40418c4d 100644 --- a/4_advanced_usage/75_separate_database.txt +++ b/4_advanced_usage/75_separate_database.txt @@ -6,6 +6,85 @@ The setup is done in two places: on the database server and on the Rudder root s It also allows moving an existing database to another server. +[TIP] + +.Use different user and database name + +==== + +It can be useful, for example if you want to share you databse server between several Rudder root server (see note below), +to use a different database for your Rudder root server. To do so: + +* Create the new database (replace `alternate_user_name`, `alternate_base_name` and specify a password): + +---- + +su - postgres -c "psql -q -c \"CREATE USER alternate_user_name WITH PASSWORD 'GENERATE_A_PASSWORD'\"" +su - postgres -c "psql -q -c \"CREATE DATABASE alternate_base_name WITH OWNER = alternate_user_name\"" + +---- + +* Initialize it. First copy the initialization script: + +---- + + cp /opt/rudder/etc/postgresql/reportsSchema.sql /opt/rudder/etc/postgresql/reportsSchema-alternate.sql + +---- + +* In the copied file, change the: + +---- + +ALTER database rudder SET standard_conforming_strings=true; + +---- + +To: + +---- + +ALTER database alternate_base_name SET standard_conforming_strings=true; + +---- + +* Then apply the script: + +---- + +su - postgres -c "psql -q -U alternate_user_name -h localhost -d alternate_base_name \ + -f /opt/rudder/etc/postgresql/reportsSchema-alternate.sql" + +---- + +* Follow the normal instructions, with two differences : + +** You need to adjust the line added to `pg_hba.conf` to match your user and database name. + +** You need to also change the database name and user in `rudder-web.properties`. + +==== + +[CAUTION] + +.Use the same database server for several Rudder root servers + +==== + +It is possible to share the same database server between several Rudder instances, +by following the preceding tip to use a different database than the default one. +However, there are some important points to know: + +* This database server can only be used as database and not for reports insertion +into the database using rsyslog. + +* This database server can only be a node for one of the Rudder servers. This also means that this +root server will have indirect access to the content of the other databases. + +==== + + + ==== On the database server * Install and configure the agent on the node, and install the *rudder-reports* package.