Skip to content

Instantly share code, notes, and snippets.

@jrafanie
Created October 1, 2020 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrafanie/603bcdd8c6b6136238ba9c1f20f25de0 to your computer and use it in GitHub Desktop.
Save jrafanie/603bcdd8c6b6136238ba9c1f20f25de0 to your computer and use it in GitHub Desktop.
How to enable replication in ManageIQ with postgresql 12... should work with pg 10/11 also
How to setup replication in pods with postgresql 12 (very similar to 10):
1) Do the following steps for each region: example: 99 for global, 1 for region
In your local manageiq-pods repo, modify the deploy/crds/manageiq.org_v1alpha1_manageiq_cr.yaml with this information:
...
spec:
applicationDomain: <unique name>
postgresqlImageName: <user/repository_of_pg_12_image such as 'jrafanie/postgresql'>
postgresqlImageTag: <tag such as 'latest'>
databaseRegion: "<Region number such as 99 for global and 1 for remote>"
Make sure each project is created with a different applicationDomain and databaseRegion value.
If you haven't already created your crds/role/role_binding/service_account...
oc create -f deploy/crds/manageiq.org_manageiqs_crd.yaml
oc create -f deploy/role.yaml
oc create -f deploy/role_binding.yaml
oc create -f deploy/service_account.yaml
Then, create the operator and custom resource.
oc create -f deploy/operator.yaml
oc create -f deploy/crds/manageiq.org_v1alpha1_manageiq_cr.yaml
2) Once postgresql is deployed on each subregion (non-global)/oc project, you'll need to do the following to get
the database IP and password for each subregion/project:
$ oc get service postgresql
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
postgresql ClusterIP x.x.x.x. <none> 5432/TCP 4h
^^^^^^^^
$ oc rsh deploy/postgresql
sh-4.2$ echo $POSTGRESQL_PASSWORD
pg_password_blah
^^^^^^^
3) For each remote region, you'll need to navigate to the manageiq UI of this region to enable remote replication:
a) Click Configuration Configuration.
b) Click the Settings accordion.
c) Click the region where the instance is located.
d) Click Replication.
e) Select Remote from the Type list.
f) Click Save.
4) For the global, you'll need the IP address and password information you captured for each remote region:
a) Click Configuration Configuration.
b) Click the Settings accordion.
c) Click the region where the instance is located.
d) Click Replication.
e) Select Global from the Type list.
f) Click Add Subscription.
g) Enter the name of the database on the remote copy in the Database field.
h) Enter the IP address or fully qualified domain name of the remote copy in the Host field.
i) Enter the name of a database user able to access the database in the Username field.
j) Enter the password of the database user in the Password field.
k) Enter the port by which the database is accessed in the Port field.
l) In Actions, click Accept. You can also Update your subscription if required, or click the menu on the right in order to Validate or Discard.
m) Click Save.
The last two steps come from: https://access.redhat.com/documentation/en-us/red_hat_cloudforms/5.0/html/general_configuration/configuration#database-regions-and-replication
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment