Red Hat Training

A Red Hat training course is available for Red Hat Satellite

2.3.2. Database Partitioning

A mounted database partition provides various benefits such as scaling storage to accomodate a growing database, easy backup and transfer through replication, and encryption for added security.
To set up a database partition mount point, follow this procedure prior to installation.

Procedure 2.1. Creating and Mounting a Database Partition

  1. Log in to the database server as root. For Embedded Databases, this is the same server as the Red Hat Satellite.
  2. Create the postgres user.
    # useradd -d /var/lib/pgsql -M -r -s /bin/bash -U postgres
    
  3. Add the mount point in /etc/fstab. For example:
    UUID="xxxxxxxx-xxxx-xxxx" /opt/rh/postgresql92/root/var/lib/pgsql  ext4  defaults  0 0
    

    Important

    Red Hat does not support storing the database on a network filesystem.
  4. Mount the partition to /opt/rh/postgresql92/root/var/lib/pgsql and change ownership to postgres:postgres:
    # mkdir -p /opt/rh/postgresql92/root/var/lib/pgsql
    # mount /opt/rh/postgresql92/root/var/lib/pgsql
    # chown postgres:postgres /opt/rh/postgresql92/root/var/lib/pgsql
    # chmod 700 /opt/rh/postgresql92/root/var/lib/pgsql
    # restorecon -Rv /opt/rh/postgresql92/root/var/lib/pgsql
    
The Red Hat Satellite Installation Script will install the database to the partition mounted at /opt/rh/postgresql92/root/var/lib/pgsql.

Important

Due to an updated version of the PostgreSQL Embedded Database, the database location has changed from /var/lib/pgsql in Red Hat Satellite 5.6 to /opt/rh/postgresql92/root/var/lib/pgsql in Red Hat Satellite 5.7. Make sure to allocate enough hard disk space to this location.