# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#


# ---------------------------------- Linux Config -----------------------------------
### 需要修改操作系统的 ulimit 为 1024000 ###
### /etc/security/limits.conf 中增加###

#     *        soft    nofile  1024000
#     *        hard    nofile  1024000

###sysctl -p 立即生效###



###修改 操作系统网络参数 ###
### /etc/sysctl.conf ####

#fs.file-max = 1024000
#vm.max_map_count=1024000
#net.ipv4.tcp_syncookies = 1
#net.ipv4.tcp_tw_reuse = 1
#net.ipv4.tcp_tw_recycle = 0
#net.ipv4.tcp_timestamps = 1
#net.ipv4.tcp_fin_timeout = 30
#net.ipv4.ip_local_port_range = 10000 65000
#net.ipv4.tcp_max_tw_buckets=100000
#net.ipv4.tcp_mem = 786432 2097152 3145728
#net.ipv4.tcp_rmem = 4096 4096 16777216
#net.ipv4.tcp_wmem = 4096 4096 16777216

###systemctl restart network 重启网络生效###
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#

###集群名称,集群的节点要配置相同的集群名称###
cluster.name: mzywx-es-cluster
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
###ES的节点名称###
node.name: mzywx-es-node-1

###作为控制节点###
node.master: true
###作为数据节点###
node.data: true
###不作为流处理节点###
node.ingest: false
#
#
#
#
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
###数据文件路径,也可以存储到多个路径下,例如: - /data/es_1  - /data/es_2 ###
path.data: ./data
#
# Path to log files:
#
###日志文件路径###
path.logs: ./logs

#
###共享的文件系统,用于es镜像文件存储,可以写多个路径.后期使用cephfs实现###
path.repo: ["./backup"]
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#

###启动锁定内存,避免被释放,服务器内存小时建议关闭,容易启动报错###
#bootstrap.memory_lock: true
#
# Make sure that the heap size 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):
#

###绑定的IP地址####
network.host: 0.0.0.0


###单机模式,不会加入任何集群####
#discovery.type: single-node


#
# Set a custom port for HTTP:
#
####绑定的HTTP端口,默认9200#####
http.port: 9201

###Tcp访问的端口,默认9300,transport的client即将弃用,使用http协议的elasticsearch-rest-high-level-client###
transport.tcp.port: 9301

###允许跨域,使用head访问es###
http.cors.enabled: true
http.cors.allow-origin: "*"




###在阿里云上可能出现的问题：system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk###
#bootstrap.system_call_filter: false



#
# For more information, consult the network module documentation.
#
# --------------------------------- 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]"]
#
#集群内的主机列表,例如["127.0.0.1:9301", "127.0.0.1:9302"]###
#discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
###总节点/2+1作为最小的启动条件,防止脑裂. 例如3个节点,设置值为 3/2+1=2个节点,必须2个节点存活,整个集群才能正常启动###
#discovery.zen.minimum_master_nodes: 2
#
# For more information, consult the zen discovery module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
###集群重启,至少几个节点启动之后,才开始数据同步恢复,可以和minimum_master_nodes保持一致.###
#gateway.recover_after_nodes: 2
#
# For more information, consult the gateway module documentation.
#
###设置集群中自动发现其它节点时ping连接超时时间###
#discovery.zen.ping_timeout: 5s
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
