DR: Simplify the instructions to configure the primary server
Description
Right now, we have to go through to multiple steps to set up the primary server (documentation).
sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql -d template1 -c "ALTER USER gitlab_replicator WITH ENCRYPTED PASSWORD 'thepassword'"- Modify
gitlab.rband add the following
geo_primary_role['enable'] = true
postgresql['listen_address'] = "1.2.3.4"
postgresql['trust_auth_cidr_addresses'] = ['127.0.0.1/32','1.2.3.4/32']
postgresql['md5_auth_cidr_addresses'] = ['5.6.7.8/32']
Proposal
- Create a new command (
gitlab-ctl setup-geo-primary) that will:- Automate the alteration of the
gitlab_replicatoruser - Edit `gitlab.rb with
- IP address of the primary detected automatically
- IP address of the secondary as taken from the prompt below
- Trigger a
reconfigureautomatically after processing the CLI
- Automate the alteration of the
Indicate a password for the Postgre automated user who will replicate data between nodes
PROMPT
Indicate the IP address of the secondary node:
PROMPT
Do you want to add another secondary node? Y/N
This first command could be merged with the actual gitlab-ctl set-geo-primary-node required at this step.