• 主master的配置
cluster.name: lihe
node.name: master
node.master: true
network.host: 127.0.0.1
  • 分slave的配置
xpack.ml.enabled: fales
http.cors.enabled: true
http.cors.allow-origin: \"*\"
cluster.name: lihe
node.name: slave1
node.master: false
network.host: 127.0.0.1
http.port: 8200
discovery.zen.ping.unicast.hosts: [\"127.0.0.1\"]

tip:

  • cluster.name 必须保持一致

  • salve的discovery.zen.ping.unicast.hosts不能缺少不然找不到master

  • 启动服务报错:[2018-12-19T11:19:49,420][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [master] uncaught exception in thread [main] org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[D:\\Mooc\\elasticsearch-6.5.3\\data\\lihe]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?

    解决方法:rm -rf data/nodes

  • 启动服务 访问head
    \"在这里插入图片描述\"

收藏 打印