Sign inSign up

sisays/elasticsearch-docker

By sisays

•Updated almost 11 years ago

Elasticsearch (ENV version 1.4.0) running with Java8

Image
0

1.3K

sisays/elasticsearch-docker repository overview

⁠ElasticSearch Dockerfile

This repository contains Dockerfile of ElasticSearch⁠ for Docker⁠'s automated build⁠ published to the public Docker Hub Registry⁠.

⁠Base Docker Image
⁠Installation
  1. Install Docker⁠.

  2. Download automated build⁠ from public Docker Hub Registry⁠: docker pull sisays/elasticsearch-docker

    (alternatively, you can build an image from Dockerfile: docker build -t="sisays/elasticsearch-docker" github.com/simonbahuchet/elasticsearch-docker)

⁠Usage1: Run one node
docker run -d -p 9200:9200 -p 9300:9300 sisays/elasticsearch-docker
⁠Get the corresponding IP
docker inspect --format '{{ .NetworkSettings.IPAddress }}' <CONTAINER_ID>
⁠After a few seconds, use the REST API to retrieve the cluster state
curl -XGET http://<IP>:9200/_cluster/state?pretty=true
⁠Usage2: Run a 3-nodes cluster (unicast)
  1. Create a /config directory

  2. Configure a /config/elasticsearch.yml with:

discovery.zen.minimum_master_nodes: 2
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["es_node1", "es_node2", "es_node3"]
path:
   logs: /data/log
   data: /data/data
  1. and then start up 3 nodes:
docker run -d \
	-h es_node1 \
	--name=es_node1 \
	-p 9200:9200 -p 9300:9300 \
	-v <data-dir>:/data \
	sisays/elasticsearch-docker \
	/elasticsearch/bin/elasticsearch -Des.config=/data/config/elasticsearch.yml
docker run -d \
	-h es_node2 \
	--name=es_node2 \
	--link es_node1:es_node1 \
	-p 9201:9200 -p 9301:9300 \
	-v <data-dir>:/data \
	sisays/elasticsearch-docker \
	/elasticsearch/bin/elasticsearch -Des.config=/data/config/elasticsearch.yml
docker run -d \
	-h es_node3 \
	--name=es_node3 \
	--link es_node1:es_node1 --link es_node2:es_node2 \
	-p 9202:9200 -p 9302:9300 \
	-v <data-dir>:/data \
	sisays/elasticsearch-docker \
	/elasticsearch/bin/elasticsearch -Des.config=/data/config/elasticsearch.yml
⁠Get the IP of one the nodes
docker inspect --format '{{ .NetworkSettings.IPAddress }}' <CONTAINER1_ID>
⁠After a few seconds, use the REST API to retrieve the cluster state
curl -XGET http://<IP1>:9200/_cluster/state?pretty=true

Tag summary

Content type

Image

Digest

sha256:598f32a73…

Size

333.7 MB

Last updated

almost 11 years ago

docker pull sisays/elasticsearch-docker