Couchbase XDCR in Docker Container

I need to have a local Couchbase cluster and replicate data from our prod cluster to it, it cannot be installed directly on OS X (due to vbuckets incompatibility - the prod cluster is in linux).

Docker for salvation. I managed to create a Dockerfile, you can see it here.

Now the cluster is working, it is available on the local network, all necessary ports are forwarded - I used the tricks described here

I successfully created a cluster link on the XDCR tab, but whenever I try to replicate the data in a bucket, it changes the hostname of the cluster to some insensitive IP address and creates a log entry:

Updated remote cluster `mycluster` hostname to "172.17.0.5:8091" because old one ("mylaptop.company.com:8091") is not part of the cluster anymore 

I know that Couchbase is very sensitive to IP addresses, as you can see, instead I use the hostname of my machine (docker container host). I tried changing the name of the container using docker run -h , which didn't seem to help.

Has anyone, you guys installed XDCR with a cluster running in a docker container?

+6
source share
2 answers

The cluster will not accept your node as part of it, so it will be knocked out. It seems that you do not have your network configured correctly.

Perhaps you need to open several ports: (all ports are node-to-node) http://docs.couchbase.com/couchbase-manual-2.5/cb-install/#network-ports

Also, how do you start your container? Putting the exposure in the docker file will not open the ports, you also need to put -P in your command to really expose the ports

+1
source

In the end, I realized that. The first step is to set up the couchbase hostname for something accessible from the main cluster. The second thing you need to do is update the hosts file in the slave cluster, replacing the current definition 127.0.0.1 with where COUCHBASE_HOSTNAME is the host name used above, I could not use the public IP addresses and had to use the domain name with the entries DNS pointing to slave:

127.0.0.1 COUCHBASE_HOSTNAME

+1
source

Source: https://habr.com/ru/post/987290/


All Articles