Elasticsearch 配置文件详解

本文详细介绍了如何配置Elasticsearch生产节点,包括设置集群名称、节点名称、数据存储路径、内存管理、网络连接、节点角色(master,data,ingest)以及节点发现机制。提醒读者在调整配置前理解目标和可能的影响。
摘要由CSDN通过智能技术生成
# ======================== 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.
# 注意:Elasticsearch 为大多数设置提供了合理的默认值。
# 在开始调整和调整配置之前,请确保您了解要完成的任务和结果。
#
# 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 时才能加入集群
# 即 同一集群内所有节点的 cluster.name 必须保持一致
#
cluster.name: tdc-es
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
# 使用节点的描述性名称:
# Elasticsearch 使用 node.name 作为 Elasticsearch 特定实例的人类可读标识符。
# 该名称包含在许多 API 的响应中。
# 默认情况下,节点名称在 Elasticsearch 启动时默认为机器的主机名。
#
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: /es/data
path.data: "D:\\es\\data"
#
# Path to log files:
#
# path.logs: /es/logs
path.logs: "D:\\es\\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.
# 当系统交换内存时,Elasticsearch 表现不佳。
#
# ---------------------------------- Network -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
# 默认情况下,Elasticsearch 只能在本地主机上访问。在此处设置不同的地址以在网络上公开此节点:
# 默认情况下,Elasticsearch 只绑定回环地址,例如 127.0.0.1 和 [::1]。
# 这足以在单个服务器上运行一个或多个节点的集群进行开发和测试,但弹性生产集群必须涉及其他服务器上的节点。
# 注意:当您为 network.host 提供值时,Elasticsearch 假定您正在从开发模式转移到生产模式,并将许多系统启动检查从警告升级到异常。
#
# network.host: 192.168.0.1
network.host: 0.0.0.0
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
# 默认情况下,Elasticsearch 侦听从 9200 开始的第一个空闲端口上的 HTTP 流量。在此处设置特定的 HTTP 端口:
http.port: 9201
#
# 传输网络层端口,用于集群间通信
transport.port: 9301
# 
# For more information, consult the network module documentation.
# 有关更多信息,请参阅网络模块文档。
#
# --------------------------------- Discovery ----------------------------------
#
# 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]"]
# 传递初始主机列表以在此节点启动时执行发现:
# 默认的主机列表是 ["127.0.0.1", "[::1]"]
# 注意:如果后期有新节点加入,新节点的 discovery.seed_hosts 没必要包含所有的节点,只要它里面包含集群中已有的节点信息,新节点就能发现整个集群了。
#
discovery.seed_hosts: ["127.0.0.1:9301"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
# 使用一组初始的符合主节点的节点引导集群:
# 即 初始的候选 master 节点列表
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
cluster.initial_master_nodes: ["node-1"]
#
# For more information, consult the discovery and cluster formation module documentation.
# 有关更多信息,请参阅发现和集群形成模块文档。
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
# 删除索引时需要明确的名称:
#
#action.destructive_requires_name: true

# 是否可以作为 master 的候选节点
node.master: true
# 是否可以存储数据
node.data: true
# 是否为预处理节点(默认 true)
node.ingest: false

  • 8
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值