ES 配置说明

本文提供Elasticsearch配置文件(elasticsearch.yml)的精简中文翻译版本,涵盖了集群、节点、路径、内存、网络、发现及网关等核心配置项,并附带官方原版配置示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ES 配置说明

**ES 版本 elasticsearch-6.1.1
配置文件名称:config/elasticsearch.yml
嘿嘿,因为英文不行,原版太长,所以翻译一个简洁中文版本出来,也供大家学习

翻译版本

# ============ Elasticsearch Configuration ES配置 ===========
#注意:Elasticsearch为大多数设置提供了合理的默认值。
#在开始调整和调整配置之前,确保你了解你想要完成什么和后果。
#配置节点的主要方式是通过这个文件。 此模板列出 您可能想要为生产群集配置的最重要的设置。
#请参阅文档以获取有关配置选项的更多信息:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
# -------------- Cluster集群 ------------------------
# 为您的集群使用描述性名称:(译者注:默认为elasticsearch)
# cluster.name: my-application
# ----------------- Node 节点------------------------
# 为您的节点使用描述性名称:
#node.name: node-1
# 将自定义属性添加到节点:
#node.attr.rack: r1
# ------------------ Paths 路径--------------------
# 存储索引数据的目录路径(用逗号分隔多个位置):(译者注:)
#path.data: /path/to/data
# 日志文件的路径:
#path.logs: /path/to/logs
# ----------------------- Memory 内存-----------------------
# 在启动时锁定内存:
#bootstrap.memory_lock: true
#确保堆大小设置为大约一半的系统可用内存 并允许进程的所有者使用此限制。
#Elasticsearch在系统交换内存时表现不佳。
# -------------------- Network 网络-----------------------
# 将绑定地址设置为特定的IP (IPv4 or IPv6):
#network.host: 192.168.0.1
# 为HTTP设置自定义端口:
#http.port: 9200
# 有关更多信息,请参阅网络模块文档。
# ----------------- Discovery 发现---------------------
#启动新节点时,用来发现传递主机的初始化列表
#主机的默认列表是["127.0.0.1","[:: 1]"]
#(译者注:以下配置用于节点发现其它节点的配置,用于集群时候配置)
#discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#通过配置大多数节点(主节点总数/2 + 1)来防止“裂脑”(译者注:类似于精神分裂;无法选举出master,或者选举出多个master):
#discovery.zen.minimum_master_nodes: 
# 有关更多信息,请参阅zen发现模块文档。
# ------------------- Gateway 网关-------------------------
# (译者注:限制在N个节点启动后,才开始恢复过程操作:)
#gateway.recover_after_nodes: 3
# 有关更多信息,请参阅网关模块文档。
# ----------------- Various ----------------------------
# 删除索引时需要显式名称:
#action.destructive_requires_name: true

以下为官方原版

官网版本

# ============ 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):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# -------------------- 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):
#
#network.host: 192.168.0.1
#
# Set a custom port for HTTP:
#
#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:
# 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):
#
#discovery.zen.minimum_master_nodes: 
#
# For more information, consult the zen discovery 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值