阐述ElasticSearch核心配置文件 ?

Elasticsearch的核心配置文件是elasticsearch.yml,它是一个文本文件,其中包含了各种配置参数和设置。以下是一些常见的配置参数和它们的含义:

  1. cluster.name: 用于标识Elasticsearch集群的名称,默认值为”elasticsearch”。
  2. transport.tcp.port: 集群的TCP通信端口,默认值为9300。
  3. cluster.routing.allocation.node_concurrent_recoveries: 控制恢复线程的个数,默认值为4。
  4. cluster.routing.allocation.balance.shard: 控制分配shard时的平衡因子,默认值为1.0。
  5. cluster.routing.allocation.balance.index: 控制分配index时的平衡因子,默认值为1.0。
  6. cluster.routing.allocation.balance.disk: 控制分配disk时的平衡因子,默认值为0.95。
  7. cluster.routing.allocation.balance.multiplier: 控制分配平衡因子的乘数,默认值为2.0。
  8. index.number_of_shards: 设置每个索引的shard数量,默认值为5。
  9. index.number_of_replicas: 设置每个索引的副本数量,默认值为1。
  10. discovery.zen.minimum_master_nodes: 指定需要选举出多少个master节点后,集群才能正常工作。

以上只是一些常见的配置参数示例,实际上还有很多其他的配置参数可以根据需要进行调整和配置。在修改配置文件后,需要重启Elasticsearch服务才能使配置生效。

发表评论

后才能评论