Cluster Stats

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

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

贡献者 : 那伊抹微笑

Cluster Stats(集群统计信息)API 可以获取集范围内的统计信息。该 API 返回基本的索引 metric(度量)(分片数量,存储大小,内存使用)和关于当前集群(编号,角色,系统,jvm 版本,内存使用,cpu 和安装的插件)中节点的信息。

  1. curl -XGET 'http://localhost:9200/_cluster/stats?human&pretty'

响应示例如下 :

  1. {
  2. "timestamp": 1459427693515,
  3. "cluster_name": "elasticsearch",
  4. "status": "green",
  5. "indices": {
  6. "count": 2,
  7. "shards": {
  8. "total": 10,
  9. "primaries": 10,
  10. "replication": 0,
  11. "index": {
  12. "shards": {
  13. "min": 5,
  14. "max": 5,
  15. "avg": 5
  16. },
  17. "primaries": {
  18. "min": 5,
  19. "max": 5,
  20. "avg": 5
  21. },
  22. "replication": {
  23. "min": 0,
  24. "max": 0,
  25. "avg": 0
  26. }
  27. }
  28. },
  29. "docs": {
  30. "count": 10,
  31. "deleted": 0
  32. },
  33. "store": {
  34. "size": "16.2kb",
  35. "size_in_bytes": 16684,
  36. "throttle_time": "0s",
  37. "throttle_time_in_millis": 0
  38. },
  39. "fielddata": {
  40. "memory_size": "0b",
  41. "memory_size_in_bytes": 0,
  42. "evictions": 0
  43. },
  44. "query_cache": {
  45. "memory_size": "0b",
  46. "memory_size_in_bytes": 0,
  47. "total_count": 0,
  48. "hit_count": 0,
  49. "miss_count": 0,
  50. "cache_size": 0,
  51. "cache_count": 0,
  52. "evictions": 0
  53. },
  54. "completion": {
  55. "size": "0b",
  56. "size_in_bytes": 0
  57. },
  58. "segments": {
  59. "count": 4,
  60. "memory": "8.6kb",
  61. "memory_in_bytes": 8898,
  62. "terms_memory": "6.3kb",
  63. "terms_memory_in_bytes": 6522,
  64. "stored_fields_memory": "1.2kb",
  65. "stored_fields_memory_in_bytes": 1248,
  66. "term_vectors_memory": "0b",
  67. "term_vectors_memory_in_bytes": 0,
  68. "norms_memory": "384b",
  69. "norms_memory_in_bytes": 384,
  70. "doc_values_memory": "744b",
  71. "doc_values_memory_in_bytes": 744,
  72. "index_writer_memory": "0b",
  73. "index_writer_memory_in_bytes": 0,
  74. "version_map_memory": "0b",
  75. "version_map_memory_in_bytes": 0,
  76. "fixed_bit_set": "0b",
  77. "fixed_bit_set_memory_in_bytes": 0,
  78. "file_sizes": {}
  79. },
  80. "percolator": {
  81. "num_queries": 0
  82. }
  83. },
  84. "nodes": {
  85. "count": {
  86. "total": 1,
  87. "data": 1,
  88. "coordinating_only": 0,
  89. "master": 1,
  90. "ingest": 1
  91. },
  92. "versions": [
  93. "5.0.1"
  94. ],
  95. "os": {
  96. "available_processors": 8,
  97. "allocated_processors": 8,
  98. "names": [
  99. {
  100. "name": "Mac OS X",
  101. "count": 1
  102. }
  103. ],
  104. "mem" : {
  105. "total" : "16gb",
  106. "total_in_bytes" : 17179869184,
  107. "free" : "78.1mb",
  108. "free_in_bytes" : 81960960,
  109. "used" : "15.9gb",
  110. "used_in_bytes" : 17097908224,
  111. "free_percent" : 0,
  112. "used_percent" : 100
  113. }
  114. },
  115. "process": {
  116. "cpu": {
  117. "percent": 9
  118. },
  119. "open_file_descriptors": {
  120. "min": 268,
  121. "max": 268,
  122. "avg": 268
  123. }
  124. },
  125. "jvm": {
  126. "max_uptime": "13.7s",
  127. "max_uptime_in_millis": 13737,
  128. "versions": [
  129. {
  130. "version": "1.8.0_74",
  131. "vm_name": "Java HotSpot(TM) 64-Bit Server VM",
  132. "vm_version": "25.74-b02",
  133. "vm_vendor": "Oracle Corporation",
  134. "count": 1
  135. }
  136. ],
  137. "mem": {
  138. "heap_used": "57.5mb",
  139. "heap_used_in_bytes": 60312664,
  140. "heap_max": "989.8mb",
  141. "heap_max_in_bytes": 1037959168
  142. },
  143. "threads": 90
  144. },
  145. "fs": {
  146. "total": "200.6gb",
  147. "total_in_bytes": 215429193728,
  148. "free": "32.6gb",
  149. "free_in_bytes": 35064553472,
  150. "available": "32.4gb",
  151. "available_in_bytes": 34802409472
  152. },
  153. "plugins": [
  154. // all plugins installed on nodes
  155. {
  156. "name": "analysis-stempel",
  157. "version": "5.0.1",
  158. "description": "The Stempel (Polish) Analysis plugin integrates Lucene stempel (polish) analysis module into elasticsearch.",
  159. "classname": "org.elasticsearch.plugin.analysis.stempel.AnalysisStempelPlugin"
  160. }
  161. ]
  162. }
  163. }