Elasticsearch监控

简介

ElasticSearch是目前很流行的搜索服务器,ElasticSearch基于RESTful web接口提供服务。其监控从大的层面主要分为cluster监控和node监控两类。其中cluster监控又分为health和state两类,node的监控分为fs,http,indices,jvm,thread_pool 5个小类,按照需求总共采集了103项数据,全部基于ElasticSearch的接口采集,各采集项的释义见第三章《监控项释义》

监控部署

使用zabbix监控的监控采集脚本和监控模板已经分享到github,链接如下 https://github.com/chaubeau/Elasticsearch-zabbix-monitor。为了使监控脚本更具有通用性,所以脚本全部使用bash shell编写,如果Elasticsearch未使用默认的http端口启动,则需修改es_mon.sh的PORT变量。

监控项释义

监控项 单位 含义
es_cluster.health.status 该集群健康数字:红=0,黄色=1,绿=2
es_cluster.health.active_primary_shards shard 集群中活跃的主分片数量
es_cluster.health.shards shard 集群中活跃分片数量
es_cluster.health.initializing_shards shard 正在初始化的shard
es_cluster.health.number_of_pending_tasks task 待执行的task
es_cluster.health.relocating_shards shard 从一个节点搬到另一个节点的分片数量
es_cluster.health.unassigned_shards shard 未分配给节点的分片数量
es_cluster.state.docs_count doc 集群中所有分片的document数量
es_cluster.state.docs_deleted doc 集群中所有分片删除的document数量
es_cluster.state.number_of_data_nodes node 集群中数据节点总数
es_cluster.state.number_of_nodes node 集群中的节点总数
es_node.fs.total_available_in_bytes bytes 虚拟机可用的字节总数
es_node.fs.total_disk_io_op operations 操作的总次数
es_node.fs.total_disk_io_size_in_bytes bytes 操作使用的总字节数
es_node.fs.total_disk_read_size_in_bytes bytes 从文件存储读取的总字节数
es_node.fs.total_disk_reads reads 从文件存储器读取的总次数
es_node.fs.total_disk_write_size_in_bytes bytes 写入文件存储器的总字节数
es_node.fs.total_disk_writes writes 写入文件存储器的总次数
es_node.fs.total_free_in_bytes bytes 文件存储中未分配字节的总数
es_node.fs.total_total_in_bytes bytes 文件存储的总大小
es_node.indices.get_current requests 请求数
es_node.indices.get_exists_time seconds 请求上的时间
es_node.indices.get_exists_total requests 请求次数
es_node.indices.get_missing_time seconds 请求上的时间
es_node.indices.get_missing_total requests 请求次数
es_node.indices.get_time seconds 请求上的总时间
es_node.indices.get_total requests 请求次数
es_node.indices.flush_total flushes 自启动以来
es_node.indices.flush_total_time seconds 到磁盘所用的总时间
es_node.indices.query_cache_total_count request 总的query_cache请求数
es_node.indices.query_cache_hit_count request query_cache命中的请求数
es_node.indices.query_cache_miss_count request query_cache未命中的请求数
es_node.indices.query_cache_memory_size_in_bytes byte query_cache占用内存大小
es_node.http.current_open connection 连接数
es_node.http.total_opened connection 的总连接数
es_node.indices.indexing_delete_current document 中删除的文档数量
es_node.indices.indexing_delete_time second 中删除文档花费的总时间
es_node.indices.indexing_delete_total document 中删除的文档总数量
es_node.indices.indexing_index_current document 中索引的文档数量
es_node.indices.indexing_index_time second 索引文档所花费的时间
es_node.indices.indexing_index_total document 中被索引的文档总数量
es_node.indices.segments_count segments 分片中的段数
es_node.indices.segments_fixed_bit_set_memory_in_bytes byte 内存中固定位设置使用的大小
es_node.indices.segments_index_writer_memory_in_bytes byte 索引编写器使用的内存
es_node.indices.segments_memory_in_bytes bytes 索引段使用的内存
es_node.indices.segments_version_map_memory_in_bytes byte 段版本映射使用的内存
es_node.indices.merges_current merge 当前的活跃段合并数量
es_node.indices.merges_current_docs document 当前跨段合并的文档数量
es_node.indices.merges_current_size byte 当前被合并的段的大小
es_node.indices.merges_total merges 所有段的合并数量
es_node.indices.merges_total_docs document 跨所有合并段的文档数量
es_node.indices.merges_total_size byte 所有合并段的大小
es_node.indices.merges_total_time second 花在合并段上的时间
es_node.indices.refresh_total refreshe 索引刷新的总次数
es_node.indices.refresh_total_time milli 索引刷新花费的总时间
es_node.indices.search_fetch_current fetche 当前运行的搜索返回操作的数量
es_node.indices.search_fetch_open_contexts querie 活跃的搜索数量
es_node.indices.search_fetch_time second 在搜索返回操作上花费的总时间
es_node.indices.search_fetch_total fetche 搜索返回操作总数量
es_node.indices.search_query_current querie 当前运行的查询操作的数量
es_node.indices.search_query_time second 在查询操作上花费的总时间
es_node.indices.search_query_total querie 查询的操作的总数量
es_node.indices.store_size bytes 存储的总大小
es_node.thread_pool.bulk_active thread 线程池中的活跃线程数
es_node.thread_pool.bulk_queue thread 线程池中的排队线程数
es_node.thread_pool.bulk_rejected thread 线程池中被拒绝的线程数
es_node.thread_pool.bulk_threads thread 线程池中线程总数
es_node.thread_pool.flush_active thread 线程池中的活跃线程数
es_node.thread_pool.flush_queue thread 线程池中的排队线程数
es_node.thread_pool.flush_threads thread 线程池中线程总数
es_node.thread_pool.generic_active thread 线程池中的活跃线程数
es_node.thread_pool.generic_queue thread 线程池中的排队线程数
es_node.thread_pool.generic_threads thread 线程池中线程总数
es_node.thread_pool.get_active thread 线程池中的活跃线程数
es_node.thread_pool.get_queue thread 线程池中的排队线程数
es_node.thread_pool.get_threads thread 线程池中线程总数
es_node.thread_pool.index_active thread 线程池中的活跃线程数
es_node.thread_pool.index_queue thread 线程池中的排队线程数
es_node.thread_pool.index_threads threads 线程池中线程总数
es_node.thread_pool.management_active thread 线程池中的活跃线程数
es_node.thread_pool.management_queue thread 线程池中的排队线程数
es_node.thread_pool.management_threads thread 线程池中线程总数
es_node.thread_pool.refresh_active thread 线程池中的活跃线程数
es_node.thread_pool.refresh_queue thread 线程池中的排队线程数
es_node.thread_pool.refresh_threads thread 线程池中线程总数
es_node.thread_pool.search_active thread 线程池中的活跃线程数
es_node.thread_pool.search_queue thread 线程池中的排队线程数
es_node.thread_pool.search_threads thread 线程池中线程总数
es_node.thread_pool.snapshot_active thread 线程池中的活跃线程数
es_node.thread_pool.snapshot_queue thread 线程池中的排队线程数
es_node.thread_pool.snapshot_threads thread 线程池中线程总数
es_node.jvm.gc_collectors_old_collection_time second GC)
es_node.jvm.gc_collectors_old_count garbage GC)
es_node.jvm.gc_collectors_young_collection_time seconds GC)
es_node.jvm.gc_collectors_young_count garbage GC)
es_node.jvm.mem_heap_committed bytes 堆的内存量
es_node.jvm.mem_heap_used_percent JVM 堆当前使用的内存量化百分比
es_node.jvm.mem_heap_max bytes 堆可以使用的最大内存量
es_node.jvm.mem_heap_used bytes 堆当前使用的内存量
es_node.jvm.mem_non_heap_committed byte 非堆的内存量
es_node.jvm.mem_non_heap_used byte 中非堆内存使用量
es_node.jvm.threads_count thread 中活动线程的数量
es_node.jvm.threads_peak_count thread 使用的线程的峰值数