Xdcr not replications with public ips

From your description of the problem, I am assuming that you used the public ip address of the ec2 instance when you added the XDCR remote cluster. If you look in the goxdcr.log (for example, /opt/couchbase/var/lib/couchbase/logs/goxdcr.log on Linux) on the source cluster, you’ll probably see WARN and ERRO messages for GOXDCR.RemClusterSvc saying that target nodes are not accessible, and you’ll probably see the private ip’s listed (even though you used the public ip when you added the XDCR remote). The public ip is used to connect to the remote node/cluster for bootstrapping (to get info on all the nodes in the cluster), and the information the source cluster got were the private ip’s of the target cluster nodes.

If you are on a version of Couchbase Server that supports alternate addresses, you can set the public ip of the nodes as the alternate addresses on the target cluster nodes, and when you use the public ip for the XDCR remote, the alternate addresses will be used.

Alternate addresses docs links are below. Note that you do not need to use the --ports option for the couchbase-cli or alternate-port-number for services options for the REST API commands if you just want the same port numbers mapped to the alternate address (this is the easiest – if you choose to map to different port numbers on the alternate address, you’ll need to configure port forwarding also using OS commands). Before and after setting alternate addresses, you can check the node info using – curl -X GET -u Administrator:password http://<localhost_or_ip_or_hostname>:8091/pools/default/nodeServices – after setting the alternate address (using either the couchbase-cli or REST api) on the node, you’ll see the public ip listed as the alternate address.

https://docs.couchbase.com/server/current/rest-api/rest-set-up-alternate-address.html
https://docs.couchbase.com/server/current/cli/cbcli/couchbase-cli-setting-alternate-address.html

Another solution would be to setup VPC peering between the two private cloud networks so that they can communicate with each other – https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html

1 Like