Elasticsearch7.x配置檔案

縹緲之旅發表於2021-11-09

 

前言:

  以下配置檔案基於elasticsearch-7.13.4版本,當然也適用於其它7.x版本

叢集環境:

  部署3個節點的叢集,各個節點不做角色區分,既是master,也是data,在效能 上這種方式的叢集,不如單一角色叢集效能高。

      叢集名稱:escluster101

      httpport:9201 

      transport: 9301 

  node.name : es_{ip}_{httpport}

  開啟xpact許可權,有證書認證

 

配置檔案:elasticsearch.yml 

cluster.name: escluster101
node.name: es_192.168.10.101_9201
path.data: /work/data4/escluster101/es9201/data
path.logs: /work/data4/escluster101/es9201/logs
bootstrap.memory_lock: true
network.host: 192.168.10.101
http.port: 9201
transport.port: 9301
discovery.seed_hosts: ["192.168.10.102:9301", "192.168.10.101:9301", "192.168.10.103:9301"]
cluster.initial_master_nodes: ["es_192.168.10.102_9201", "es_192.168.10.101_9201", "es_192.168.10.103_9201"]
xpack.monitoring.enabled: true
xpack.monitoring.collection.enabled: true
xpack.watcher.enabled: true
xpack.graph.enabled: true
xpack.ml.enabled: false
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12
cluster.routing.allocation.same_shard.host: true
 
需要注意:
  cluster.initial_master_nodes 這個引數,在叢集初始啟動時,讀取該引數內容;叢集正常啟動之後,就不依賴該引數了。 後續叢集重啟或者新節點加入也不會使用該配置
參考官方文件: