nodes-info.asciidoc 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. [[cluster-nodes-info]]
  2. === Nodes info API
  3. ++++
  4. <titleabbrev>Nodes info</titleabbrev>
  5. ++++
  6. Returns cluster nodes information.
  7. [[cluster-nodes-info-api-request]]
  8. ==== {api-request-title}
  9. `GET /_nodes` +
  10. `GET /_nodes/<node_id>` +
  11. `GET /_nodes/<metric>` +
  12. `GET /_nodes/<node_id>/<metric>`
  13. [[cluster-nodes-info-api-prereqs]]
  14. ==== {api-prereq-title}
  15. * If the {es} {security-features} are enabled, you must have the `monitor` or
  16. `manage` <<privileges-list-cluster,cluster privilege>> to use this API.
  17. [[cluster-nodes-info-api-desc]]
  18. ==== {api-description-title}
  19. The cluster nodes info API allows to retrieve one or more (or all) of
  20. the cluster nodes information. All the nodes selective options are explained
  21. <<cluster-nodes,here>>.
  22. By default, it returns all attributes and core settings for a node.
  23. [role="child_attributes"]
  24. [[cluster-nodes-info-api-path-params]]
  25. ==== {api-path-parms-title}
  26. `<metric>`::
  27. (Optional, string)
  28. Limits the information returned to the specific metrics. Supports a
  29. comma-separated list, such as `http,ingest`.
  30. +
  31. [%collapsible%open]
  32. .Valid values for `<metric>`
  33. ====
  34. `http`::
  35. HTTP connection information.
  36. `ingest`::
  37. Information about ingest pipelines and processors.
  38. `jvm`::
  39. JVM stats, memory pool information, garbage collection, buffer pools, number of
  40. loaded/unloaded classes.
  41. `os`::
  42. Operating system stats, load average, mem, swap.
  43. `plugins`::
  44. +
  45. --
  46. Details about the installed plugins and modules per node. The following
  47. information is available for each plugin and module:
  48. * `name`: plugin name
  49. * `version`: version of Elasticsearch the plugin was built for
  50. * `description`: short description of the plugin's purpose
  51. * `classname`: fully-qualified class name of the plugin's entry point
  52. * `has_native_controller`: whether or not the plugin has a native controller
  53. process
  54. --
  55. `process`::
  56. Process statistics, memory consumption, cpu usage, open file descriptors.
  57. `settings`::
  58. Lists all node settings in use as defined in the `elasticsearch.yml` file.
  59. `thread_pool`::
  60. Statistics about each thread pool, including current size, queue and rejected
  61. tasks
  62. `transport`::
  63. Transport statistics about sent and received bytes in cluster communication.
  64. ====
  65. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=node-id]
  66. [[cluster-nodes-info-api-response-body]]
  67. ==== {api-response-body-title}
  68. `build_hash`::
  69. Short hash of the last git commit in this release.
  70. `host`::
  71. The node's host name.
  72. `ip`::
  73. The node's IP address.
  74. `name`::
  75. The node's name.
  76. `total_indexing_buffer`::
  77. Total heap allowed to be used to hold recently indexed
  78. documents before they must be written to disk. This size is
  79. a shared pool across all shards on this node, and is
  80. controlled by <<indexing-buffer,Indexing Buffer settings>>.
  81. `total_indexing_buffer_in_bytes`::
  82. Same as `total_indexing_buffer`, but expressed in bytes.
  83. `transport_address`::
  84. Host and port where transport HTTP connections are accepted.
  85. `version`::
  86. {es} version running on this node.
  87. The `os` flag can be set to retrieve information that concern the operating
  88. system:
  89. `os.refresh_interval_in_millis`::
  90. Refresh interval for the OS statistics
  91. `os.name`::
  92. Name of the operating system (ex: Linux, Windows, Mac OS X)
  93. `os.arch`::
  94. Name of the JVM architecture (ex: amd64, x86)
  95. `os.version`::
  96. Version of the operating system
  97. `os.available_processors`::
  98. Number of processors available to the Java virtual machine
  99. `os.allocated_processors`::
  100. The number of processors actually used to calculate thread pool size. This
  101. number can be set with the <<node.processors, `node.processors`>>
  102. setting of a node and defaults to the number of processors reported by
  103. the OS.
  104. The `process` flag can be set to retrieve information that concern the current
  105. running process:
  106. `process.refresh_interval_in_millis`::
  107. Refresh interval for the process statistics
  108. `process.id`::
  109. Process identifier (PID)
  110. `process.mlockall`::
  111. Indicates if the process address space has been successfully locked in memory
  112. [[cluster-nodes-info-api-query-params]]
  113. ==== {api-query-parms-title}
  114. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=flat-settings]
  115. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
  116. [[cluster-nodes-info-api-example]]
  117. ==== {api-examples-title}
  118. [source,console]
  119. --------------------------------------------------
  120. # return just process
  121. GET /_nodes/process
  122. # same as above
  123. GET /_nodes/_all/process
  124. # return just jvm and process of only nodeId1 and nodeId2
  125. GET /_nodes/nodeId1,nodeId2/jvm,process
  126. # same as above
  127. GET /_nodes/nodeId1,nodeId2/info/jvm,process
  128. # return all the information of only nodeId1 and nodeId2
  129. GET /_nodes/nodeId1,nodeId2/_all
  130. --------------------------------------------------
  131. The `_all` flag can be set to return all the information - or you can omit it.
  132. [[cluster-nodes-info-api-example-plugins]]
  133. ===== Example for plugins metric
  134. If `plugins` is specified, the result will contain details about the installed
  135. plugins and modules:
  136. [source,console]
  137. --------------------------------------------------
  138. GET /_nodes/plugins
  139. --------------------------------------------------
  140. // TEST[setup:node]
  141. The API returns the following response:
  142. [source,console-result]
  143. --------------------------------------------------
  144. {
  145. "_nodes": ...
  146. "cluster_name": "elasticsearch",
  147. "nodes": {
  148. "USpTGYaBSIKbgSUJR2Z9lg": {
  149. "name": "node-0",
  150. "transport_address": "192.168.17:9300",
  151. "host": "node-0.elastic.co",
  152. "ip": "192.168.17",
  153. "version": "{version}",
  154. "build_flavor": "{build_flavor}",
  155. "build_type": "{build_type}",
  156. "build_hash": "587409e",
  157. "roles": [
  158. "master",
  159. "data",
  160. "ingest"
  161. ],
  162. "attributes": {},
  163. "plugins": [
  164. {
  165. "name": "analysis-icu",
  166. "version": "{version}",
  167. "description": "The ICU Analysis plugin integrates Lucene ICU module into elasticsearch, adding ICU relates analysis components.",
  168. "classname": "org.elasticsearch.plugin.analysis.icu.AnalysisICUPlugin",
  169. "has_native_controller": false
  170. }
  171. ],
  172. "modules": [
  173. {
  174. "name": "lang-painless",
  175. "version": "{version}",
  176. "description": "An easy, safe and fast scripting language for Elasticsearch",
  177. "classname": "org.elasticsearch.painless.PainlessPlugin",
  178. "has_native_controller": false
  179. }
  180. ]
  181. }
  182. }
  183. }
  184. --------------------------------------------------
  185. // TESTRESPONSE[s/"_nodes": \.\.\./"_nodes": $body.$_path,/]
  186. // TESTRESPONSE[s/"elasticsearch"/$body.cluster_name/]
  187. // TESTRESPONSE[s/"USpTGYaBSIKbgSUJR2Z9lg"/\$node_name/]
  188. // TESTRESPONSE[s/"name": "node-0"/"name": $body.$_path/]
  189. // TESTRESPONSE[s/"transport_address": "192.168.17:9300"/"transport_address": $body.$_path/]
  190. // TESTRESPONSE[s/"host": "node-0.elastic.co"/"host": $body.$_path/]
  191. // TESTRESPONSE[s/"ip": "192.168.17"/"ip": $body.$_path/]
  192. // TESTRESPONSE[s/"build_hash": "587409e"/"build_hash": $body.$_path/]
  193. // TESTRESPONSE[s/"roles": \[[^\]]*\]/"roles": $body.$_path/]
  194. // TESTRESPONSE[s/"attributes": \{[^\}]*\}/"attributes": $body.$_path/]
  195. // TESTRESPONSE[s/"plugins": \[[^\]]*\]/"plugins": $body.$_path/]
  196. // TESTRESPONSE[s/"modules": \[[^\]]*\]/"modules": $body.$_path/]
  197. [[cluster-nodes-info-api-example-ingest]]
  198. ===== Example for ingest metric
  199. If `ingest` is specified, the response contains details about the available
  200. processors per node:
  201. [source,console]
  202. --------------------------------------------------
  203. GET /_nodes/ingest
  204. --------------------------------------------------
  205. // TEST[setup:node]
  206. The API returns the following response:
  207. [source,console-result]
  208. --------------------------------------------------
  209. {
  210. "_nodes": ...
  211. "cluster_name": "elasticsearch",
  212. "nodes": {
  213. "USpTGYaBSIKbgSUJR2Z9lg": {
  214. "name": "node-0",
  215. "transport_address": "192.168.17:9300",
  216. "host": "node-0.elastic.co",
  217. "ip": "192.168.17",
  218. "version": "{version}",
  219. "build_flavor": "{build_flavor}",
  220. "build_type": "{build_type}",
  221. "build_hash": "587409e",
  222. "roles": [],
  223. "attributes": {},
  224. "ingest": {
  225. "processors": [
  226. {
  227. "type": "date"
  228. },
  229. {
  230. "type": "uppercase"
  231. },
  232. {
  233. "type": "set"
  234. },
  235. {
  236. "type": "lowercase"
  237. },
  238. {
  239. "type": "gsub"
  240. },
  241. {
  242. "type": "convert"
  243. },
  244. {
  245. "type": "remove"
  246. },
  247. {
  248. "type": "fail"
  249. },
  250. {
  251. "type": "foreach"
  252. },
  253. {
  254. "type": "split"
  255. },
  256. {
  257. "type": "trim"
  258. },
  259. {
  260. "type": "rename"
  261. },
  262. {
  263. "type": "join"
  264. },
  265. {
  266. "type": "append"
  267. }
  268. ]
  269. }
  270. }
  271. }
  272. }
  273. --------------------------------------------------
  274. // TESTRESPONSE[s/"_nodes": \.\.\./"_nodes": $body.$_path,/]
  275. // TESTRESPONSE[s/"elasticsearch"/$body.cluster_name/]
  276. // TESTRESPONSE[s/"USpTGYaBSIKbgSUJR2Z9lg"/\$node_name/]
  277. // TESTRESPONSE[s/"name": "node-0"/"name": $body.$_path/]
  278. // TESTRESPONSE[s/"transport_address": "192.168.17:9300"/"transport_address": $body.$_path/]
  279. // TESTRESPONSE[s/"host": "node-0.elastic.co"/"host": $body.$_path/]
  280. // TESTRESPONSE[s/"ip": "192.168.17"/"ip": $body.$_path/]
  281. // TESTRESPONSE[s/"build_hash": "587409e"/"build_hash": $body.$_path/]
  282. // TESTRESPONSE[s/"roles": \[[^\]]*\]/"roles": $body.$_path/]
  283. // TESTRESPONSE[s/"attributes": \{[^\}]*\}/"attributes": $body.$_path/]
  284. // TESTRESPONSE[s/"processors": \[[^\]]*\]/"processors": $body.$_path/]