重点配置项

    1. cluster.name: es-mutile-process
    2. node.name: node1
    3. node.master: true
    4. node.data: false
    5. search.remote.connect: false
    6. path.data: /data/elasticsearch/ ##同一节点的不同进程需设置为不同
    7. path.logs: /data/logs/elasticsearch/ ##同一节点的不同进程需设置为不同
    8. bootstrap.memory_lock: true
    9. network.host: [_local_, _site_]
    10. network.publish_host: _site_
    11. transport.tcp.port: 9300 ##同一节点的不同进程需设置为不同
    12. http.port: 9200 ##同一节点的不同进程需设置为不同
    13. discovery.zen.ping_timeout: 30s
    14. discovery.zen.fd.ping_timeout: 90s
    15. discovery.zen.fd.ping_interval: 10s
    16. discovery.zen.fd.ping_retries: 6
    17. discovery.zen.ping.unicast.hosts: ["IP:transport.tcp.port","IP:transport.tcp.port1"]
    18. ##官方建议将单播主机列表维护为群集中符合主机资格的节点的列表,添加集群主节点IP+port,如果为非单机多节点模式,使用默认端口,可以直接填写IP
    19. discovery.zen.minimum_master_nodes: 2
    20. ##最少需要几个具有master资格的活节点才能进行主节点选举,计算公式 (有master资格节点数/2) + 1
    21. action.destructive_requires_name: true
    22. http.cors.enabled: true
    23. http.cors.allow-origin: "*"
    24. cluster.routing.allocation.same_shard.host: true
    25. ##是否检查允许同一个主机上有一个shard的多个副本。默认为false,即不检查。
    26. 此参数仅在同一台机器上启动多个节点时配置有效。

    cluster.routing.allocation.same_shard.host Allows to perform a check to prevent allocation of multiple instances of the same shard on a single host, based on host name and host address. Defaults to false, meaning that no check is performed by default. This setting only applies if multiple nodes are started on the same machine.


    zen discovery
    It is recommended that the unicast hosts list be maintained as the list of master-eligible nodes in the cluster.