您的位置:首页 > 其它

ElasticSearch学习(5)-配置文件详解

2018-01-27 00:00 731 查看
1.配置文件详解
elasticsearch.yml文件:

# ======================== 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 #
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
------集群的名称(集群中该节点必须完全一致)------
cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
------节点名称(集群中节点名称必须唯一)----
node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
------ES的数据存储目录------
path.data: /path/to/data
#
# Path to log files:
#

-----ES的日志存储目录-------
path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
-----锁定物理内存地址,防止ElasticSearch内存被交换出去,避免使用swap交换分区-----
bootstrap.memory_lock: true

-------确保ES_HEAP_SIZE参数为系统内存一般左右-------
# 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.
------当系统进行内存交换的时候,ES的性能很差------
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
------ES的ip绑定------
network.host: 192.168.15.38
#
# Set a custom port for HTTP:
#
----ES所占用的端口-----
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:

------组建集群时的节点列表------
["192.168.1.10","192.168.1.11","192.168.1.12"]

# The default list of hosts is ["127.0.0.1", "[::1]"]

--------集群中主节点列表-------
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-------(节点总数/2)+1
discovery.zen.minimum_master_nodes: 3
#
# For more information, consult the zen discovery module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
-----一个集群中N个节点启动后才能进行数据恢复处理-------
gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------

# 在一台服务器上禁止启动多个es服务
# 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
#

-----head插件所需要的配置跨域----
http.cors.enabled: true
http.cors.allow-origin: "*"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ElasticSearch