集群与节点

获取集群基本信息

API 定义:

  1. GET api/v3/brokers/

请求示例:

  1. GET api/v3/brokers/

返回数据:

  1. {
  2. "code": 0,
  3. "data": [
  4. {
  5. "datetime": "2019-04-29 10:56:41",
  6. "node": "emqx@127.0.0.1",
  7. "node_status": "Running",
  8. "otp_release": "R21/10.3.2",
  9. "sysdescr": "EMQ X Broker",
  10. "uptime": "3 minutes, 59 seconds",
  11. "version": "v3.1.0"
  12. }
  13. ]
  14. }

获取节点基本信息

API 定义:

  1. GET api/v3/brokers/${node}

请求示例:

  1. GET api/v3/brokers/emqx@127.0.0.1

返回数据:

  1. {
  2. "code": 0,
  3. "data": {
  4. "datetime": "2019-04-29 10:59:59",
  5. "node_status": "Running",
  6. "otp_release": "R21/10.3.2",
  7. "sysdescr": "EMQ X Broker",
  8. "uptime": "7 minutes, 16 seconds",
  9. "version": "v3.1.0"
  10. }
  11. }

获取集群监控数据

API 定义:

  1. GET api/v3/nodes/

请求示例:

  1. GET api/v3/nodes/

返回数据:

  1. {
  2. "code": 0,
  3. "data": [
  4. {
  5. "connections": 2,
  6. "load1": "2.75",
  7. "load15": "2.87",
  8. "load5": "2.57",
  9. "max_fds": 7168,
  10. "memory_total": "76.45M",
  11. "memory_used": "59.48M",
  12. "name": "emqx@127.0.0.1",
  13. "node": "emqx@127.0.0.1",
  14. "node_status": "Running",
  15. "otp_release": "R21/10.3.2",
  16. "process_available": 262144,
  17. "process_used": 331,
  18. "uptime": "1 days,18 hours, 45 minutes, 1 seconds",
  19. "version": "v3.1.0"
  20. }
  21. ]
  22. }

获取节点监控数据

API 定义:

  1. GET api/v3/nodes/${node}

请求示例:

  1. GET api/v3/nodes/emqx@127.0.0.1

返回数据:

  1. {
  2. "code": 0,
  3. "data": {
  4. "connections": 1,
  5. "load1": "2.75",
  6. "load15": "2.87",
  7. "load5": "2.57",
  8. "max_fds": 7168,
  9. "memory_total": 80162816,
  10. "memory_used": 62254160,
  11. "name": "emqx@127.0.0.1",
  12. "node_status": "Running",
  13. "otp_release": "R21/10.3.2",
  14. "process_available": 262144,
  15. "process_used": 331,
  16. "uptime": "1 days,18 hours, 45 minutes, 1 seconds",
  17. "version": "v3.1.0"
  18. }
  19. }