docker es and es cluster
Posted szllq2000
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker es and es cluster相关的知识,希望对你有一定的参考价值。
How to use this image
You can run the default elasticsearch
command simply:
$ docker run -d elasticsearch
You can also pass in additional flags to elasticsearch
:
$ docker run -d elasticsearch elasticsearch -Des.node.name="TestNode"
This image comes with a default set of configuration files for elasticsearch
, but if you want to provide your own set of configuration files, you can do so via a volume mounted at/usr/share/elasticsearch/config
:
$ docker run -d -v "$PWD/config":/usr/share/elasticsearch/config elasticsearch
This image is configured with a volume at /usr/share/elasticsearch/data
to hold the persisted index data. Use that 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
), so standard container linking will make it automatically available to the linked 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=512m
elasticsearch2:
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的主要内容,如果未能解决你的问题,请参考以下文章
docker之es+es-head+kibana+ik分词器安装