Docker搭建Elasticsearch 7.x集群
2019-10-08 本文已影响0人
哦呵呵_3579
记录通过Docker-Compose搭建es7集群遇到的坑,鉴于百度到的基本是es6的集群,直接复制黏贴基本无效,使用的docker-compose.yml如下:
```
version: '3'
services:
elasticsearch:
image: elasticsearch:7.3.1
container_name: elasticsearch
restart: always
environment:
- node.name=235
- network.publish_host=10.100.103.235
- network.host=0.0.0.0
- discovery.seed_hosts=10.100.103.233,10.100.103.234,10.100.103.235
- cluster.initial_master_nodes=10.100.103.233,10.100.103.234,10.100.103.235
- cluster.name=es-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ports:
- 9200:9200
- 9300:9300
ulimits:
memlock:
soft: -1
hard: -1
```
搭建完成之后调用http://10.100.103.233:9200/_cluster/health?pretty,检查集群是否运行正常