Browse files

docs: Add remote psql catalog maintenance chapter

- Add handling of script parameters to database encoding check.
- Add chapter about setting up a remote PostgreSQL database for bareos.

Fixes #927: Provide install instructions for database engine on different host
  • Loading branch information...
thraizz authored and franku committed Sep 21, 2018
1 parent 74c1251 commit c89bfb46c47e3af73a48040bd6d907281d6ae5eb
Showing with 48 additions and 4 deletions.
  1. +1 −1 core/src/cats/
  2. +47 −3 docs/manuals/en/main/catmaintenance.tex
@@ -127,7 +127,7 @@ ALTER DATABASE ${db_name} SET datestyle TO 'ISO, YMD';
if psql -l ${dbname} | grep " ${db_name}.*SQL_ASCII" >/dev/null; then
if psql -l ${dbname} $* | grep " ${db_name}.*SQL_ASCII" >/dev/null; then
echo "Database encoding OK"
echo " "
@@ -20,7 +20,7 @@ \section{Catalog Database}
The database often runs on the same server as the \bareosDir.
However, it is also possible to run it on a different system.
This might require some more manual configuration.
This might require some more manual configuration, a PostgreSQL example can be found in \nameref{catalog-maintenance-remote-psql}.
@@ -51,7 +51,8 @@ \subsection{dbconfig-common (Debian)}
The \package{dbconfig-common} configuration (and credentials) is done by the \package{bareos-database-common} package.
Settings are stored in the file \file{/etc/dbconfig-common/bareos-database-common.conf}.
The Bareos database backend will get automatically configured in \file{/etc/bareos/bareos-dir.conf}.
The Bareos database backend will get automatically configured in \file{/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf}.
If the Server is not running locally you need to specify \linkResourceDirective{Dir}{Catalog}{DB Address} in the catalog ressource.
A later reconfiguration might require manual adapt changes.
\warning{When using the PostgreSQL backend and updating to Bareos $<$ 14.2.3, it is necessary to manually grant database permissions (\command{grant_bareos_privileges}), normally by}
@@ -184,7 +185,7 @@ \subsubsection{PostgreSQL}
If your database is configured to to require a password, this must be definied in the file
If your database is configured to require a password, this must be definied in the file
in the following syntax: \parameter{HOST:PORT:DATABASE:USER:PASSWORD}, e.g.
\begin{config}{PostgreSQL access credentials}
@@ -335,6 +336,49 @@ \subsubsection{PostgreSQL}
\subsubsection{Remote PostgreSQL Database}
When configuring bareos with a remote database, your first step is to check the connection from the \bareosDir host into the database.
A functional connection can be verified by
\begin{commands}{Access the remote PostgreSQL database}
su - postgres
psql --host
With a correct configuration you can access the database, if it fails you need to correct the PostgreSQL servers configuration files.
One way to manually create the database would be calling the bareos database preparation scripts with the \parameter{--host} option, explained later.
How ever, it is advised to use the \package{dbconfig-common}.
Both methods require you to add the database hostname/address as \linkResourceDirective{Dir}{Catalog}{DB Address}.
If you're using \package{dbconfig-common} you should choose \parameter{New Host}, enter the hostname or the local address followed by the password.
As \package{dbconfig-common} uses the \parameter{ident} authentication by default the first try to connect will fail. Don't be bothered by that. Choose \parameter{Retry} when prompted. From there, read carefully and configure the database to your needs.
The authentication should be set to password, as the ident method will not work with a remote server.
Set the user and administrator according to your PostgreSQL servers settings.
Set the PostgreSQL server IP as \linkResourceDirective{Dir}{Catalog}{DB Address} in \nameref{DirectorResourceCatalog}.
You can also customize other parameters or use the defaults. A quick check should display your recent changes:
\begin{commands}{Show current database configuration}
<command> </command><parameter>/usr/sbin/bareos-dbcheck -B</parameter>
If \package{dbconfig-common} did not succeed or you choosed not to use it, run the Bareos database preparation scripts with:
\begin{commands}{Setup Bareos catalog database}
su - postgres

0 comments on commit c89bfb4

Please sign in to comment.