elasticsearch 运维监控

1.删除文档后,释放内存

参考: https://www.itranslater.com/qa/details/2582866090724426752

2.删除索引而不是删除文档

  删除的文档不会立即从 Elasticsearch 的文件系统中删除。相反,Elasticsearch 在每个相关分片上将文档标记为已删除。
如果可能,请改为删除整个索引。Elasticsearch 可以立即直接从文件系统中删除已删除的索引并释放资源。

3.  索引分片未分配,集群状态yellow

  查看分片状态 http://es-cn-09k1o69vj0006jcz9.public.elasticsearch.aliyuncs.com:9200/_cluster/allocation/explain

     explain说明

  解决文档参考:

      https://knight.blog.csdn.net/article/details/108939236 

      https://www.elastic.co/guide/cn/elasticsearch/guide/current/heap-sizing.html#heap-sizing

  总结:一般是jvm内存设置太小,等访问压力小时,分片状态的yellow为自动转为green

 4. 使用阿里云的运维监控指标

  https://help.aliyun.com/document_detail/169555.html

 5.监控

  单个索引占用最大空间
  单个索引最大文档数
  单个索引健康状态
  GET _cat/indices?bytes=b&s=store.size:desc,index:asc&v=true
  GET /_cat/indices?v=true&s=index 这种存储单位以kb或mb或gb显示
  查看资料:https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html

  每个节点磁盘达到80% 预警,可以直接拿 disk.percent参数
  GET /_cat/allocation?v=true&ts=false
  公式:(disk.total-disk.avail)/disk.total
  查看资料:https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html

  查看索引的分配,如果有错,查看当前状态 current_state:unassigned

 GET _cluster/allocation/explain

   查看资料:https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html

  查看文档数
  GET /_cat/count/vendor_price_history?v=true

  集群状态
  GET /_cat/health?v=true&ts=false

  GET /_cluster/health

   查看所有索引,知道分个索引的信息,包括是否健康

  GET _cat/indices?v=true

  jvm堆和内存空间,cpu使用率
  GET /_cat/nodes?v=true 

  资料:https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-nodes.html

  heap.percenthpheapPercent(Default) Maximum configured heap, such as 7.

   ram.percentrpramPercent(Default) Used total memory percentage, such as 47.

  挂起的任务数
  GET /_cat/pending_tasks?v=true

  正在执行的任务数
  GET _cat/tasks?v=true

  线程pool
  GET /_cat/thread_pool?v=true
  GET /_cat/thread_pool/search?v=true&h=id,name,active,rejected,completed
  详细资料:https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html

  使用GET /_cluster/stats/  是综合所有信息包括:磁盘、内存、jvm堆、集群状态、可用的处理器等

较大的分片在失败后需要更长的时间才能恢复。当一个节点发生故障时,Elasticsearch 会在数据层的剩余节点之间重新平衡该节点的分片。此恢复过程通常涉及通过网络复制分片内容,因此 100GB 分片的恢复时间是 50GB 分片的两倍。查询语句:GET _cat/shards?v=true&h=index,prirep,shard,store&s=prirep,store&bytes=gb

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值