Elastic Search相关配置

在生产环境中,强烈建议elasticsearch.yml中的path.data和path.logs设置为$ES_HOME之外的位置。
默认情况下,Docker、Debian和RPM安装会将数据和日志写入$ES_HOME之外的位置。

---------------------------------- Cluster -----------------------------------

Use a descriptive name for your cluster:

给集群取名字

cluster.name: elasticClusterName

------------------------------------ Node ------------------------------------

Use a descriptive name for the node:

给 当前ElasticSearch 节点取名字

node.name: node-1

node.master: true

node.data: true

node.ingest: false

当前 节点 在 集群中的角色

node.roles: [master,data,remote_cluster_client,ingest,ml,transform]

node.roles: {{$node_roles}}

----------------------------------- Paths ------------------------------------

Path to directory where to store the data (separate multiple locations by comma):

path.data: data

Path to log files:

设置 日志 存放地址

path.logs: /path/to/logs

----------------------------------- Memory -----------------------------------

Lock the memory on startup:

bootstrap.memory_lock: true

---------------------------------- Network -----------------------------------

Set the bind address to a specific IP (IPv4 or IPv6):

节点绑定 主机,0.0.0.0代表允许所有IP访问

network.host: 0.0.0.0

节点暴露的地址,elasticSearch 对外暴露的IP地址,即安装本机的地址

network.publish_host: XXX_IP

Set a custom port for HTTP:

对外暴露的端口

http.port: 9200

Set a custom port for TCP:

数据交互的 端口

transport.port: 9300
ingest.geoip.downloader.enabled: false

--------------------------------- Discovery ----------------------------------

Pass an initial list of hosts to perform discovery when this node is started:

集群 地址集合,所有安装了 elastic search 的地址

discovery.seed_hosts: ["XXX_IP1:9300","XXX_IP2:9300","XXX_IP3:9300"]

Bootstrap the cluster using an initial set of master-eligible nodes:

集群节点 名称 集合

cluster.initial_master_nodes: ["node-1","node-2","node-3"]

---------------------------------- Various -----------------------------------

Allow creating indices automatically:

action.auto_create_index: true

Require explicit names when deleting indices:

action.destructive_requires_name: true
xpack.security.audit.enabled: true
xpack.ml.enabled: false

Set to false to disable Watcher:

xpack.watcher.enabled: false

Security settings:

安全配 置

xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /app/elasticsearch/1/config/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: /app/elasticsearch/1/config/elastic-certificates.p12

posted on 2024-11-28 14:11  vello  阅读(5)  评论(0编辑  收藏  举报