赞
踩
集群上的某个索引突然写不了数据,根据提供的异常信息,表现为写请求被服务端拒绝了,随即做了以下检查,
索引是都被只读了
获取索引的相关配置,看是否有以下配置
index.blocks.read_only
设置为 true
使索引和索引元数据只读,设置为 false
以允许写入和元数据更改。
index.blocks.read_only_allow_delete
与 index.blocks.read_only
相同,但允许删除索引以释放资源。
index.blocks.read
设置为true
以禁用对索引的读取操作。
index.blocks.write
设置为true
以禁用对索引的数据写入操作。 与 read_only
不同,此设置不会影响元数据。 例如,您可以使用write
块关闭索引,但不能使用read_only
块关闭索引。
GET indexname
了解索引写入的TPS
通过业务系统反馈的,或者可以为ES集群接入监控。
查询索引分片分布情况
GET _cat/shards/indexName?v
类似结果如下
index shard prirep state docs store ip node
gudong20220304001 0 p STARTED 0 261b 192.168.1.1 es02
查询分片所在节点的线程池情况
GET /_cat/thread_pool?v&s=node_name
结果类似如下,在实际中发现写的线程池active和queue已经达到最大值,且rejected(拒绝)中有大量的数据。明显是写入线程池不够用了。
node_name name active queue rejected es02 analyze 0 0 0 es02 fetch_shard_started 0 0 0 es02 fetch_shard_store 0 0 0 es02 flush 0 0 0 es02 force_merge 0 0 0 es02 generic 0 0 0 es02 get 0 0 0 es02 index 0 0 0 es02 listener 0 0 0 es02 management 1 0 0 es02 refresh 0 0 0 es02 rollup_indexing 0 0 0 es02 scroll 0 0 0 es02 search 0 0 0 es02 search_throttled 0 0 0 es02 snapshot 0 0 0 es02 warmer 0 0 0 es02 watcher 0 0 0 es02 write 1 0 0
查询相关节点的Hot 线程情况
GET /_nodes/es02/hot_threads
会在结果中,展示节点的什么线程对CPU占用的信息和一些堆栈信息。
查询分片所在节点的任务情况,筛选出写任务,找到写入量比较多的索引,
GET _tasks?nodes=es02&actions=indices:data*
会在结果中的description
中展示索引名称
处理方式
紧急方式
服务端:
客户端:
友好方式
服务端:
客户端:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。