GitLab installation on Omnibus - jrcloudsolutions/tidbits GitHub Wiki

https://docs.gitlab.com/ee/install/installation.html#7-database docs.gitlab.com/omnibus/installation/index.html

Add the postgreSQL repo sudo dnf install .....

  1. Install the DB back end 1.1 Disable the built-in PostgreSQL module: Since RHEL uses a built-in PostgreSQL module, you'll need to disable it to prevent conflicts with the version that you are installing from the PostgreSQL repo: ** sudo dnf -qy module disable postgresql **

  2. Install PostgreSQL 16: ** sudo dnf install -y postgresql16-server **

  3. Initialize the PostgreSQL database: ** sudo /usr/pgsql-16/bin/postgresql-16-setup initdb **

  4. Enable and start PostgreSQL: ** sudo systemctl enable postgresql-16 ** ** sudo systemctl start postgresql-16 **

  5. Verify PostgreSQL: ** sudo -u postgres psql **

  6. psql --version

  7. sudo -i su postgres (change to actual 1. Install the DB back end 1.1 Disable the built-in PostgreSQL module: Since RHEL uses a built-in PostgreSQL module, you'll need to disable it to prevent conflicts with the version that you are installing from the PostgreSQL repo: ** sudo dnf -qy module disable postgresql **

  8. Install PostgreSQL 16: ** sudo dnf install -y postgresql16-server **

  9. Initialize the PostgreSQL database: ** sudo /usr/pgsql-16/bin/postgresql-16-setup initdb **

  10. Enable and start PostgreSQL: ** sudo systemctl enable postgresql-16 ** ** sudo systemctl start postgresql-16 **

  11. Verify PostgreSQL: ** sudo -u postgres psql ** psql (shows the version of the postgresql.conf config file)

  12. We want the DB to be in /data volume

/var/lib/pgsql/16/data/ <=====

nano /var/lib/psql... Then, update /data/repo

Then, sudo systemctl stop postgressql-16, then start

Change ownership sudo -R postgres:postgres /repo

rsync -av /var/lib/pgsql/16/data/ /data/repo (to sync the source directory to the target one. -av = verbose. This is a one-time command)

Once the DB is configured, then create a database user for GitLab:

sudo adduser --system git (need to add the git linux user first) sudo -u postgres psql -d template1 -c "CREATE USER git CREATEDB;"

sudo -u postgres psql -d template1 -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;"