Search code examples
dockerdocker-composecouchbase

Unable to join couchbase cluster created using docker compose


I'm using docker desktop and i've got a cointainer that uses this couchbase image: bentonam/couchbase-docker:community

I originally set up the container by using this docker-compose.yaml file:

volumes:
  couchbasedata:
    name: "couchbase"
    external: false
networks:
  local:
    name: "local"

services:
 couchbase:
    image: bentonam/couchbase-docker:community
    container_name: couchbase
    networks:
      - local
    environment:
      CLUSTER_USERNAME: Administrator
      CLUSTER_PASSWORD: password
      CLUSTER_NAME: LocalCouchbaseCluster
      SERVICES: data,index,query,fts
      CLUSTER_RAMSIZE: 1024
      BUCKET: testbucket
      BUCKET_RAMSIZE: 256
    volumes:
      - couchbasedata:/opt/couchbase/var
    ports:
      - 8091-8094:8091-8094
      - 11210:11210

Since it is an obsolete version, i wanted to use instead this newer image: couchbase:community-7.1.1 I've updated the yaml with the new image value, deleted the existing container, image and volume and launched the command docker-compose -f ".\docker-compose.yaml" up -d

When i navigate to localhost:8091 i'm asked to set up or join an existing cluster, so i choose the Join option and here i need to specify the Cluster Host Name/IP Address, but when i put my cluster_name value "LocalCouchbaseCluster" i'm receiving the following error:

Failed to connect to http://LocalCouchbaseCluster:8091. Failed to resolve address for "LocalCouchbaseCluster". The hostname may be incorrect or not resolvable.

I don't encounter any error if i instead choose to set a new cluster, but in this case i need to create from start the bucket "testbucket".

I assumed i was using the wrong value for the cluster name, so I've tried using "localhost" or "127.0.0.1" but i'm then prompted with another error: Adding nodes to not provisioned nodes is not allowed

With the previous image "bentonam/couchbase-docker:community" i'm not encountering any issue: when i'm navigating localhost:8091 i'm directly prompted to insert the credentials and then i can access the couchbase UI with my bucket "testbucket" already configured.

What am i doing wrong?


Solution

  • When you went to the setup screen after going to localhost port 8091 and you need to specify if you are creating a cluster or joining an existing cluster, it's unclear which route you should take.

    Do you already have a couchbase server cluster with additional nodes that are already running or are you trying to set up a new couchbase server cluster?

    If you're setting up a new cluster, you should select the create new cluster option.

    If you're trying to join this new instance to an existing cluster of Couchbase Server nodes, then you would select join an existing cluster.

    What it's asking you to specify is the host name or the IP address, not the name of the cluster but the actual host name.

    To do that, you also need to make sure that your instance can connect over the network to that host name.

    But what it looks like is that you're actually trying to set up a new cluster.

    If you choose a new cluster, you won't need to provide a host name to connect to, so probably the option you want to try there.

    Thanks, Ian