Multiple Elasticsearch nodes with Docker


(Brandon Mc Grath) #1

Hello guys,

I'm new to Docker and I'm having an issue.

I am trying to run a multinode set up with the following commands:

docker run -d --name elasticsearch -p 9200:9200 elasticsearch
docker run -d --name elasticsearch1 --link elasticsearch -e UNICAST_HOSTS=elasticsearch elasticsearch

Here is the output from the docker ps command.

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                              NAMES
c94a69a03471        elasticsearch       "/docker-entrypoint.…"   6 minutes ago       Up 6 minutes        9200/tcp, 9300/tcp                 elasticsearch1
9a02a100c756        elasticsearch       "/docker-entrypoint.…"   9 minutes ago       Up 9 minutes        0.0.0.0:9200->9200/tcp, 9300/tcp   elasticsearch

Finally, here is the output from curl ip:9200/_cluster/health?pretty

{
  "cluster_name" : "elasticsearch",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 0,
  "active_shards" : 0,
  "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
}

I've spent a while trying to do this various ways and the nodes always run, but not in a cluster. Any ideas?

Thanks!


(system) #3

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