详情: http://www.javashuo.com/article/p-rpbsowhq-cm.html 将实验机器/etc/elasticsearch/elasticsearch.yml 中配置文件改成node
cluster.name: myes #ES集群名称 node.name: node-2 ##节点名称 path.data: /data/es-date #数据存储的目录(多个目录使用逗号分隔) path.logs: /var/log/elasticsearch #日志格式 bootstrap.memory_lock: true #锁住es内存,保证内存不分配至交换分区 network.host: 192.168.83.30 #设置本机IP地址 http.port: 9200 #端口默认9200 discovery.zen.ping.unicast.hosts: ["192.168.83.20", "192.168.83.30"]
提示:cluster.name 同样便可被发现bootstrap
[root@test2 elasticsearch]# curl -XGET 'http://192.168.83.20:9200/_cluster/health?pretty=true' { "cluster_name" : "myes ", "status" : "green", "timed_out" : false, "number_of_nodes" : 2, "number_of_data_nodes" : 2, "active_primary_shards" : 15, "active_shards" : 30, "relocating_shards" : 0, "initializing_shards" : 0, "unassigned_shards" : 0, "delayed_unassigned_shards" : 0, "number_of_pending_tasks" : 0, "number_of_in_flight_fetch" : 0, "task_max_waiting_in_queue_millis" : 0, "active_shards_percent_as_number" : 100.0 }