可以修改整个集群的特定设置. 设置的修改可以保存 (重启后仍然生效) 或者 是临时的 (不会保留到下次重启后). 请看示例:
curl -XPUT localhost:9200/_cluster/settings -d '{ "persistent" : { "discovery.zen.minimum_master_nodes" : 2 } }'
或者:
curl -XPUT localhost:9200/_cluster/settings -d '{ "transient" : { "discovery.zen.minimum_master_nodes" : 2 } }'
下面是可修改的设置列表:
discovery.zen.minimum_master_nodes
index.shard.recovery.concurrent_streams
cluster.routing.allocation.node_initial_primaries_recoveries
,cluster.routing.allocation.node_concurrent_recoveries
cluster.routing.allocation.cluster_concurrent_rebalance
cluster.routing.allocation.awareness.attributes
cluster.routing.allocation.awareness.force.*
cluster.routing.allocation.disable_allocation
cluster.routing.allocation.disable_replica_allocation
cluster.routing.allocation.include.*
cluster.routing.allocation.exclude.*
indices.cache.filter.size
indices.ttl.interval
indices.recovery.file_chunk_size
,indices.recovery.translog_ops
,indices.recovery.translog_size
,indices.recovery.compress
,indices.recovery.concurrent_streams
,indices.recovery.max_size_per_sec
.- @@
Logger 的值可以通过 logger.
prefix 设置. 还可以修改更多的设置项.
可以用 curl -XGET localhost:9200/_cluster/settings
来查看有哪些设置项.