发布日:2022-02-11 18:22 阅读数:
cluster.name: es-study node.name: node-0 node.master: true node.attr.rack: r1 network.host: 127.0.0.1 http.port: 9200 transport.tcp.port: 9900 discovery.seed_hosts: ["127.0.0.1:9900", "127.0.0.1:9901", "127.0.0.1:9902"] cluster.initial_master_nodes: ["node-0","node-1","node-2"]
elasticsearch_1/elasticsearch.yml
cluster.name: es-study node.name: node-1 node.master: false node.attr.rack: r1 node.max_local_storage_nodes: 3 bootstrap.memory_lock: false network.host: 127.0.0.1 http.port: 9201 transport.tcp.port: 9901 discovery.seed_hosts: ["127.0.0.1:9900", "127.0.0.1:9901", "127.0.0.1:9902"] cluster.initial_master_nodes: ["node-0","node-1","node-2"]
elasticsearch_2/elasticsearch.yml
cluster.name: es-study node.name: node-2 node.master: false node.attr.rack: r1 bootstrap.memory_lock: false network.host: 127.0.0.1 http.port: 9202 transport.tcp.port: 9902 discovery.seed_hosts: ["127.0.0.1:9900", "127.0.0.1:9901", "127.0.0.1:9902"] cluster.initial_master_nodes: ["node-0","node-1","node-2"]
启动项目(按顺序之启动):
elasticsearch_0\bin\elasticsearch.bat elasticsearch_1\bin\elasticsearch.bat elasticsearch_2\bin\elasticsearch.bat
主节点启动成功,如下:
重新启动子节点,启动后访问下面url验证下,成功了!
http://localhost:9200/_cluster/health http://localhost:9200/ http://localhost:9201/ http://localhost:9202/
编辑:航网科技 来源:腾讯云
本文版权归原作者所有 转载请注明出处
Copyright © 2011-2020 www.hangw.com. All Rights Reserved 深圳航网科技有限公司 版权所有 增值电信业务经营许可证:粤B2-20201122 - 粤ICP备14085080号
微信扫一扫咨询客服
全国免费服务热线
0755-36300002