小伙伴们,你们好呀,我是老寇
1.准备三台机器(三台需提前安装好elasticsearch 7.6.2)
192.168.1.1 node-elasticsearch-1
192.168.1.2 node-elasticsearch-2
192.168.1.3 node-elasticsearch-3
2.配置三台机器的elasticsearch.yml
node-elasticsearch-1(改一下节点名称)
http.cors.enabled: true
http.cors.allow-origin: "*"
network.host: 0.0.0.0
cluster.name: laokou-elasticsearch
node.name: node-elasticsearch-1
http.port: 9200
node.master: true
node.data: true
node.ingest: false
cluster.initial_master_nodes: ["node-elasticsearch-1","node-elasticsearch-2","node-elasticsearch-3"]
discovery.zen.ping.unicast.hosts: ["192.168.1.1", "192.168.1.2","192.168.1.3"]
discovery.zen.minimum_master_nodes: 1
path.data: /home/koushenhai/elasticsearch/data # 数据目录位置
path.logs: /home/koushenhai/elasticsearch/logs # 日志目录位置
node-elasticsearch-2(改一下节点名称)
http.cors.enabled: true
http.cors.allow-origin: "*"
network.host: 0.0.0.0
cluster.name: laokou-elasticsearch
node.name: node-elasticsearch-2
http.port: 9200
node.master: true
node.data: true
node.ingest: false
cluster.initial_master_nodes: ["node-elasticsearch-1","node-elasticsearch-2","node-elasticsearch-3"]
discovery.zen.ping.unicast.hosts: ["192.168.1.1", "192.168.1.2","192.168.1.3"]
discovery.zen.minimum_master_nodes: 1
path.data: /home/koushenhai/elasticsearch/data # 数据目录位置
path.logs: /home/koushenhai/elasticsearch/logs # 日志目录位置
node-elasticsearch-3(改一下节点名称)
http.cors.enabled: true
http.cors.allow-origin: "*"
network.host: 0.0.0.0
cluster.name: laokou-elasticsearch
node.name: node-elasticsearch-3
http.port: 9200
node.master: true
node.data: true
node.ingest: false
cluster.initial_master_nodes: ["node-elasticsearch-1","node-elasticsearch-2","node-elasticsearch-3"]
discovery.zen.ping.unicast.hosts: ["192.168.1.1", "192.168.1.2","192.168.1.3"]
discovery.zen.minimum_master_nodes: 1
path.data: /home/koushenhai/elasticsearch/data # 数据目录位置
path.logs: /home/koushenhai/elasticsearch/logs # 日志目录位置
3.分别启动node-elasticsearch-1、node-elasticsearch-2、node-elasticsearch-3(和上篇启动es命令一致)
4.运行截图
|