To establish an XDCR relationship, you must configure each cluster as an XDCR participant. This involves:
Assigning each cluster a unique DR ID between 0 and 127
Specifying the cluster's role as XDCR
Identifying a node from the other cluster as the initial point of connectivity
Where normally the XDCR configuration is included in the XML configuration file, for Kubernetes you specify the configuration using YAML properties. The following table shows two equivalent XDCR configurations in the two formats.
|XML Configuration File||YAML Configuration File|
<dr id="1" role="xdcr" > <connection source="brooklyn.mycorp.lan" /> </dr>
cluster: config: deployment: dr: id: 1 role: xdcr connection: enabled: true source: \ "brooklyn-voltdb-cluster-dr:5555"
Note that in Kubernetes the cluster nodes are assigned unique IP addresses based on the initial Helm release name (that is, the name you assigned the cluster when you installed it). The VoltDB Operator also creates services that abstract the individual server addresses and provide a single entry point for specific ports on the database cluster. Two services in particular are DR and client, which will direct traffic to the corresponding port (5555 or 21212 by default) on an arbitrary node of the cluster. If the two database instances are within the same Kubernetes cluster, you can use the DR service to make the initial connection between the database systems, as shown in the preceding YAML configuration file.
If the two databases are running in the same Kubernetes cluster but in different namespaces, you will need the specify the fully qualified service name as the connection source in the configuration, which includes the namespace. So, for example, if the manhattan database is in namespace ny1 and brooklyn is in ny2, the YAML configuration files related to XDCR for the two clusters would be the following:
|Manhattan XDCR Configuration||Brooklyn XDCR Configuration|
cluster: config: deployment: dr: id: 1 role: xdcr connection: enabled: true source: \ "brooklyn-voltdb-cluster-dr.ny2.svc.cluster.local:5555"
cluster: config: deployment: dr: id: 2 role: xdcr connection: enabled: true source: \ "manhattan-voltdb-cluster-dr.ny1.svc.cluster.local:5555"