# ES 5.6.16 Docker cluster on multiple physical machines via Docker on custom ports

**URL:** <https://discuss.elastic.co/t/es-5-6-16-docker-cluster-on-multiple-physical-machines-via-docker-on-custom-ports/191830>\
**Category:** Elasticsearch\
**Created:** [July 23, 2019, 1:41pm UTC](https://discuss.elastic.co/t/es-5-6-16-docker-cluster-on-multiple-physical-machines-via-docker-on-custom-ports/191830 "2019-07-23T13:41:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nilsnolde](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nilsnolde/32/36611_2.png) [@nilsnolde](https://discuss.elastic.co/u/nilsnolde)\
**Post date:** [July 23, 2019, 1:41pm UTC](https://discuss.elastic.co/t/es-5-6-16-docker-cluster-on-multiple-physical-machines-via-docker-on-custom-ports/191830/1 "2019-07-23T13:41:10Z")

</div>

Hi,

I'm trying to set up a ES cluster via `docker-compose` on multiple machines, 4 in total. They are part of the same internal network and I think I'm fairly close, but the nodes still don't seem to see each other.

The main problem is that all the physical machines have ES 2.4 running directly on the host, so I figured I'll try to set up ES 5 (as the overlying software dropped support for ES 2.x) on the same machines, see if it all works. That's why I have to use different ports than `9200` and `9300`.

`docker-compose.yml` (only `node.name` and `network.publish_host` change among the cluster):

```auto
version: '2'
services:
  elasticsearch1:
    image: docker.elastic.co/elasticsearch/elasticsearch:5.6.16
    container_name: ors-es4
    environment:
      - cluster.name=ors-pelias-es5
      - network.bind_host=0.0.0.0
      - network.publish_host=192.168.2.74
      - transport.tcp.port=9310
      - http.port=9210
      - discovery.zen.ping.unicast.hosts=192.168.2.71,192.168.2.72,192.168.2.73,192.168.2.74
      - discovery.zen.minimum_master_nodes=3
      - gateway.recover_after_nodes=3
      - gateway.expected_nodes=4
      - gateway.recover_after_time=5m
      - node.name=ors-pelias-n4
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms2g -Xmx2g"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /srv/elasticsearch/es5:/usr/share/elasticsearch/data
    ports:
      - 9210:9200
      - 9310:9300

```

This still results in

```auto
[2019-07-23T13:25:19,347][WARN][o.e.d.z.ZenDiscovery] [ors-pelias-n4] not enough master nodes discovered during pinging (found [[Candidate{node={ors-pelias-n4}{aIUg_aiATPalwga82pzcMg}{vU0cNqgMTxCy0WlGPPx3jA}{192.168.2.74}{192.168.2.74:9310}{ml.max_open_jobs=10, ml.enabled=true}, clusterStateVersion=-1}]], but needed [3]), pinging again

```

I tried to add `:9310` to all `unicast.hosts` and a few other things related to host names and ports, no luck (sorry, can't remember it all, been playing around since 5 hours basically).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 20, 2019, 1:41pm UTC](https://discuss.elastic.co/t/es-5-6-16-docker-cluster-on-multiple-physical-machines-via-docker-on-custom-ports/191830/2 "2019-08-20T13:41:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
