# Docker Compose with multi node deployment issue

**URL:** <https://forum.weaviate.io/t/docker-compose-with-multi-node-deployment-issue/1720>\
**Category:** Support\
**Created:** [March 15, 2024, 6:01am UTC](https://forum.weaviate.io/t/docker-compose-with-multi-node-deployment-issue/1720 "2024-03-15T06:01:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [March 15, 2024, 12:54pm UTC](https://forum.weaviate.io/t/docker-compose-with-multi-node-deployment-issue/1720/2 "2024-03-15T12:54:34Z")

</div>

Hi @fenglizzz !! Welcome to our community 🤗

It’s not a good idea to reference the CLUSTER\_JOIN by IPs (or any container to container connection inside docker/k8s to be fair), as those will eventually change down the road, or maybe even after a reboot.

Here are some steps to get this party going. 🥳

First, let’s create a docker attachable network:

```auto
docker network create --attachable weaviate

```

Now, using the [latest docker compose](https://weaviate.io/developers/weaviate/installation/docker-compose#sample-docker-compose-file), and using this doc to [adjust it to a multi node setup](https://weaviate.io/developers/weaviate/installation/docker-compose#multi-node-setup), a came up with those two files:

`docker-compose-0.yaml`

```auto
---
version: '3.4'
services:
  weaviate-0:
    command:
    - --host
    - 0.0.0.0
    - --port
    - '8080'
    - --scheme
    - http
    image: cr.weaviate.io/semitechnologies/weaviate:1.24.3
    ports:
    - 8080:8080
    - 50051:50051
    volumes:
    - ./data-node0:/var/lib/weaviate
    restart: on-failure:0
    environment:
      QUERY_DEFAULTS_LIMIT: 25
      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
      PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
      DEFAULT_VECTORIZER_MODULE: 'none'
      ENABLE_MODULES: 'text2vec-cohere,text2vec-huggingface,text2vec-palm,text2vec-openai,generative-openai,generative-cohere,generative-palm,ref2vec-centroid,reranker-cohere,qna-openai'
      CLUSTER_HOSTNAME: 'node0'
      CLUSTER_GOSSIP_BIND_PORT: '7100'
      CLUSTER_DATA_BIND_PORT: '7101'      
    networks:
      - weaviate

networks:
  weaviate:
    attachable: true
...

```

let’s first run it and check everything

```auto
docker compose -f docker-compose-0.yaml

```

and check if our founder node is up:

```auto
❯ curl localhost:8080/v1/nodes
{"nodes":[{"batchStats":{"queueLength":0,"ratePerSecond":0},"gitHash":"7e5d3aa","name":"node0","shards":null,"status":"HEALTHY","version":"1.24.3"}]}

```

now, let’s spin up the second node, node1 🙂

here is the `docker-compose-1.yaml`

```auto
---
version: '3.4'
services:
  weaviate-1:
    command:
    - --host
    - 0.0.0.0
    - --port
    - '8080'
    - --scheme
    - http
    image: cr.weaviate.io/semitechnologies/weaviate:1.24.3
    ports:
    - 8081:8080
    - 50052:50051
    volumes:
    - ./data-node1:/var/lib/weaviate
    restart: on-failure:0
    environment:
      QUERY_DEFAULTS_LIMIT: 25
      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
      PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
      DEFAULT_VECTORIZER_MODULE: 'none'
      ENABLE_MODULES: 'text2vec-cohere,text2vec-huggingface,text2vec-palm,text2vec-openai,generative-openai,generative-cohere,generative-palm,ref2vec-centroid,reranker-cohere,qna-openai'
      CLUSTER_HOSTNAME: 'node1'
      CLUSTER_GOSSIP_BIND_PORT: '7102'
      CLUSTER_DATA_BIND_PORT: '7103'
      CLUSTER_JOIN: 'weaviate-0:7100'
    networks:
      - weaviate

networks:
  weaviate:
    attachable: true
...

```

The only differences:

- Service name
- Port mappings (so they don’t conflict)
- Folder for mounting data
- CLUSTER\_HOSTNAME
- Node1 has CLUSTER\_JOIN pointing to the reachable hostname of Node0

Now, you can spin the second node:

```auto
docker compose -f docker-compose-0.yaml up -d

```

And now check the status of your cluster:

```auto
❯ curl localhost:8080/v1/nodes
{
   "nodes":[
      {
         "batchStats":{
            "queueLength":0,
            "ratePerSecond":0
         },
         "gitHash":"7e5d3aa",
         "name":"node0",
         "shards":null,
         "status":"HEALTHY",
         "version":"1.24.3"
      },
      {
         "batchStats":{
            "queueLength":0,
            "ratePerSecond":0
         },
         "gitHash":"7e5d3aa",
         "name":"node1",
         "shards":null,
         "status":"HEALTHY",
         "version":"1.24.3"
      }
   ]
}

```

Let me know if this helps!

And don’t forget to check out events page!

> **[Events & Webinars | Weaviate - Vector Database](https://weaviate.io/community/events)**
>
> Join us at conferences, meetups, webinars or workshops

---

_[View the full topic](https://forum.weaviate.io/t/docker-compose-with-multi-node-deployment-issue/1720)._
