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']}]