es学习-1

准备7台虚拟机,安装java和es(跳过)
比如ip是192.168.1.151-192.168.1.157

所有虚拟机都配置

cluster.name: my-application
node.name: node-1 (node-1到node-7)
network.host: 192.168.1.151 (192.168.1.151到192.168.1.157)
discovery.seed_hosts: ["192.168.1.151","192.168.152","192.168.1.153","192.168.1.154","192.168.1.155","192.168.1.156","192.168.1.157"]

151-153(master)

node.master: true
node.data: false
cluster.initial_master_nodes: ["node-1", "node-2","node-3"]

154(coordinate)

node.master: false
node.data: false

155-157(data)

node.master: false
node.data: true

通过./bin/elasticsearch启动所有node

测试代码

推荐阅读更多精彩内容