Couchbase on docker/aws issue

828 views
Skip to first unread message

mathieu...@zenika.com

unread,
Apr 27, 2015, 11:15:27 AM4/27/15
to couc...@googlegroups.com
Hi,

I try to run couchbase community with docker on aws instances. I actually just try to create a simple cluster (2 nodes).

In my first node, i run :

sudo docker run -p 8091:8091 -p 8092:8092 -p 11210:11210 -p 11211:11211 -p 18091:18091 -p 4369:4369 -v /mnt/couchbase:/opt/couchbase/var -d ip-172-31-**.**.eu-west-1.compute.internal:5000/couchbase:latest

In my second node :

sudo docker run -p 8091:8091 -p 8092:8092 -p 11210:11210 -p 11211:11211 -p 18091:18091 -p 4369:4369 -v /mnt/couchbase:/opt/couchbase/var -d ip-172-31-**.**.eu-west-1.compute.internal:5000/couchbase:latest

When i'm going in node 1 web console, in "configure server hostname"  i can only use 127.0.0.1, because if i use something else i get "Could not listen: eaddrnotavail". Can i use this configuration (127.0.0.1) for running my cluster ?

When i try to add my second node to my cluster in the web console

[

IP Address : node 1 ec2 instance ip
Username : Administrator
Password : my password

]

i got this message : Attention - Failed to reach erlang port mapper at node "172.17.0.13". Error: ehostunreach.

172.17.0.13 is the internal ip of my docker in the node 2 (sudo docker exec -t -i a965ee9df2ad ifconfig in node 2 =  eth0      Link encap:Ethernet  HWaddr 02:42:AC:11:00:0D  inet addr:172.17.0.13  Bcast:0.0.0.0  Mask:255.255.0.0 ...)

Does anyone have a solution ?

Thanks you,


mathieu...@zenika.com

unread,
Apr 29, 2015, 3:24:58 AM4/29/15
to couc...@googlegroups.com
Hi,
I finally solved the problem.
For running couchbase in aws/docker, you need to use the --add-host docker option to to add the amazon private dns in the /etc/hosts file of the docker :

--add-host=ip-yourip.eu-west-1.compute.internal:127.0.0.1

after that, in the couchbase admin console, you need to use the amazon private dns as the server hostname. When you join a cluster, use the amazon dns too.

You can use --add-host=$(hostname):127.0.0.1 when you are launching your docker, but you need to modify the /etc/hostname of your instance (put the amazon private dns in the file).

Hope this can help.

Frank Lemanschik

unread,
Jul 25, 2015, 10:04:42 AM7/25/15
to Couchbase, mathieu...@zenika.com
Extra infos for you guys:

If you look for example at our couchbase images https://github.com/dockerimages/couchbase you will find the use of confused this is a small tool that can rewrite some traffic informations

if you plan linking 2 containers that run on diffrent external hosts u need to translate the external ip of the docker host to 127 and i saw you dont opened 21100 till 21199 tcp/udp

so for example our images run confused on port 7081 and we use this port when we connect over my client -> docker_host_ip -> bridge -> container_ip to translate docker_host ip to 127.0.0.1

Hopes that helps you to understand what your doing if you add a extra isolated network layer where you run couchbase in.

Adrian Konkolowicz

unread,
Mar 23, 2016, 3:10:59 PM3/23/16
to Couchbase
Hi, I'm running the same issue right know.

In my company we have a cloud platform and all nodes have internal Ips. Nodes that belong to the same clusters see each other through a global IP assignation in the platform, not through internal IP (because internal IP depends on where the node is physically located).
I'm trying to install couchbase in a cluster of three nodes and I'm getting the following issues:
Information: 
  • Cluster name: couchbase-test
So I installed couchbase server in the first node, but the only hostname that didn't prompt me error were (192.168.19.113 or 127.0.0.1), if I put the global IP or the namespace I got "Could not resolve the hostname: nxdomain".
Then, I installed couchbase in node 2. However, when I try to configure it to join to the cluster generated by the first Node putting 192.168.22.32 in the "hostname" and in "join cluster ip" 10.70.168.112 I get this "Attention - Failed to reach erlang port mapper at node "192.168.22.32". Error: ehostunreach".

Here's an example of hosts file for Node 1:
127.0.0.1 localhost
169.254.169.254 instance-data

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
192.168.19.113 couchbase-test-01

Could you guys help me?

Thanks in advance,
Adrián
Reply all
Reply to author
Forward
0 new messages