1. 程式人生 > >elasticsearch-.yml(中文配置詳解)

elasticsearch-.yml(中文配置詳解)

explicit 生產環境 設置 綁定 端口 after over rms make

# ======================== 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 see the documentation for further information on configuration options:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html>
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
# 集群名稱,默認是elasticsearch
# cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
# 節點名稱,默認從elasticsearch-2.4.3/lib/elasticsearch-2.4.3.jar!config/names.txt中隨機選擇一個名稱
# 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):
# 可以指定es的數據存儲目錄,默認存儲在es_home/data目錄下
# path.data: /path/to/data
#
# Path to log files:
# 可以指定es的日誌存儲目錄,默認存儲在es_home/logs目錄下
# path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
# 鎖定物理內存地址,防止elasticsearch內存被交換出去,也就是避免es使用swap交換分區
# bootstrap.memory_lock: true
#
#
#
# 確保ES_HEAP_SIZE參數設置為系統可用內存的一半左右
# 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.
#
# 當系統進行內存交換的時候,es的性能很差
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
#
# 為es設置ip綁定,默認是127.0.0.1,也就是默認只能通過127.0.0.1 或者localhost才能訪問
# es1.x版本默認綁定的是0.0.0.0 所以不需要配置,但是es2.x版本默認綁定的是127.0.0.1,需要配置
# Set the bind address to a specific IP (IPv4 or IPv6):
#
# network.host: 192.168.0.1
#
#
# 為es設置自定義端口,默認是9200
# 註意:在同一個服務器中啟動多個es節點的話,默認監聽的端口號會自動加1:例如:9200,9201,9202...
# Set a custom port for HTTP:
#
# http.port: 9200
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
#
# --------------------------------- Discovery ----------------------------------
#
# 當啟動新節點時,通過這個ip列表進行節點發現,組建集群
# 默認節點列表:
# 127.0.0.1,表示ipv4的回環地址。
# [::1],表示ipv6的回環地址
#
# 在es1.x中默認使用的是組播(multicast)協議,默認會自動發現同一網段的es節點組建集群,
# 在es2.x中默認使用的是單播(unicast)協議,想要組建集群的話就需要在這指定要發現的節點信息了。
# 註意:如果是發現其他服務器中的es服務,可以不指定端口[默認9300],如果是發現同一個服務器中的es服務,就需要指定端口了。
# 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"]
#
#
#
#
# 通過配置這個參數來防止集群腦裂現象 (集群總節點數量/2)+1
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
# discovery.zen.minimum_master_nodes: 3
#
# 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:
# 一個集群中的N個節點啟動後,才允許進行數據恢復處理,默認是1
# gateway.recover_after_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>
#
# ---------------------------------- Various -----------------------------------
# 在一臺服務器上禁止啟動多個es服務
# Disable starting multiple nodes on a single system:
#
# node.max_local_storage_nodes: 1
#
# 設置是否可以通過正則或者_all刪除或者關閉索引庫,默認true表示必須需要顯式指定索引庫名稱
# 生產環境建議設置為true,刪除索引庫的時候必須顯式指定,否則可能會誤刪索引庫中的索引庫。
# Require explicit names when deleting indices:
#
# action.destructive_requires_name: true

elasticsearch-.yml(中文配置詳解)