Skip to content

Commit 8c6b3cb

Browse files
committed
updates postgres information, circle customizations and adds vault setup info
1 parent 680839e commit 8c6b3cb

File tree

1 file changed

+39
-8
lines changed

1 file changed

+39
-8
lines changed

jekyll/_cci2/high-availability.md

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ If you are brand new to MongoDB, see the [MongoDB on the AWS Cloud](https://docs
102102
103103
It is best practice to set up PostgreSQL 9.5 or later using Amazon Relational Database Service (Amazon RDS) with multi Availability Zone (multi-AZ) mode for automated backups and failover. Refer to the [Amazon RDS Multi-AZ Deployments](https://aws.amazon.com/rds/details/multi-az/) documentation for details.
104104
105+
Five databases are required for 2.0 services:
106+
107+
* `vms`
108+
* `conductor_production` with extension `uuid-ossp` enabled
109+
* `contexts_service_production` with extension `uuid-ossp` enabled
110+
* `cron_service_production`
111+
* `circle` with extensions `pgcrypto` and `uuid-ossp` enabled
112+
105113
## Exporting Existing Databases
106114
107115
**Note:** This process will require downtime. Please schedule an outage window with CircleCI users.
@@ -136,10 +144,10 @@ It is best practice to set up PostgreSQL 9.5 or later using Amazon Relational Da
136144
sudo mongorestore -u $USERNAME -p $PASSWORD /$PATH/$TO/$MONGO_DUMP
137145
```
138146
139-
1. On the Services machine where you ran the export script, use the following `psql` command to restore the database replacing the variables with the approrpiate user credentials and the name of the PostgreSQL database.
147+
1. On the Services machine where you ran the export script, use the following `psql` command to restore the databases, replacing the variables with the appropriate user credentials and the name of the PostgreSQL database.
140148
141149
```
142-
psql -U $USERNAME $DBNAME < $EXPORTED_CIRCLECI.sql
150+
psql -U $USERNAME $DBNAME < $EXPORTED_CIRCLECI_DBNAME.sql
143151
```
144152
145153
## Configuring Automatic Recovery
@@ -263,6 +271,18 @@ The encryption keys are plain text files for easy backup from the `/data/circle/
263271
264272
Restore the directory to the same location **before** starting up CircleCI.
265273
274+
### Vault Requirements
275+
276+
Vault is required for the `contexts-service` to securely encrypt and decrypt shared contexts.
277+
278+
Vault should be setup as follows:
279+
280+
* Vault version `0.7` is the only version currently supported
281+
* It is highly recommend that Vault be configured with TLS enabled
282+
* There must be a `transit` mount available
283+
* A token must be provided with permissions to manage keys and encrypt/decrypt data for the mounted `transit` backend
284+
285+
266286
## Configuring Replicated
267287
268288
To securely pass Mongodb, Postgresql and Vault connection settings to services running in Replicated, use of `/etc/circle-installation-customizations` file is required.
@@ -273,16 +293,27 @@ Following is the content of the `circle-installation-customizations` file necces
273293

274294
# Mongo DB
275295
MONGO_BASE_URI=mongodb://circle:<password>@<hostname>:27017
276-
export CIRCLE_SECRETS_MONGODB_MAIN_URI="$MONGO_BASE_URI/circle_ghe?authSource=admin"
277-
export CIRCLE_SECRETS_MONGODB_ACTION_LOGS_URI="$MONGO_BASE_URI/circle_ghe?authSource=admin"
278-
export CIRCLE_SECRETS_MONGODB_BUILD_STATE_URI="$MONGO_BASE_URI/build_state_dev_ghe?authSource=admin"
279-
export CIRCLE_SECRETS_MONGODB_CONTAINERS_URI="$MONGO_BASE_URI/containers_dev_ghe?authSource=admin"
296+
export CIRCLE_SECRETS_MONGODB_MAIN_URI="$MONGO_BASE_URI/circle_ghe?ssl=on"
297+
export CIRCLE_SECRETS_MONGODB_ACTION_LOGS_URI="$MONGO_BASE_URI/circle_ghe?ssl=on"
298+
export CIRCLE_SECRETS_MONGODB_BUILD_STATE_URI="$MONGO_BASE_URI/build_state_dev_ghe?ssl=on"
299+
export CIRCLE_SECRETS_MONGODB_CONTAINERS_URI="$MONGO_BASE_URI/containers_dev_ghe?ssl=on"
300+
export CIRCLE_SECRETS_MONGODB_REMOTE_CONTAINERS_URI="$MONGO_BASE_URI/ remote_containers_dev_ghe?ssl=on"
280301

281302
# Postgres DB
282-
export CIRCLE_SECRETS_POSTGRES_MAIN_URI='postgres://circle:<password>@<hostname>:5432/circle'
303+
export POSTGRES_HOST="<hostname>"
304+
export POSTGRES_PORT="5432"
305+
export POSTGRES_PASSWORD="<password>"
306+
export POSTGRES_USER="circle"
307+
export DATABASE_PASSWORD="$POSTGRES_PASSWORD"
308+
export DATABASE_USER="$POSTGRES_USER"
309+
export DATABASE_HOST="$POSTGRES_HOST"
310+
export POSTGRES_JDBC_URL="postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:5432/contexts_service_production?sslmode=require"
311+
export DATABASE_URL="postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:5432/conductor_production?sslmode=require"
312+
export CIRCLE_SECRETS_POSTGRES_DOMAIN_URI="postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:5432/circle?sslmode=require"
313+
export CIRCLE_SECRETS_POSTGRES_BUILD_QUEUE_URI="postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:5432/circle?sslmode=require"
283314

284315
# Vault
285-
export VAULT__SCHEME="<vault-scheme>"
316+
export VAULT__SCHEME="https"
286317
export VAULT__HOST="<vault-hostname>"
287318
export VAULT__PORT="<vault-port>"
288319
export VAULT__CLIENT_TOKEN="<vault-client-token>"

0 commit comments

Comments
 (0)