Node Discovery Issue

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.

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

no it is commented out.

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

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 including the steps you should take to fix it.

will i lose the indices?

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?

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