7

I need to have local Couchbase cluster and replicate data from our prod cluster onto it, can't have it installed directly on OS X (because of vbuckets incompatibility - prod cluster is on linux).

Docker for the rescue. I've managed to create Dockerfile, you can see it here.

Now, the cluster runs, it is reachable within LAN, all necessary ports are forwarding - I used tricks described here

I successfully created cluster reference in XDCR tab, yet whenever I try to replicate bucket's data - it changes my cluster's hostname to some non-sensical 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 Couchbase is very sensitive to ip addresses, as you can see, instead I'm using hostname of my machine (host of the docker container). I tried changing container's host name using docker run -h, that didn't seem to help.

Anyone, have you guys set XDCR with a cluster running in a docker container?

iLemming
  • 34,477
  • 60
  • 195
  • 309
  • Did you ever solve this? I'm running into a similar issue. – jmiraglia Sep 29 '16 at 19:16
  • @jmiraglia no, unfortunately I couldn't find a way to solve this. Later I moved on to other things, in my current project I am not using Couchbase. Sorry. – iLemming Oct 02 '16 at 19:26

2 Answers2

1

The cluster wont accept your node as part of it, so it gets knocked out. Seems like you haven't got your networking set up right.

Could be that you need some more ports opened up: (all node-to-node ports) http://docs.couchbase.com/couchbase-manual-2.5/cb-install/#network-ports

Also, how do you start your container? Putting expose in the dockerfile wont open up the ports, you also need to put -P in your command to really expose the ports

RoyB
  • 3,104
  • 1
  • 16
  • 37
  • no, all the necessary ports are opened. I have all these: 8091 8092 11209 11210 11211 11214 11215 18091 18092 4369. As I said, it does find the bucket, it connects to the cluster, yet doesn't want to replicate, because ip address of the docker container is different from the ip of its hosting machine. I am trying to use my machine's hostname, instead of ip - all the same, doesn't replicate – iLemming Jun 01 '15 at 19:04
  • Maybe I need to find a way to make the docker container 'visible' in the local network completely, just forwarding ports is not enough? – iLemming Jun 01 '15 at 19:23
1

I ended up figuring this out. The first step is to set your couchbase hostname to something accessible from the master cluster. The second thing that you have to do is update the hosts file on the slave cluster, replacing the current 127.0.0.1 definition to where COUCHBASE_HOSTNAME is the hostname used above, I was unable to use public IP addresses, and had to use a domain name with DNS records pointing to the slave:

127.0.0.1 COUCHBASE_HOSTNAME

jmiraglia
  • 671
  • 6
  • 11