集群 API

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

译文链接 : http://www.apache.wiki/pages/viewpage.action?pageId=4882951

贡献者 : 那伊抹微笑

Node specification(节点规范)

大多数集群级别的 API 可以指定在哪些节点上执行(例如,获得一个节点上的统计信息)。在 API 中节点可以被识别,使用内部的节点 ID,节点名称,自定义的属性,或者 _local 节点接受请求。例如,这里有一些指定节点信息的示例 :

  1. # Local
  2. curl -XGET 'localhost:9200/_nodes/_local?pretty'
  3. # Address
  4. curl -XGET 'localhost:9200/_nodes/10.0.0.3,10.0.0.4?pretty'
  5. curl -XGET 'localhost:9200/_nodes/10.0.0.*?pretty'
  6. # Names
  7. curl -XGET 'localhost:9200/_nodes/node_name_goes_here?pretty'
  8. curl -XGET 'localhost:9200/_nodes/node_name_goes_*?pretty'
  9. # Attributes (set something like node.attr.rack: 2 in the config)
  10. curl -XGET 'localhost:9200/_nodes/rack:2?pretty'
  11. curl -XGET 'localhost:9200/_nodes/ra*:2?pretty'
  12. curl -XGET 'localhost:9200/_nodes/ra*:2*?pretty'