Elasticsearch7.x配置文件

 

前言:

  以下配置文件基於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 這個參數,在集群初始啟動時,讀取該參數內容;集群正常啟動之後,就不依賴該參數了。 後續集群重啟或者新節點加入也不會使用該配置
參考官方文檔: