美文网首页
Elasticsearch新增节点

Elasticsearch新增节点

作者: engineer_tang | 来源:发表于2020-01-24 17:08 被阅读0次

    1. elasticsearch新增节点

    1.1 第一个节点配置文件如下

    cluster.name: joe-es
    node.name: node-1
    network.host: 192.168.1.160
    network.publish_host: 192.168.1.160
    http.port: 9200
    transport.host: 192.168.1.160
    transport.tcp.port: 9300
    
    discovery.zen.minimum_master_nodes: 2
    discovery.zen.fd.ping_timeout: 1m
    discovery.zen.fd.ping_retries: 5
    http.cors.enabled: true
    http.cors.allow-origin: "*"
    #
    ##设置主服务
    node.master: true
    #
    node.data: true
    
    discovery.seed_hosts: ["192.168.1.160:9300", "192.168.1.161:9300"]
    #cluster.initial_master_nodes: ["192.169.1.160"]
    cluster.initial_master_nodes: ["node-1", "node-2"]
    
    

    1.2 第二个节点配置如下

    cluster.name: joe-es
    node.name: node-2
    network.host: 192.168.1.161
    network.publish_host: 192.168.1.161
    http.port: 9200
    transport.host: 192.168.1.161
    transport.tcp.port: 9300
    
    node.master: true
    node.data: true
    
    #支持跨域访问
    http.cors.enabled: true
    http.cors.allow-origin: "*"
    
    discovery.zen.minimum_master_nodes: 2
    
    #discovery.seed_hosts: ["192.168.1.161:9300"]
    discovery.seed_hosts: ["192.168.1.160:9300", "192.168.1.161:9300"]
    discovery.zen.fd.ping_timeout: 1m
    discovery.zen.fd.ping_retries: 5
    cluster.initial_master_nodes: ["node-1", "node-2"]
    
    action.destructive_requires_name: true
    action.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history*
    xpack.security.enabled: false
    xpack.monitoring.enabled: true
    xpack.graph.enabled: false
    xpack.watcher.enabled: false
    xpack.ml.enabled: false
    
    

    1.3 需要注意的关键点

    1. 防火墙端口是否开放
    2. 如果没有自动加入节点、请检查es目录下data中是否清空 不清空会无法加入

    相关文章

      网友评论

          本文标题:Elasticsearch新增节点

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