Elasticsearch Nodes Stats

x33g5p2x  于2021-03-14 发布在 ElasticSearch  
字(6.7k)|赞(0)|评价(0)|浏览(448)

原文链接 : https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-nodes-stats.html

译文链接 : http://www.apache.wiki/display/Elasticsearch/Nodes+Stats

贡献者 : [那伊抹微笑]

cluster nodes stats(集群节点统计信息)API 可以获取集群中一个或者多个节点的统计信息。

curl -XGET 'http://localhost:9200/_nodes/stats'
curl -XGET 'http://localhost:9200/_nodes/nodeId1,nodeId2/stats'

第一个命令获取了集群中所有节点的统计信息。

第二个只选择获取了 nodeId1nodeId2 的节点的统计信息。

所有节点选择的选项在这里有更详细的说明。

默认情况下,返回所有的统计信息。您也可以通过组合任何的 **indices**,``**os**,``**process**,``**jvm**,``**transport**,``**http**,``**fs**,**breaker**和 **thread_pool** 来限制它们。例如 : 

选项描述
indicesIndices stats about size, document count, indexing and deletion times, search times, field cache size, merges and flushes
fsFile system information, data path, free disk space, read/write stats (see FS information)
httpHTTP connection information
jvmJVM stats, memory pool information, garbage collection, buffer pools, number of loaded/unloaded classes
osOperating system stats, load average, mem, swap (see OS statistics)
processProcess statistics, memory consumption, cpu usage, open file descriptors (see Process statistics)
thread_poolStatistics about each thread pool, including current size, queue and rejected tasks
transportTransport statistics about sent and received bytes in cluster communication
breakerStatistics about the field data circuit breaker
discoveryStatistics about the discovery
ingestStatistics about ingest preprocessing
# return indices and os
curl -XGET 'http://localhost:9200/_nodes/stats/os'
# return just os and process
curl -XGET 'http://localhost:9200/_nodes/stats/os,process'
# specific type endpoint
curl -XGET 'http://localhost:9200/_nodes/stats/process'
curl -XGET 'http://localhost:9200/_nodes/10.0.0.1/stats/process'

所有的统计信息都可以通过 /_nodes/stats/_all 或者 **/_nodes/stats?metric=_all** 来明确的请求。

FS information(文件系统的信息)

可以设置 fs 标记以获取与文件系统有关的统计信息 : 

标记描述
fs.timestampLast time the file stores statistics have been refreshed
fs.total.total_in_bytesTotal size (in bytes) of all file stores
fs.total.free_in_bytesTotal number of unallocated bytes in all file stores
fs.total.available_in_bytesTotal number of bytes available to this Java virtual machine on all file stores
fs.dataList of all file stores
fs.data.pathPath to the file store
fs.data.mountMount point of the file store (ex: /dev/sda2)
fs.data.typeType of the file store (ex: ext4)
fs.data.total_in_bytesTotal size (in bytes) of the file store
fs.data.free_in_bytesTotal number of unallocated bytes in the file store
fs.data.available_in_bytesTotal number of bytes available to this Java virtual machine on this file store
fs.data.spins (Linux only)Indicates if the file store is backed by spinning storage. null means we could not determine it, truemeans the device possibly spins and false means it does not (ex: solid-state disks).
fs.io_stats.devices (Linux only)Array of disk metrics for each device that is backing an Elasticsearch data path. These disk metrics are probed periodically and averages between the last probe and the current probe are computed.
fs.io_stats.devices.device_name (Linux only)The Linux device name.
fs.io_stats.devices.operations (Linux only)The total number of read and write operations for the device completed since starting Elasticsearch.
fs.io_stats.devices.read_operations (Linux only)The total number of read operations for the device completed since starting Elasticsearch.
fs.io_stats.devices.write_operations (Linux only)The total number of write operations for the device completed since starting Elasticsearch.
fs.io_stats.devices.read_kilobytes (Linux only)The total number of kilobytes read for the device since starting Elasticsearch.
fs.io_stats.devices.write_kilobytes (Linux only)The total number of kilobytes written for the device since starting Elasticsearch.
fs.io_stats.operations (Linux only)The total number of read and write operations across all devices used by Elasticsearch completed since starting Elasticsearch.
fs.io_stats.read_operations (Linux only)The total number of read operations for across all devices used by Elasticsearch completed since starting Elasticsearch.
fs.io_stats.write_operations (Linux only)The total number of write operations across all devices used by Elasticsearch completed since starting Elasticsearch.
fs.io_stats.read_kilobytes (Linux only)The total number of kilobytes read across all devices used by Elasticsearch since starting Elasticsearch.
fs.io_stats.write_kilobytes (Linux only)The total number of kilobytes written across all devices used by Elasticsearch since starting Elasticsearch.

