Nodes Info

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

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

贡献者 : 那伊抹微笑

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

  1. curl -XGET 'http://localhost:9200/_nodes'
  2. curl -XGET 'http://localhost:9200/_nodes/nodeId1,nodeId2'

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

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

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

默认情况下,它只节点所有属性和核心配置 :

属性/配置 描述
build_hash Short hash of the last git commit in this release.
host The node’s host name.
http_address Host and port where primary HTTP connections are accepted.
ip The node’s IP address.
name The node’s name.
total_indexing_buffer Total heap allowed to be used to hold recently indexed documents before they must be written to disk. This size is a shared pool across all shards on this node, and is controlled by Indexing Buffer settings.
total_indexing_buffer_in_bytes Same as total_indexing_buffer, but expressed in bytes.
transport_address Host and port where transport HTTP connections are accepted.
version Elasticsearch version running on this node.

它也可以只获取 **settings**,``**os**,``**process**,``**jvm**,``**thread_pool**,``**transport**,``**http**,``**plugins**,ingest**indices**的信息。

  1. curl -XGET 'http://localhost:9200/_nodes/process'
  2. curl -XGET 'http://localhost:9200/_nodes/_all/process'
  3. curl -XGET 'http://localhost:9200/_nodes/nodeId1,nodeId2/jvm,process'
  4. # same as above
  5. curl -XGET 'http://localhost:9200/_nodes/nodeId1,nodeId2/info/jvm,process'
  6. curl -XGET 'http://localhost:9200/_nodes/nodeId1,nodeId2/_all

可以设置 _all 标记以返回所有的信息 - 或者您也可以简单的忽略它。

Operating System information(操作系统信息)

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

标记 描述
os.refresh_interval_in_millis Refresh interval for the OS statistics
os.name Name of the operating system (ex: Linux, Windows, Mac OS X)
os.arch Name of the JVM architecture (ex: amd64, x86)
os.version Version of the operating system
os.available_processors Number of processors available to the Java virtual machine
os.allocated_processors The number of processors actually used to calculate thread pool size. This number can be set with the processors setting of a node and defaults to the number of processors reported by the OS. In both cases this number will never be larger than 32.

Process information(进程信息)

可以设置 process 标记以获取与当前正在运行的进程的有关的信息 :

标记 描述
process.refresh_interval_in_millis Refresh interval for the process statistics
process.id Process identifier (PID)
process.mlockall Indicates if the process address space has been successfully locked in memory

Plugins information(插件信息)

plugins- 如果被设置,那么结果将包含关于每一个节点已加载的插件的详细信息 :

  • name: plugin name
  • description: plugin description if any
  • site: true if the plugin is a site plugin
  • jvm: true if the plugin is a plugin running in the JVM
  • url: URL if the plugin is a site plugin

其结果看起来和下面相似 :

  1. {
  2. "cluster_name" : "test-cluster-MacBook-Air-de-David.local",
  3. "nodes" : {
  4. "hJLXmY_NTrCytiIMbX4_1g" : {
  5. "name" : "node4",
  6. "transport_address" : "inet[/172.18.58.139:9303]",
  7. "hostname" : "MacBook-Air-de-David.local",
  8. "version" : "0.90.0.Beta2-SNAPSHOT",
  9. "http_address" : "inet[/172.18.58.139:9203]",
  10. "plugins" : [ {
  11. "name" : "test-plugin",
  12. "description" : "test-plugin description",
  13. "site" : true,
  14. "jvm" : false
  15. }, {
  16. "name" : "test-no-version-plugin",
  17. "description" : "test-no-version-plugin description",
  18. "site" : true,
  19. "jvm" : false
  20. }, {
  21. "name" : "dummy",
  22. "description" : "No description found for dummy.",
  23. "url" : "/_plugin/dummy/",
  24. "site" : false,
  25. "jvm" : true
  26. } ]
  27. }
  28. }
  29. }

Ingest information(摄取数据信息)

ingest - 如果被设置,那么结果将包含关于每一个节点可用的处理器的详细信息 :

  • type: the processor type

其结果看起来和下面相似 :

  1. {
  2. "cluster_name": "elasticsearch",
  3. "nodes": {
  4. "O70_wBv6S9aPPcAKdSUBtw": {
  5. "ingest": {
  6. "processors": [
  7. {
  8. "type": "date"
  9. },
  10. {
  11. "type": "uppercase"
  12. },
  13. {
  14. "type": "set"
  15. },
  16. {
  17. "type": "lowercase"
  18. },
  19. {
  20. "type": "gsub"
  21. },
  22. {
  23. "type": "convert"
  24. },
  25. {
  26. "type": "remove"
  27. },
  28. {
  29. "type": "fail"
  30. },
  31. {
  32. "type": "foreach"
  33. },
  34. {
  35. "type": "split"
  36. },
  37. {
  38. "type": "trim"
  39. },
  40. {
  41. "type": "rename"
  42. },
  43. {
  44. "type": "join"
  45. },
  46. {
  47. "type": "append"
  48. }
  49. ]
  50. }
  51. }
  52. }
  53. }