diff options
Diffstat (limited to 'doc/administration/high_availability/database.md')
-rw-r--r-- | doc/administration/high_availability/database.md | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/doc/administration/high_availability/database.md b/doc/administration/high_availability/database.md index 8e57b049730..daeb0f9baf5 100644 --- a/doc/administration/high_availability/database.md +++ b/doc/administration/high_availability/database.md @@ -46,7 +46,7 @@ deploy the bundled PostgreSQL. and confirmation. Use the value that is output by this command in the next step as the value of `POSTGRESQL_PASSWORD_HASH`. - ```sh + ```shell sudo gitlab-ctl pg-password-md5 gitlab ``` @@ -202,7 +202,7 @@ When using default setup, minimum configuration requires: - `CONSUL_PASSWORD_HASH`. This is a hash generated out of Consul username/password pair. Can be generated with: - ```sh + ```shell sudo gitlab-ctl pg-password-md5 CONSUL_USERNAME ``` @@ -245,7 +245,7 @@ We will need the following password information for the application's database u - `POSTGRESQL_PASSWORD_HASH`. This is a hash generated out of the username/password pair. Can be generated with: - ```sh + ```shell sudo gitlab-ctl pg-password-md5 POSTGRESQL_USERNAME ``` @@ -258,7 +258,7 @@ When using default setup, minimum configuration requires: - `PGBOUNCER_PASSWORD_HASH`. This is a hash generated out of PgBouncer username/password pair. Can be generated with: - ```sh + ```shell sudo gitlab-ctl pg-password-md5 PGBOUNCER_USERNAME ``` @@ -376,13 +376,13 @@ Select one node as a primary node. 1. Open a database prompt: - ```sh + ```shell gitlab-psql -d gitlabhq_production ``` 1. Enable the `pg_trgm` extension: - ```sh + ```shell CREATE EXTENSION pg_trgm; ``` @@ -390,7 +390,7 @@ Select one node as a primary node. 1. Verify the cluster is initialized with one node: - ```sh + ```shell gitlab-ctl repmgr cluster show ``` @@ -411,7 +411,7 @@ Select one node as a primary node. 1. Set up the repmgr standby: - ```sh + ```shell gitlab-ctl repmgr standby setup MASTER_NODE_NAME ``` @@ -436,7 +436,7 @@ Select one node as a primary node. 1. Verify the node now appears in the cluster: - ```sh + ```shell gitlab-ctl repmgr cluster show ``` @@ -457,7 +457,7 @@ Before moving on, make sure the databases are configured correctly. Run the following command on the **primary** node to verify that replication is working properly: -```sh +```shell gitlab-ctl repmgr cluster show ``` @@ -475,7 +475,7 @@ If the 'Role' column for any node says "FAILED", check the Also, check that the check master command works successfully on each node: -```sh +```shell su - gitlab-consul gitlab-ctl repmgr-check-master || echo 'This node is a standby repmgr node' ``` @@ -512,7 +512,7 @@ attributes set, but the following need to be set. Ensure that all migrations ran: -```sh +```shell gitlab-rake gitlab:db:configure ``` @@ -702,7 +702,7 @@ After deploying the configuration follow these steps: Enable the `pg_trgm` extension - ```sh + ```shell gitlab-psql -d gitlabhq_production ``` @@ -714,7 +714,7 @@ After deploying the configuration follow these steps: Make this node a standby of the primary - ```sh + ```shell gitlab-ctl repmgr standby setup 10.6.0.21 ``` @@ -722,7 +722,7 @@ After deploying the configuration follow these steps: Make this node a standby of the primary - ```sh + ```shell gitlab-ctl repmgr standby setup 10.6.0.21 ``` @@ -730,13 +730,13 @@ After deploying the configuration follow these steps: Set `gitlab-consul` user's PgBouncer password to `toomanysecrets` - ```sh + ```shell gitlab-ctl write-pgpass --host 127.0.0.1 --database pgbouncer --user pgbouncer --hostuser gitlab-consul ``` Run database migrations - ```sh + ```shell gitlab-rake gitlab:db:configure ``` @@ -863,7 +863,7 @@ If you need to failover manually, you have two options: Run: -```sh +```shell gitlab-ctl stop postgresql ``` @@ -875,14 +875,14 @@ standby nodes. 1. Ensure the old master node is not still active. 1. Login to the server that should become the new master and run: - ```sh + ```shell gitlab-ctl repmgr standby promote ``` 1. If there are any other standby servers in the cluster, have them follow the new master server: - ```sh + ```shell gitlab-ctl repmgr standby follow NEW_MASTER ``` @@ -894,7 +894,7 @@ after it has been restored to service. - If you want to remove the node from the cluster, on any other node in the cluster, run: - ```sh + ```shell gitlab-ctl repmgr standby unregister --node=X ``` @@ -902,7 +902,7 @@ after it has been restored to service. To find this, you can use: - ```sh + ```shell awk -F = '$1 == "node" { print $2 }' /var/opt/gitlab/postgresql/repmgr.conf ``` @@ -914,13 +914,13 @@ after it has been restored to service. Then you will use this id to unregister the node: - ```sh + ```shell gitlab-ctl repmgr standby unregister --node=959789412 ``` - To add the node as a standby server: - ```sh + ```shell gitlab-ctl repmgr standby follow NEW_MASTER gitlab-ctl restart repmgrd ``` @@ -972,7 +972,7 @@ the previous section: 1. On the current master node, create a password for the `gitlab` and `gitlab_repmgr` user: - ```sh + ```shell gitlab-psql -d template1 template1=# \password gitlab_repmgr Enter password: **** @@ -992,7 +992,7 @@ the previous section: 1. Create a `.pgpass` file. Enter the `gitlab_repmgr` password twice to when asked: - ```sh + ```shell gitlab-ctl write-pgpass --user gitlab_repmgr --hostuser gitlab-psql --database '*' ``` |