修改配置文件
cluster.name: docker-cluster
node.name: es-node1
network.host: 0.0.0.0
network.publish_host: 172.100.0.103
http.port: 9200
transport.tcp.port: 9300
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["172.100.0.103:9300","172.100.0.104:9300","172.100.0.105:9300"]
discovery.zen.minimum_master_nodes: 1
path.repo: ["/usr/share/elasticsearch/backup"]
运行ES镜像
docker run --name ES01 -e ES_JAVA_OPTS="-Xms16g -Xmx16g" --restart=always --net sup-network --ip 172.100.0.103 -p 9200:9200 -p 9300:9300 -v /home/elasticsearch/data:/usr/share/elasticsearch/data -v /home/elasticsearch/es1.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v /home/nfs/esbak:/usr/share/elasticsearch/backup -d elasticsearch:6.6.2
查看集群状态
curl -XGET http://localhost:9200/_cat/nodes?v