Operating System statistics(操作系统的统计信息)

可以设置 os 标记以获取与操作系统有关的统计信息 : 

标记描述
os.timestampLast time the operating system statistics have been refreshed
os.cpu.percentRecent CPU usage for the whole system, or -1 if not supported
os.cpu.load_average.1mOne-minute load average on the system (field is not present if one-minute load average is not available)
os.cpu.load_average.5mFive-minute load average on the system (field is not present if five-minute load average is not available)
os.cpu.load_average.15mFifteen-minute load average on the system (field is not present if fifteen-minute load average is not available)
os.mem.total_in_bytesTotal amount of physical memory in bytes
os.mem.free_in_bytesAmount of free physical memory in bytes
os.mem.free_percentPercentage of free memory
os.mem.used_in_bytesAmount of used physical memory in bytes
os.mem.used_percentPercentage of used memory
os.swap.total_in_bytesTotal amount of swap space in bytes
os.swap.free_in_bytesAmount of free swap space in bytes
os.swap.used_in_bytesAmount of used swap space in bytes

Process statistics(进程统计信息)

可以设置 **process **标记以获取与当前运行中的进程有关的统计信息 : 

标记描述
process.timestampLast time the process statistics have been refreshed
process.open_file_descriptorsNumber of opened file descriptors associated with the current process, or -1 if not supported
process.max_file_descriptorsMaximum number of file descriptors allowed on the system, or -1 if not supported
process.cpu.percentCPU usage in percent, or -1 if not known at the time the stats are computed
process.cpu.total_in_millisCPU time (in milliseconds) used by the process on which the Java virtual machine is running, or -1 if not supported
process.mem.total_virtual_in_bytesSize in bytes of virtual memory that is guaranteed to be available to the running process

Field data statistics(字段数据的统计信息)

您可以获取关于在节点级别或者索引级别上的字段数据内存使用情况的信息。

# Node Stats
curl -XGET 'http://localhost:9200/_nodes/stats/indices/?fields=field1,field2&pretty'

# Indices Stat
curl -XGET 'http://localhost:9200/_stats/fielddata/?fields=field1,field2&pretty'

# You can use wildcards for field names
curl -XGET 'http://localhost:9200/_stats/fielddata/?fields=field*&pretty'
curl -XGET 'http://localhost:9200/_nodes/stats/indices/?fields=field*&pretty'

Search groups(搜索组)

您可以获取关于在这个节点上执行搜索的 search groups 的统计信息。

# All groups with all stats
curl -XGET 'http://localhost:9200/_nodes/stats?pretty&groups=_all'

# Some groups from just the indices stats
curl -XGET 'http://localhost:9200/_nodes/stats/indices?pretty&groups=foo,bar'

Ingest statistics(摄取数据的统计信息)

可以设置 ingest 标记以获取与摄取数据有关的统计信息 : 

标记描述
ingest.total.countThe total number of document ingested during the lifetime of this node
ingest.total.time_in_millisThe total time spent on ingest preprocessing documents during the lifetime of this node
ingest.total.currentThe total number of documents currently being ingested.
ingest.total.failedThe total number ingest preprocessing operations failed during the lifetime of this node

除了全部的摄取数据统计信息之外,在每一个管道的基础之上也提供了这些统计信息。

相关文章