CFME database replication


#1

Hi,

We are trying to set up a centralized CFME by replicating data from other CFME instances.

Cloudforms are deployed as pods on different Openshift Container Platforms.

Database replication from UI as mentioned in the document worked well for Cloudforms deployed on Virtual machines.
When tried to follow the same procedure with Cloudforms which are deployed as pods, it failed with an error “Could not connect to server”.

For example,

Cloudforms A (Global) has hostname: manageiq-openshift-cfme.router.default.svc.cluster.local
Cloudforms B (remote) has hostname: manageiq-cfme.router.default.svc.cluster.local

From Cloudforms A’s UI, I tried replication as shown below:

Could someone please help me with setting up multi region data replication on CFME deployed as pods on Openshift.

Tagging @Yaacov_Zamir @abonas

Thank you,
Sowmya


#2

cc @bazulay


#3

cc @gtanzillo

On the PODified app the regular db backup scripts do not work.
IIRC there was some work by @fbladilo on this issue.


#4

@sguthikonda To get replication working in a podified environment, you’ll need to expose the PostgreSQL port outside of the OpenShift cluster. You can do this by using the Ingress IP Self-Service method. There’s some documentation here

Once you expose the externally accessible ports you’ll need to use them instead of 5432 in the replication subscription screen.


#5

To expand on @gtanzillo’s answer, here is a more general link with a number of ways you can expose the port outside of the OpenShift cluster: https://docs.openshift.com/container-platform/3.6/dev_guide/expose_service/index.html#getting-traffic-into-cluster-index


#6

@bazulay The work that @fbladilo did for DB backup and restore is here


#7

Hi @gtanzillo

I tried the following steps

  1. Exposed the postgresql pod (“remote”) as a Route postgresql.service.cf

oc describe route postgresql-route
Name: postgresql-route
Namespace: openshift-cfme
Created: 27 hours ago
Labels:
Annotations:
Requested Host: postgresql.service.cf
exposed on router router 27 hours ago
Path:
TLS Termination:
Insecure Policy:
Endpoint Port:
Service: postgresql
Weight: 100 (100%)
Endpoints: 10.130.0.69:5432

  1. Updated the /etc/hosts file on the manageIQ pod to resolve the route.
    Entry in hosts file: {postgresql Endpoint} {postgresql route} {postgresql pod name}

  2. From the “global” Cloudforms UI, tried replicating with the route postgresql.service.cf as hostname, “root” as User, the decoded Kubernetes secret as pwd and port “5432” in the UI replication form.

Replication failed with the below error:

Error during replication configuration save: Failed to save subscription to postgresql.service.cf: PG::InternalError: ERROR: pglogical is not in shared_preload_libraries : CREATE EXTENSION IF NOT EXISTS “pglogical”

Could you please help me to resolve this issue.


#8

@carbonin Is pglogical not installed on the containers?


#9

It is installed as long as you are using the container here.

Additionally, can you post the output of SHOW shared_preload_libraries; from a psql session to the remote database?


#10

Hi @carbonin,

As suggested by you, I tried installing postgresql container from here.
Previously I was using the one available from Redhat Enterprise Container catalog.

In both the cases, output of

SHOW shared_preload_libraries;

is as follows:

postgres=# SHOW shared_preload_libraries;
 shared_preload_libraries 
--------------------------
 
(1 row)

Configuration in postgresql.conf

#shared_preload_libraries = '' # (change requires restart)


#11

Right, so we set that in an override file provided by a config map here.

This is a bit confusing because you seem to be using CloudForms rather than ManageIQ and I’m not sure that the currently released version of CloudForms has been tested with the new postgres pod released by ManageIQ on dockerhub.

I think replication in the podified version of CF has only been validated in the upcoming version. If you want to use this feature now I’m not sure there is anything I can be sure will work in your situation.


#12

Hi @carbonin,

Could you let us know from which version of ManageIQ has the above mentioned Postgres pod changes are introduced?

Thanks
Sowmya


#13

@sguthikonda I believe the package was present in the PG pod we used in the Fine release, but the first release that we tested replication between OpenShift installations was Gaprindashvili.