You can choose to install and manage a database server (PostgreSQL/MySQL) yourself, or you can use GitSwarm package installations to help. GitSwarm recommends PostgreSQL. This is the database that will be installed if you use the package installation to manage your database.
If you're hosting GitSwarm on a cloud provider, you can optionally use a managed service for PostgreSQL. For example, AWS offers a managed Relational Database Service (RDS) that runs PostgreSQL.
If you use a cloud-managed service, or provide your own PostgreSQL:
gitlab
username with a password of your choice. The gitlab
user needs privileges to create the gitlabhq_production
database.Create/edit /etc/gitswarm/gitswarm.rb
and use the following configuration. Be sure to change the external_url
to match your eventual GitSwarm front-end URL.
external_url 'https://gitswarm.example.com'
# Disable all components except PostgreSQL
postgresql['enable'] = true
bootstrap['enable'] = false
nginx['enable'] = false
unicorn['enable'] = false
sidekiq['enable'] = false
redis['enable'] = false
gitlab_workhorse['enable'] = false
mailroom['enable'] = false
# PostgreSQL configuration
postgresql['sql_password'] = 'DB password'
postgresql['md5_auth_cidr_addresses'] = ['0.0.0.0/0']
postgresql['listen_address'] = '0.0.0.0'
Run sudo gitswarm-ctl reconfigure
to install and configure PostgreSQL.
Note: This
reconfigure
step will result in some errors. That's OK - don't be alarmed.
Open a database prompt:
su - gitlab-psql
/bin/bash
psql -h /var/opt/gitswarm/postgresql -d template1
# Output:
psql (9.2.15)
Type "help" for help.
template1=#
Run the following command at the database prompt and you will be asked to enter the new password for the PostgreSQL superuser.
\password
# Output:
Enter new password:
Enter it again:
Similarly, set the password for the gitlab
database user. Use the same password that you specified in the /etc/gitswarm/gitswarm.rb
file for postgresql['sql_password']
.
\password gitlab
# Output:
Enter new password:
Enter it again:
Enable the pg_trgm
extension:
CREATE EXTENSION pg_trgm;
# Output:
CREATE EXTENSION
\q
and Enter.gitlab-psql
user by running exit
twice.sudo gitswarm-ctl reconfigure
a final time.Run touch /etc/gitswarm/skip-auto-migrations
to prevent database migrations from running on upgrade. Only the primary GitSwarm application server should handle migrations.
Read more on high-availability configuration: