1. 获取当前所有index配置

curl -XGET http://localhost:9200/_settings

 

2. 获取某些index的配置

curl -XGET http://localhost:9200/test-*/_settings

 

3. 动态修改某些index配置,增加replica

curl -XPUT http://localhost:9200/test-*/_settings -d '{"replicas":1}'

 

4. 动态修改某些index配置,删除replica

curl -XPUT http://localhost:9200/test-*/_settings -d '{"replicas":0}'

 

实测新增replica速度很快,cpu占比不算高,远低于重新索引数据,基本接近远程复制文件的速度。有replica之后,logstash或es会有集群负载均衡,比如replica为1,基本primary和replica CPU占比均衡,性能上ES整体大约多耗用20%CPU,磁盘空间多耗用1倍。

相关文章:

  • 2021-05-28
  • 2022-12-23
  • 2021-08-02
  • 2021-08-11
  • 2021-12-20
  • 2022-01-27
  • 2022-12-23
  • 2021-10-15
猜你喜欢
  • 2022-12-23
  • 2022-01-24
  • 2021-08-30
  • 2021-12-19
  • 2021-05-29
  • 2021-12-01
相关资源
相似解决方案