# Node Discovery Issue

**URL:** <https://discuss.elastic.co/t/node-discovery-issue/218833>\
**Category:** Elasticsearch\
**Created:** [February 11, 2020, 5:19pm UTC](https://discuss.elastic.co/t/node-discovery-issue/218833 "2020-02-11T17:19:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![damasu](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@damasu](https://discuss.elastic.co/u/damasu)\
**Post date:** [February 11, 2020, 5:19pm UTC](https://discuss.elastic.co/t/node-discovery-issue/218833/1 "2020-02-11T17:19:57Z")

</div>

Hi,

I have created two AWS EC2 instances

the first is using the following docker-compose configuration

```
elasticsearch:
    build:
      context: ./docker/elasticsearch/
      dockerfile: Dockerfile
      args:
        ELK_VERSION: 7.5.1
    restart: unless-stopped
    volumes:
# - ./docker/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
      - elasticsearch:/usr/share/elasticsearch/data
    ports:
      - "9200:9200"
      - "9300:9300"
    environment:
      - network.host=0.0.0.0
      - node.name=es01
      - node.master=true
      - node.data=true
      - node.ingest=true
      - discovery.seed_hosts=aws_private_id1,aws_private_id2
      - cluster.initial_master_nodes=es01,es02
      - cluster.name=es-docker-cluster
      - bootstrap.memory_lock=true
      - http.cors.enabled=true
      - http.cors.allow-origin=*
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      # ELASTIC_PASSWORD: changeme
      # Use single node discovery in order to disable production mode and avoid bootstrap checks
      # see https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
# - discovery.type=single-node

```

the config.yaml is the same for both

```
xpack.license.self_generated.type: trial
#xpack.security.enabled: true
#xpack.monitoring.collection.enabled: true
xpack.security.enabled: false
xpack.monitoring.enabled: false
xpack.ml.enabled: false
xpack.graph.enabled: false
xpack.watcher.enabled: false

```

The second node

```
  elasticsearch:
    build:
      context: ./docker/elasticsearch2/
      dockerfile: Dockerfile
      args:
        ELK_VERSION: 7.5.1
    restart: unless-stopped
    volumes:
# - ./docker/elasticsearch2/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
      - elasticsearch:/usr/share/elasticsearch/data
    ports:
      - "9200:9200"
      - "9300:9300"
    environment:
      - network.host=0.0.0.0
      - node.name=es02
      - node.master=true
      - node.data=true
      - node.ingest=true
      - discovery.seed_hosts=aws_private_id1,aws_private_id2
      - cluster.initial_master_nodes=es01,es02
      - cluster.name=es-docker-cluster
      - bootstrap.memory_lock=true
      - http.cors.enabled=true
      - http.cors.allow-origin=*
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
# - "ELASTIC_PASSWORD=changeme"
      # Use single node discovery in order to disable production mode and avoid bootstrap checks
      # see https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
# - discovery.type=single-node

```

when i try curl -XGET -u elastic:password "localhost:9200/\_cluster/health?pretty" i get

```
{
  "cluster_name" : "es-docker-cluster",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 5,
  "active_shards" : 5,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
}

```

only one node showing. i can do a curl request to the aws\_private\_id of the other machine i get the same response.. 1 node

So i am not sure why this the cluster is showing just one node. Any ideas?

The logs show no errors.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [February 11, 2020, 5:21pm UTC](https://discuss.elastic.co/t/node-discovery-issue/218833/2 "2020-02-11T17:21:44Z")

</div>

> [@damasu](#):
>
> So i am not sure why this the cluster is showing just one node. Any ideas?

You have set `discovery.type: single-node`, so a single-node cluster is what you get.

---

<div class="post-metadata">

**Author:** ![damasu](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@damasu](https://discuss.elastic.co/u/damasu)\
**Post date:** [February 11, 2020, 5:22pm UTC](https://discuss.elastic.co/t/node-discovery-issue/218833/3 "2020-02-11T17:22:29Z")

</div>

no it is commented out.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [February 11, 2020, 5:22pm UTC](https://discuss.elastic.co/t/node-discovery-issue/218833/4 "2020-02-11T17:22:31Z")

</div>

Oh, you have reformatted your post and now it looks like that is commented out 🙂

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [February 11, 2020, 5:23pm UTC](https://discuss.elastic.co/t/node-discovery-issue/218833/5 "2020-02-11T17:23:56Z")

</div>

I suspect you have started these nodes up previously and allowed them to form a cluster each. [This note in the docs has more information](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-bootstrap-cluster.html#modules-discovery-bootstrap-cluster-joining) including the steps you should take to fix it.

---

<div class="post-metadata">

**Author:** ![damasu](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@damasu](https://discuss.elastic.co/u/damasu)\
**Post date:** [February 11, 2020, 5:25pm UTC](https://discuss.elastic.co/t/node-discovery-issue/218833/6 "2020-02-11T17:25:01Z")

</div>

will i lose the indices?

---

<div class="post-metadata">

**Author:** ![damasu](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@damasu](https://discuss.elastic.co/u/damasu)\
**Post date:** [February 11, 2020, 5:49pm UTC](https://discuss.elastic.co/t/node-discovery-issue/218833/7 "2020-02-11T17:49:55Z")

</div>

i have to use

```
network.publish_host

```

in addition, changed all private ips to dns name

and now it works.

Lost all data.. no biggy just testing this out.

Regards

Is there a way to maintain logstash- files export?

---

<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:** [March 10, 2020, 5:58pm UTC](https://discuss.elastic.co/t/node-discovery-issue/218833/8 "2020-03-10T17:58:00Z")

</div>

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