docker安装elasticsearch

docker pull elasticserach:5.6.10

运行:docker run --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms256m -Xmx256m"  -v /mydata/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v /mydata/elasticsearch/data:/usr/share/elasticsearch/data -v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins -d elasticsearch:5.6.10

开机自启:docker update --restart=always elasticsearch 

挂载的配置文件:

http.cors.enabled: true
http.cors.allow-origin: "*"
cluster.name: my-application
http.port: 9200
transport.tcp.port: 9300
network.publish_host: 172.31.69.1
network.bind_host: 0.0.0.0 # 绑定到0.0.0.0,允许任何ip来访问

------------------------------------------------

kibana运行

docker run -it -d -e ELASTICSEARCH_URL=http://192.168.211.132:9200 --name kibana --restart=always -p 5601:5601 kibana:5.6.8
posted @ 2020-08-18 09:42  Dreamvv  阅读(84)  评论(0编辑  收藏  举报