cluster.name: elasticsearch-cluster
node.name: es-node1
network.host: 0.0.0.0
network.publish_host: 192.168.16.225
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: ["192.168.16.225:9300","192.168.16.226:9300","192.168.16.227:9300"]
discovery.zen.minimum_master_nodes: 1
docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -d -p 9200:9200 -p 9300:9300 -v /ES/config/es.yml:/usr/share/elasticsearch/config/elasticsearch.yml --name ES01 elasticsearch:6.7.1
cluster.name: elasticsearch-cluster
node.name: es-node2
network.host: 0.0.0.0
network.publish_host: 192.168.16.226
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: ["192.168.16.225:9300","192.168.16.226:9300","192.168.16.227:9300"]
discovery.zen.minimum_master_nodes: 1
docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -d -p 9200:9200 -p 9300:9300 -v /ES/config/es.yml:/usr/share/elasticsearch/config/elasticsearch.yml --name ES02 elasticsearch:6.7.1
cluster.name: elasticsearch-cluster
node.name: es-node3
network.host: 0.0.0.0
network.publish_host: 192.168.16.227
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: ["192.168.16.225:9300","192.168.16.226:9300","192.168.16.227:9300"]
discovery.zen.minimum_master_nodes: 1
docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -d -p 9200:9200 -p 9300:9300 -v /ES/config/es.yml:/usr/share/elasticsearch/config/elasticsearch.yml --name ES03 elasticsearch:6.7.1
备注:
启动es失败: root所需要的管理员 max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
sysctl -a|grep vm.max_map_count
在 /etc/sysctl.conf文件最后添加一行
vm.max_map_count=262144
执行命令生效:sysctl -p