Migrate Ops instance to CloudSQL
C4
Production Change - Criticality 4Change Objective | Migrate the current ops instance to using CloudSQL |
---|---|
Change Type | |
Services Impacted | ops.gitlab.net |
Change Team Members | @ahanselka @cindy |
Change Severity | C4 |
Buddy check or tested in staging | A colleague will review the change |
Schedule of the change | 2019-08-19 23:00 UTC |
Duration of the change | 1 hour or less |
Steps
-
Stop chef client on ops instance. -
Turn off puma and sidekiq on ops instance. gitlab-ctl stop puma
gitlab-ctl stop sidekiq
-
Dump the Postgres database sudo -u gitlab-psql /opt/gitlab/embedded/bin/pg_dump gitlabhq_production -h 127.0.0.1 -U gitlab > /tmp/gitlab.sql
-
Import DB to CloudSQL /opt/gitlab/embedded/bin/psql -h $cloudsql_ip -U gitlab gitlabhq_production < /tmp/gitlab.sql
-
Merge and apply chef-repo!1660 -
Run chef-client
onops.gitlab.net
and ensure puma and sidekiq are started
Rollback
- Revert chef-repo!1660 and run
chef-client
.
Edited by Alex Hanselka