首先各節點安裝好elasticsearch
參考:https://mp.csdn.net/mdeditor/91390470#
1 集羣配置elasticsearch.yml
(1)節點1配置
cluster.name: tang-cluster
node.name: es-2
注意需要建立/elastic/data目錄
path.data: /elastic/data
node.master: true
node.data: true
path.logs: /elastic/logs
network.host: ip(本機ip)
http.port: 9200
transport.tcp.port: 9300 集羣間的tcp通信端口
集羣中的其他節點(可以配置多個 如[“192.168.2.137”,“192.168.2.142”])
discovery.zen.ping.unicast.hosts: [“192.168.2.137”]master節點的ip
discovery.zen.minimum_master_nodes: 2(數字爲集羣數量/2 +1)根據公式
(2)節點2配置
cluster.name: tang-cluster
node.name: es-2
注意需要建立/elastic/data目錄
path.data: /elastic/data
node.master: true
node.data: true
path.logs: /elastic/logs
network.host: ip(本機ip)
http.port: 9200
transport.tcp.port: 9300 集羣間的tcp通信端口
集羣中的其他節點(可以配置多個 如[“192.168.2.137”,“192.168.2.142”])
discovery.zen.ping.unicast.hosts: [“192.168.2.137”]
discovery.zen.minimum_master_nodes: 2(數字爲集羣數量/2 +1)
2 集羣管理工具cerebro
(1)解壓
(2)bin路徑下打開命令窗口
(3)訪問localhost:9000 端口默認爲9000
(4)輸入ES服務的ip和端口
(5)可以查看到集羣信息
(6)創建索引