美文网首页
分布式部署配置

分布式部署配置

作者: 阿尔卡雷特 | 来源:发表于2018-11-09 09:50 被阅读0次

配置同一版本es的conf/elasticsearch.yml

1,主机配置:

http.cors.enabled: true
http.cors.allow-origin: "*"

cluster.name: firefly
node.name: "master"
node.master: true

http.port: 9200
network.host: 127.0.0.1
transport.tcp.port: 9300

2,从属机配置:

cluster.name: firefly
node.name: "slave1"
node.master: false

network.host: 127.0.0.1
http.port: 8200

discovery.zen.ping.unicast.hosts: ["127.0.0.1:9300"]

ps:

1, cluster.name 是组名,必须保持主从一致
2,http.cors. 的配置是为了提供跨域请求,例如配合elasticsearch-head组件
3,node.name 节点名,唯一
4,node.master 组内只能存在一个主机
5,network.host 该参数用于同时设置bind_host和publish_host(publish_host为其他节点与该节点交互的IP地址)
6,从属机通过配置 discovery.zen.ping.unicast.hosts 与主机建立关联。

启动命令:

  1. ES6
    ./bin/elasticsearch -d

  2. head插件启动命令:
    npm run start

使用head插件看到的效果:


image.png

相关文章

网友评论

      本文标题:分布式部署配置

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