节点
GET /api/v4/nodes/{node}
返回节点的状态。
Path Parameters:
Name | Type | Required | Description |
---|---|---|---|
node | String | False | 节点名字,如 “emqx@127.0.0.1。 不指定时返回所有节点的信息 |
Success Response Body (JSON):
Name | Type | Description |
---|---|---|
code | Integer | 0 |
data | Object/Array of Objects | node 参数存在时返回指定节点信息, 不存在时以 Array 形式返回所有节点的信息 |
data.connections | Integer | 当前接入此节点的客户端数量 |
data.load1 | String | 1 分钟内的 CPU 平均负载 |
data.load5 | String | 5 分钟内的 CPU 平均负载 |
data.load15 | String | 15 分钟内的 CPU 平均负载 |
data.max_fds | Integer | 操作系统的最大文件描述符限制 |
data.memory_total | String | VM 已分配的系统内存 |
data.memory_used | String | VM 已占用的内存大小 |
data.node | String | 节点名称 |
data.node_status | String | 节点状态 |
data.otp_release | String | EMQ X 使用的 Erlang/OTP 版本 |
data.process_available | Integer | 可用的进程数量 |
data.process_used | Integer | 已占用的进程数量 |
data.uptime | String | EMQ X 运行时间 |
data.version | String | EMQ X 版本 |
Examples:
获取所有节点的状态:
$ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/nodes"
{"data":[{"version":"develop","uptime":"7 seconds","process_used":315,"process_available":2097152,"otp_release":"R21/10.3.5","node_status":"Running","node":"emqx@127.0.0.1","memory_used":"96.75M","memory_total":"118.27M","max_fds":10240,"load5":"2.60","load15":"2.65","load1":"2.31","connections":0}],"code":0}
获取指定节点的状态:
$ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/nodes/emqx@127.0.0.1"
{"data":{"version":"develop","uptime":"2 minutes, 21 seconds","process_used":310,"process_available":2097152,"otp_release":"R21/10.3.5","node_status":"Running","node":"emqx@127.0.0.1","memory_used":101379168,"memory_total":123342848,"max_fds":10240,"load5":"2.50","load15":"2.61","load1":"1.99","connections":0},"code":0}