003-ES集羣

ES 集羣

詳情: 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

查看es集羣是否正常

[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
}

相關文章
相關標籤/搜索