美文网首页
Elasticsearch 分布式安装与配置

Elasticsearch 分布式安装与配置

作者: 简书网abc | 来源:发表于2019-11-02 23:24 被阅读0次

1,由于内存太小,所以首先要设置Java运行时内存

$vim config/jvm.options


图片.png

2,配置主服务器

network.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"

cluster.name: ming #集群名称
node.name: master #节点名称
node.master: true #是否是主服务器

3,配置从服务器

cluster.name: ming #集群名称
node.name: slave1 #节点名称
network.host: 127.0.0.1
http.port: 9201 #监听端口
//选举master, 可以是多个
discovery.zen.ping.unicast.hosts: ["127.0.0.1"]
//阻止 脑裂 ,通过大多数节点的配置(总结点数的一半以上)
discovery.zen.minimum_master_nodes: 3

4,分别启动服务器,并在head插件里面查看节点结构

图片.png

相关文章

网友评论

      本文标题:Elasticsearch 分布式安装与配置

      本文链接:https://www.haomeiwen.com/subject/vobxfqtx.html