es 常用命令(二)

1. es 只读如何处理

1.1)ES集群只读
  查看只读的索引 curl :9200/_settings?pretty | grep read_only
  curl -s 
:9200/_cluster/settings?pretty\&include_defaults=true | grep read_only
  设置集群可写 curl -XPUT -H "Content-Type: application/json" http://127.0.0.1:9200/_cluster/settings -d '{ "persistent": { "cluster.blocks.read_only_allow_delete": null } }'
  设置索引可写 curl -XPUT -H "Content-Type: application/json" http://127.0.0.1:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
(先设置集群, 后设置索引)
'''
执行一下curl -XPUT -H "Content-Type: application/json" http://esip:port/_cluster/settings -d '{ "persistent": { "cluster.blocks.read_only_allow_delete": null } }'
再重复一上面插入数据的操作,查看日志

加大bulk的 百分比(备注:ES的643版本内存回收效率不太行)
curl -H "Content-Type:application/json" -XPUT
10.27.41.68:12009/_cluster/settings?pretty -d '{
"persistent": {
"indices.breaker.bulk.throttle": "98%",
"indices.breaker.search.throttle": "98%"
}

posted @ 2023-06-27 19:51  鱼丸粗面没鱼丸  阅读(77)  评论(0编辑  收藏  举报