# ---------------------------------- Cluster -----------------------------------
#配置ES的集群名称,默认是elasticsearch
cluster.name: my-application
# ------------------------------------ Node ------------------------------------
#节点名字,通常一台机器一个节点,默认es会随机指定一个名字,一个节点或者多个节点组成cluster集群。
node.name: node-1
#设置节点是否有资格被选为master,默认true
node.master:
#指定节点是否存储索引数据 默认true
node.data:
#单机允许最大存储的节点数,通常单机启动一个节点建议设置1,开发环境单机启动多个节点可设置大于1.
node.max_local_storage_nodes:
#
#node.attr.rack: r1
# ----------------------------------- Paths ------------------------------------
#设置配置文件的存储位置,tar、zip默认在es的config文件夹,rpm在/etc/elasticsearch下
path.conf:
#设置索引数据的存储位置,默认是es的data目录,可以设置多个存储路径,用逗号隔开
path.data: /path/to/data
#日志文件的路径
path.logs: /path/to/logs
#插件路劲 默认es的plugins文件下
path.plugins:
# ----------------------------------- Memory -----------------------------------
#true:可以锁住ES使用的内存,避免内存与swap分区交换数据
bootstrap.memory_lock: true
# ---------------------------------- Network -----------------------------------
#设置绑定主机的IP地址,设置0.0.0.0表示绑定任何IP,运行外网访问,生产环境建议改成具体IP,
network.host: 192.168.0.1
#设置对外服务的端口,默认9200
http.port: 9200
#集群几点相互通信的端口
transport.tcp.port:9300
# --------------------------------- Discovery ----------------------------------
#
#设置集群中master节点的初始列表
discovery.zen.ping.unicast.hosts:["127.0.0.1", "[::1]"]
#ES自动发现节点的超时时间
discovery.zen.ping.timeout:3s
#主节点数量的最少值,公式:(master_eligible_nodes/2)+1 比如有3个符合要求的主节点,那么这里要设置2
discovery.zen.minimum_master_nodes:
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
#允许跨域
http.cors.enabled: true
http.cors.allow-origin: "*"