靜態 Elasticsearch 設定

Elasticsearch 使用 YAML(Yet Another Markup Language)配置檔案,該檔案可以在預設的 Elasticsearch 目錄中找到( RPM 和 DEB 安裝會更改此位置等 )。

你可以在 config/elasticsearch.yml 中設定基本設定:

# Change the cluster name. All nodes in the same cluster must use the same name!
cluster.name: my_cluster_name

# Set the node's name using the hostname, which is an environment variable!
# This is a convenient way to uniquely set it per machine without having to make
#  a unique configuration file per node.
node.name: ${HOSTNAME}

# ALL nodes should set this setting, regardless of node type
path.data: /path/to/store/data

# This is a both a master and data node (defaults)
node.master: true
node.data: true

# This tells Elasticsearch to bind all sockets to only be available
#  at localhost (default)
network.host: _local_