Elasticsearch配置文件说明

404446295 8年前

来自: http://www.begincode.net/blog/blogId/83


官方配置文档

      https://www.elastic.co/guide/en/elasticsearch/reference/current/setup.html

配置详解

# ---------------------------------- Cluster (集群配置)-----------------------------------  #  # cluster.name: my-application   (自定义集群名称,相同集群该名称相同  my-application)  #  # ------------------------------------ Node ------------------------------------  #   node.name: node-1     (当前节点名称,同一个集群中不能重复)    #  # Add custom attributes to the node:  #  # node.rack: r1  #  # ----------------------------------- Paths (数据,日志路径配合)------------------------------------  #  # Path to directory where to store the data (separate multiple locations by comma):  #   path.data: /home/yang/elasticsearch-2.2.0/data  (数据存储路径,支持多路径)  #  # Path to log files:  #   path.logs: /home/yang/elasticsearch-2.2.0/logs  (日志文件存储路径)  #  # ----------------------------------- Memory -----------------------------------  #  # Lock the memory on startup:  #  # bootstrap.mlockall: true   (是否锁住内存,指长期占用该内存,不产生内存交换,防止内存交换导致性能降低,配合内存设置使用)  #  # Make sure that the `ES_HEAP_SIZE` environment variable is set to about half the memory  # available on the system and that the owner of the process is allowed to use this limit.  #  # Elasticsearch performs poorly when the system is swapping the memory.  #  # ---------------------------------- Network(网络配置) -----------------------------------  #  # Set the bind address to a specific IP (IPv4 or IPv6):  #  # network.host: 192.168.0.1      (IP地址,url访问的ip)  #  # Set a custom port for HTTP:  #  # http.port: 9200       (http访问端口)  #  # For more information, see the documentation at:  # <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>  #  # --------------------------------- Discovery (节点发现配置)----------------------------------  #  # Pass an initial list of hosts to perform discovery when new node is started:  # The default list of hosts is ["127.0.0.1", "[::1]"]  #  # discovery.zen.ping.unicast.hosts: ["host1", "host2"]    (初始主节点列表,默认启动是按照这个初始化master节点)  #  # Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):  #  # discovery.zen.minimum_master_nodes: 3(集群中可以知道其他n个有master自个节点,默认 节点数/2 + 1)  #  # For more information, see the documentation at:  # <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>  #  # ---------------------------------- Gateway-------------------------  #  # Block initial recovery after a full cluster restart until N nodes are started:  #  # gateway.recover_after_nodes: 3   (n个节点启动后开始数据恢复)  #  # For more information, see the documentation at:  # <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>  #  # ---------------------------------- Various -----------------------------------  #  # Disable starting multiple nodes on a single system:  #  # node.max_local_storage_nodes: 1  (禁用多节点从同一个位置启动)  #  # Require explicit names when deleting indices:  #  # action.destructive_requires_name: true  (设置是否可以通过正则或者_all删除或者关闭索引)