EMQX命令
emqx start 启动emqx_ctl status 检查运行状态emqx uninstall 服务卸载emqx restart 重启emqx stop 停止./bin/emqx_ctl status 检查运行状态./bin/emqx_ctl 查看帮助命令
跟踪日志
./bin/emqx_ctl trace start client [client id] ./bin/wwz.log 通过client id跟踪日志写到wwz.log文件中./bin/emqx_ctl trace stop client [client id] 停止通过client id跟踪./bin/emqx_ctl trace start topic [topic主题] ./bin/wwz.log 通过client id跟踪日志写到文件wwz.log中./bin/emqx_ctl trace stop topic [topic主题] 停止通过topic跟踪./bin/emqx_ctl trace list 查询跟踪./bin/emqx_ctl log primary-level debug 调整日志级别为debug
tail -100f ./log/wwz.log 实时打印日志
如果 EMQ 安装在本机,则使用浏览器打开地址 http://127.0.0.1:18083 ,输入默认用户名 admin 与默认密码 public ,登录进入 Dashboard。如果忘记了管理控制台密码,使用 管理命令 重置或新建管理账号
罗列一些重要的指标
Received---接收到的MQTT报文数Sent---发送的MQTT报文数Connect---几次MQTT连接Connack---几次MQTT确认连接请求Disconnect---几次MQTT连接断开Pingreq---ping request 个数,在一个心跳周期内,客户端会发送一条pingreq到服务端Pingresq---ping response 个数,服务端收到pingreq的请求之后,会立即响应一个两个字节固定格式的pingresq消息Published/received---收到的Published报文个数Published/sent---发送的Published报文个数Puback/received---收到的Puback报文个数Puback/sent---发送的Puback报文个数Puback/missed---没收到的Puback报文个数Pubcomp/received---收到的Pubcomp报文个数Pubcomp/sent---发送的Pubcomp报文个数Pubcomp/missed---失去的Pubcomp报文个数Pubrec/received---收到的Pubrec报文个数Pubrec/sent---发送的Pubrec报文个数Pubrec/missed---失去的Pubrec报文个数Pubrel/received---收到的Pubrel报文个数Pubrel/sent---发送的Pubrel报文个数Pubrel/missed---失去的Pubrel报文个数Subscribe---发送的订阅数Suback---发送返回的订阅数Unsubscribe---发送的取消订阅数Unsuback---发送返回的取消订阅数The message data 消息数Received---收到的消息数Sent---发出的消息数Dropped---丢失的消息数(在收到消息后,该消息无人订阅)Retained---保留的消息数Qos0/received---收到的qos0消息数Qos0/sent---发送的qos0消息数Qos1/received---收到的qos1消息数Qos1/sent---发送的qos1消息数Qos2/received---收到的qos2消息数Qos2/sent---发送的qos2消息数Qos2/dropped---丢失的qos2消息数The bytes data 流量收发统计(字节)Received---收到的流量字节Sent---发送的流量字节
任意节点上使用 ./bin/emqx_ctl cluster status 命令查询集群状态:
Cluster status: [{running_nodes,['emqx@192.168.233.111','emqx@192.168.233.112','emqx@192.168.233.113']}]