创建ES集群
1.在elasticSearch/config目录下修改elasticsearch.yml
文件夹
# ---------------------------------- Cluster -----------------------------------## Use a descriptive name for your cluster:# #集群名称(集群内所有机器集群名称都要相同) cluster.name: cloudx_web_test1## ------------------------------------ Node ------------------------------------## Use a descriptive name for the node:## node.name: node-2 #节点名称 node.name: node-1 #该节点是否可以被选为主节点 node.master: true #该节点是否存有数据 node.data: true #主分片数 index.number_of_shards: 3 #复制分片数 index.number_of_replicas: 1 #服务绑定ip地址 network.host: 192.168.0.57 #(ES2.X新增配置)集群内机器ip discovery.zen.ping.unicast.hosts: ["192.168.0.57","192.168.0.58"] #是否支持多播(默认true) discovery.zen.ping.multicast.enabled: true
2.分别在后台启动两个ES节点 nohup ./elasticsearch &
,默认日志存放文件在logs中。 3.访问http://180.76.189.84:9200/_plugin/kopf/#!/cluster
可以查看集群的情况以及健康状态。