How to use the This image
You can run the default elasticsearch
command simply:
$ docker run -d elasticsearch
You can also pass in additional the flags to elasticsearch
:
$ docker run -d elasticsearch elasticsearch -Des.node.name="TestNode"
This image comes with a default set of the configuration files elasticsearch
for, and if want to provide your own set of Configura tion files, you can do that via a volume mounted at /usr/share/elasticsearch/config
:
$ docker run -d -v "$PWD/config":/usr/share/elasticsearch/config elasticsearch
This image was configured with a volume at the /usr/share/elasticsearch/data
persisted index data. Use this path if you would like to keep the data in a mounted volume:
$ docker run -d -v "$PWD/esdata":/usr/share/elasticsearch/data elasticsearch
This image includes EXPOSE 9200 9300
(default http.port
) container linking would make it automatically available to the Linke D containers.
elasticsearch_master: image: elasticsearch:latest command: "elasticsearch -Des.cluster.name=workagram -Des.node.master=true -Des.node.data=false" environment: - ES_HEAP_SIZE=512m ports: - "9200:9200" - "9300:9300"elasticsearch1: image: elasticsearch:latest command: "elasticsearch -Des.cluster.name=workagram -Des.discovery.zen.ping.unicast.hosts=elasticsearch_master" links: - elasticsearch_master volumes: - "/opt/elasticsearch/data" environment: - ES_HEAP_SIZE=512melasticsearch2: image: elasticsearch:latest command: "elasticsearch -Des.cluster.name=workagram -Des.discovery.zen.ping.unicast.hosts=elasticsearch_master" links: - elasticsearch_master volumes: - "/opt/elasticsearch/data" environment: - ES_HEAP_SIZE=512m
Docker es and ES cluster