I am have installed Couchbase on Docker using docker-compose file.
version: ‘2’
services:
couchbase-server:
container_name: project-couchbase
image: couchbase/server
ports:
- 4369:4369
- 8091:8091
- 8092:8092
- 8093:8093
- 8094:8094
- 11210:11210
- 11211:11211
volumes:
- $HOME/couchbasesql:/var/lib/couchbase/data
Installation went fine but while creating cluster when i give my machine ip, I am getting following error
I have used all solution on google but still i am stuck here, it is taking 127.0.0.1 but not my machine ip which is needed for Couchbase clustering. Can somebody help me on this ?
Hi Issacthomas,
This issue seems more like docker networking issue where you are using the default bridge network where in this case will have its own ip address (typically 172.17.0.x or 172.18.0.x) and not the host IP address. In this case, either this IP or 127…0.0.1 to be used in the config.
In order to have the same host IP address being shared with docker container, you have to use host network type (–net host in the case of docker run command or network_mode: “host” in the case of docker-compose.yml file).
Read more on the docker networking using host for this. https://docs.docker.com/network/host/
If you try with the below file (only change is network_mode: “host” added) on your VM (say centos), then it should allow your host IP as the Host Name/IP Address in the Couchbase new cluster configuration.
version: ‘2’
services:
couchbase-server:
container_name: project-couchbase
image: couchbase/server
network_mode: “host”
ports:
- 4369:4369
- 8091:8091
- 8092:8092
- 8093:8093
- 8094:8094
- 11210:11210
- 11211:11211
volumes:
- $HOME/couchbasesql:/var/lib/couchbase/data
Hope this helps.