commands.rst 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  1. .. _commands::
  2. ========
  3. Commands
  4. ========
  5. The './bin/emqttd_ctl' command line could be used to query and administrate the *EMQ* broker.
  6. .. WARNING:: Cannot work on Windows
  7. .. _command_status::
  8. ------
  9. status
  10. ------
  11. Show running status of the broker::
  12. $ ./bin/emqttd_ctl status
  13. Node 'emqttd@127.0.0.1' is started
  14. emqttd 2.0 is running
  15. .. _command_broker::
  16. ------
  17. broker
  18. ------
  19. Query basic information, statistics and metrics of the broker.
  20. +----------------+-------------------------------------------------+
  21. | broker | Show version, description, uptime of the broker |
  22. +----------------+-------------------------------------------------+
  23. | broker pubsub | Show status of the core pubsub process |
  24. +----------------+-------------------------------------------------+
  25. | broker stats | Show statistics of client, session, topic, |
  26. | | subscription and route of the broker |
  27. +----------------+-------------------------------------------------+
  28. | broker metrics | Show metrics of MQTT bytes, packets, messages |
  29. | | sent/received. |
  30. +----------------+-------------------------------------------------+
  31. Query version, description and uptime of the broker::
  32. $ ./bin/emqttd_ctl broker
  33. sysdescr : Erlang MQTT Broker
  34. version : 0.15.0
  35. uptime : 1 hours, 25 minutes, 24 seconds
  36. datetime : 2016-01-16 13:17:32
  37. broker stats
  38. ------------
  39. Query statistics of MQTT Client, Session, Topic, Subscription and Route::
  40. $ ./bin/emqttd_ctl broker stats
  41. clients/count : 1
  42. clients/max : 1
  43. queues/count : 0
  44. queues/max : 0
  45. retained/count : 2
  46. retained/max : 2
  47. routes/count : 2
  48. routes/reverse : 2
  49. sessions/count : 0
  50. sessions/max : 0
  51. subscriptions/count : 1
  52. subscriptions/max : 1
  53. topics/count : 54
  54. topics/max : 54
  55. broker metrics
  56. --------------
  57. Query metrics of Bytes, MQTT Packets and Messages(sent/received)::
  58. $ ./bin/emqttd_ctl broker metrics
  59. bytes/received : 297
  60. bytes/sent : 40
  61. messages/dropped : 348
  62. messages/qos0/received : 0
  63. messages/qos0/sent : 0
  64. messages/qos1/received : 0
  65. messages/qos1/sent : 0
  66. messages/qos2/received : 0
  67. messages/qos2/sent : 0
  68. messages/received : 0
  69. messages/retained : 2
  70. messages/sent : 0
  71. packets/connack : 5
  72. packets/connect : 5
  73. packets/disconnect : 0
  74. packets/pingreq : 0
  75. packets/pingresp : 0
  76. packets/puback/received : 0
  77. packets/puback/sent : 0
  78. packets/pubcomp/received: 0
  79. packets/pubcomp/sent : 0
  80. packets/publish/received: 0
  81. packets/publish/sent : 0
  82. packets/pubrec/received : 0
  83. packets/pubrec/sent : 0
  84. packets/pubrel/received : 0
  85. packets/pubrel/sent : 0
  86. packets/received : 9
  87. packets/sent : 9
  88. packets/suback : 4
  89. packets/subscribe : 4
  90. packets/unsuback : 0
  91. packets/unsubscribe : 0
  92. .. _command_cluster::
  93. -------
  94. cluster
  95. -------
  96. Cluster two or more emqttd brokers.
  97. +-----------------------+--------------------------------+
  98. | cluster join <Node> | Join the cluster |
  99. +-----------------------+--------------------------------+
  100. | cluster leave | Leave the cluster |
  101. +-----------------------+--------------------------------+
  102. | cluster remove <Node> | Remove a node from the cluster |
  103. +-----------------------+--------------------------------+
  104. | cluster status | Query cluster status and nodes |
  105. +-----------------------+--------------------------------+
  106. Suppose we create two emqttd nodes on localhost and cluster them:
  107. +-----------+---------------------+-------------+
  108. | Folder | Node | MQTT Port |
  109. +-----------+---------------------+-------------+
  110. | emqttd1 | emqttd1@127.0.0.1 | 1883 |
  111. +-----------+---------------------+-------------+
  112. | emqttd2 | emqttd2@127.0.0.1 | 2883 |
  113. +-----------+---------------------+-------------+
  114. Start emqttd1 node::
  115. cd emqttd1 && ./bin/emqttd start
  116. Start emqttd2 node::
  117. cd emqttd2 && ./bin/emqttd start
  118. Under emqttd2 folder::
  119. $ ./bin/emqttd_ctl cluster join emqttd1@127.0.0.1
  120. Join the cluster successfully.
  121. Cluster status: [{running_nodes,['emqttd1@127.0.0.1','emqttd2@127.0.0.1']}]
  122. Query cluster status::
  123. $ ./bin/emqttd_ctl cluster status
  124. Cluster status: [{running_nodes,['emqttd2@127.0.0.1','emqttd1@127.0.0.1']}]
  125. Message Route between nodes::
  126. # Subscribe topic 'x' on emqttd1 node
  127. mosquitto_sub -t x -q 1 -p 1883
  128. # Publish to topic 'x' on emqttd2 node
  129. mosquitto_pub -t x -q 1 -p 2883 -m hello
  130. emqttd2 leaves the cluster::
  131. cd emqttd2 && ./bin/emqttd_ctl cluster leave
  132. Or remove emqttd2 from the cluster on emqttd1 node::
  133. cd emqttd1 && ./bin/emqttd_ctl cluster remove emqttd2@127.0.0.1
  134. .. _command_clients::
  135. -------
  136. clients
  137. -------
  138. Query MQTT clients connected to the broker:
  139. +-------------------------+----------------------------------+
  140. | clients list | List all MQTT clients |
  141. +-------------------------+----------------------------------+
  142. | clients show <ClientId> | Show a MQTT Client |
  143. +-------------------------+----------------------------------+
  144. | clients kick <ClientId> | Kick out a MQTT client |
  145. +-------------------------+----------------------------------+
  146. clients lists
  147. -------------
  148. Query All MQTT clients connected to the broker::
  149. $ ./bin/emqttd_ctl clients list
  150. Client(mosqsub/43832-airlee.lo, clean_sess=true, username=test, peername=127.0.0.1:64896, connected_at=1452929113)
  151. Client(mosqsub/44011-airlee.lo, clean_sess=true, username=test, peername=127.0.0.1:64961, connected_at=1452929275)
  152. ...
  153. Properties of the Client:
  154. +--------------+---------------------------------------------------+
  155. | clean_sess | Clean Session Flag |
  156. +--------------+---------------------------------------------------+
  157. | username | Username of the client |
  158. +--------------+---------------------------------------------------+
  159. | peername | Peername of the TCP connection |
  160. +--------------+---------------------------------------------------+
  161. | connected_at | The timestamp when client connected to the broker |
  162. +--------------+---------------------------------------------------+
  163. clients show <ClientId>
  164. -----------------------
  165. Show a specific MQTT Client::
  166. ./bin/emqttd_ctl clients show "mosqsub/43832-airlee.lo"
  167. Client(mosqsub/43832-airlee.lo, clean_sess=true, username=test, peername=127.0.0.1:64896, connected_at=1452929113)
  168. clients kick <ClientId>
  169. -----------------------
  170. Kick out a MQTT Client::
  171. ./bin/emqttd_ctl clients kick "clientid"
  172. .. _command_sessions::
  173. --------
  174. sessions
  175. --------
  176. Query all MQTT sessions. The broker will create a session for each MQTT client. Persistent Session if clean_session flag is true, transient session otherwise.
  177. +--------------------------+-------------------------------+
  178. | sessions list | List all Sessions |
  179. +--------------------------+-------------------------------+
  180. | sessions list persistent | Query all persistent Sessions |
  181. +--------------------------+-------------------------------+
  182. | sessions list transient | Query all transient Sessions |
  183. +--------------------------+-------------------------------+
  184. | sessions show <ClientId> | Show a session |
  185. +--------------------------+-------------------------------+
  186. sessions list
  187. -------------
  188. Query all sessions::
  189. $ ./bin/emqttd_ctl sessions list
  190. Session(clientid, clean_sess=false, max_inflight=100, inflight_queue=0, message_queue=0, message_dropped=0, awaiting_rel=0, awaiting_ack=0, awaiting_comp=0, created_at=1452935508)
  191. Session(mosqsub/44101-airlee.lo, clean_sess=true, max_inflight=100, inflight_queue=0, message_queue=0, message_dropped=0, awaiting_rel=0, awaiting_ack=0, awaiting_comp=0, created_at=1452935401)
  192. Properties of Session:
  193. TODO:??
  194. +-------------------+----------------------------------------------------------------+
  195. | clean_sess | clean sess flag. false: persistent, true: transient |
  196. +-------------------+----------------------------------------------------------------+
  197. | max_inflight | Inflight window (Max number of messages delivering) |
  198. +-------------------+----------------------------------------------------------------+
  199. | inflight_queue | Inflight Queue Size |
  200. +-------------------+----------------------------------------------------------------+
  201. | message_queue | Message Queue Size |
  202. +-------------------+----------------------------------------------------------------+
  203. | message_dropped | Number of Messages Dropped for queue is full |
  204. +-------------------+----------------------------------------------------------------+
  205. | awaiting_rel | The number of QoS2 messages received and waiting for PUBREL |
  206. +-------------------+----------------------------------------------------------------+
  207. | awaiting_ack | The number of QoS1/2 messages delivered and waiting for PUBACK |
  208. +-------------------+----------------------------------------------------------------+
  209. | awaiting_comp | The number of QoS2 messages delivered and waiting for PUBCOMP |
  210. +-------------------+----------------------------------------------------------------+
  211. | created_at | Timestamp when the session is created |
  212. +-------------------+----------------------------------------------------------------+
  213. sessions list persistent
  214. ------------------------
  215. Query all persistent sessions::
  216. $ ./bin/emqttd_ctl sessions list persistent
  217. Session(clientid, clean_sess=false, max_inflight=100, inflight_queue=0, message_queue=0, message_dropped=0, awaiting_rel=0, awaiting_ack=0, awaiting_comp=0, created_at=1452935508)
  218. sessions list transient
  219. -----------------------
  220. Query all transient sessions::
  221. $ ./bin/emqttd_ctl sessions list transient
  222. Session(mosqsub/44101-airlee.lo, clean_sess=true, max_inflight=100, inflight_queue=0, message_queue=0, message_dropped=0, awaiting_rel=0, awaiting_ack=0, awaiting_comp=0, created_at=1452935401)
  223. sessions show <ClientId>
  224. ------------------------
  225. Show a session::
  226. $ ./bin/emqttd_ctl sessions show clientid
  227. Session(clientid, clean_sess=false, max_inflight=100, inflight_queue=0, message_queue=0, message_dropped=0, awaiting_rel=0, awaiting_ack=0, awaiting_comp=0, created_at=1452935508)
  228. .. _command_routes::
  229. ------
  230. routes
  231. ------
  232. Show routing table of the broker.
  233. routes list
  234. -----------
  235. List all routes::
  236. $ ./bin/emqttd_ctl routes list
  237. t2/# -> emqttd2@127.0.0.1
  238. t/+/x -> emqttd2@127.0.0.1,emqttd@127.0.0.1
  239. routes show <Topic>
  240. -------------------
  241. Show a route::
  242. $ ./bin/emqttd_ctl routes show t/+/x
  243. t/+/x -> emqttd2@127.0.0.1,emqttd@127.0.0.1
  244. .. _command_topics::
  245. ------
  246. topics
  247. ------
  248. Query topic table of the broker.
  249. topics list
  250. -----------
  251. Query all the topics::
  252. $ ./bin/emqttd_ctl topics list
  253. $SYS/brokers/emqttd@127.0.0.1/metrics/packets/subscribe: static
  254. $SYS/brokers/emqttd@127.0.0.1/stats/subscriptions/max: static
  255. $SYS/brokers/emqttd2@127.0.0.1/stats/subscriptions/count: static
  256. ...
  257. topics show <Topic>
  258. -------------------
  259. Show a topic::
  260. $ ./bin/emqttd_ctl topics show '$SYS/brokers'
  261. $SYS/brokers: static
  262. .. _command_subscriptions::
  263. -------------
  264. subscriptions
  265. -------------
  266. Query the subscription table of the broker:
  267. +--------------------------------------------+--------------------------------------+
  268. | subscriptions list | List all subscriptions |
  269. +--------------------------------------------+--------------------------------------+
  270. | subscriptions show <ClientId> | Show a subscription |
  271. +--------------------------------------------+--------------------------------------+
  272. subscriptions list
  273. ------------------
  274. Query all subscriptions::
  275. $ ./bin/emqttd_ctl subscriptions list
  276. mosqsub/91042-airlee.lo -> t/y:1
  277. mosqsub/90475-airlee.lo -> t/+/x:2
  278. subscriptions list static
  279. -------------------------
  280. List all static subscriptions::
  281. $ ./bin/emqttd_ctl subscriptions list static
  282. clientid -> new_topic:1
  283. subscriptions show <ClientId>
  284. -----------------------------
  285. Show the subscriptions of a MQTT client::
  286. $ ./bin/emqttd_ctl subscriptions show clientid
  287. clientid: [{<<"x">>,1},{<<"topic2">>,1},{<<"topic3">>,1}]
  288. .. _command_plugins::
  289. -------
  290. plugins
  291. -------
  292. List, load or unload plugins of emqttd broker.
  293. +---------------------------+-------------------------+
  294. | plugins list | List all plugins |
  295. +---------------------------+-------------------------+
  296. | plugins load <Plugin> | Load Plugin |
  297. +---------------------------+-------------------------+
  298. | plugins unload <Plugin> | Unload (Plugin) |
  299. +---------------------------+-------------------------+
  300. plugins list
  301. ------------
  302. List all plugins::
  303. $ ./bin/emqttd_ctl plugins list
  304. Plugin(emq_auth_clientid, version=2.0, description=Authentication with ClientId/Password, active=false)
  305. Plugin(emq_auth_http, version=2.0, description=Authentication/ACL with HTTP API, active=false)
  306. Plugin(emq_auth_ldap, version=2.0, description=Authentication/ACL with LDAP, active=false)
  307. Plugin(emq_auth_mongo, version=2.0, description=Authentication/ACL with MongoDB, active=false)
  308. Plugin(emq_auth_mysql, version=2.0, description=Authentication/ACL with MySQL, active=false)
  309. Plugin(emq_auth_pgsql, version=2.0, description=Authentication/ACL with PostgreSQL, active=false)
  310. Plugin(emq_auth_redis, version=2.0, description=Authentication/ACL with Redis, active=false)
  311. Plugin(emq_auth_username, version=2.0, description=Authentication with Username/Password, active=false)
  312. Plugin(emq_coap, version=0.2, description=CoAP Gateway, active=false)
  313. Plugin(emq_dashboard, version=2.0, description=Dashboard, active=true)
  314. Plugin(emq_mod_rewrite, version=2.0, description=EMQ Rewrite Module, active=false)
  315. Plugin(emq_plugin_template, version=2.0, description=EMQ Plugin Template, active=false)
  316. Plugin(emq_recon, version=2.0, description=Recon Plugin, active=false)
  317. Plugin(emq_reloader, version=3.0, description=Reloader Plugin, active=false)
  318. Plugin(emq_sn, version=0.2, description=MQTT-SN Gateway, active=false)
  319. Plugin(emq_stomp, version=2.0, description=Stomp Protocol Plugin, active=false)
  320. Properties of a plugin:
  321. +-------------+--------------------------+
  322. | version | Plugin Version |
  323. +-------------+--------------------------+
  324. | description | Plugin Description |
  325. +-------------+--------------------------+
  326. | active | If the plugin is Loaded |
  327. +-------------+--------------------------+
  328. Load <Plugin>
  329. -------------
  330. Load a Plugin::
  331. $ ./bin/emqttd_ctl plugins load emq_recon
  332. Start apps: [recon,emq_recon]
  333. Plugin emq_recon loaded successfully.
  334. Unload <Plugin>
  335. ---------------
  336. Unload a Plugin::
  337. $ ./bin/emqttd_ctl plugins unload emq_recon
  338. Plugin emq_recon unloaded successfully.
  339. .. _command_bridges::
  340. -------
  341. bridges
  342. -------
  343. Bridge two or more *EMQ* brokers::
  344. --------- ---------
  345. Publisher --> | node1 | --Bridge Forward--> | node2 | --> Subscriber
  346. --------- ---------
  347. commands for bridge:
  348. +----------------------------------------+------------------------------+
  349. | bridges list | List all bridges |
  350. +----------------------------------------+------------------------------+
  351. | bridges options | Show bridge options |
  352. +----------------------------------------+------------------------------+
  353. | bridges start <Node> <Topic> | Create a bridge |
  354. +----------------------------------------+------------------------------+
  355. | bridges start <Node> <Topic> <Options> | Create a bridge with options |
  356. +----------------------------------------+------------------------------+
  357. | bridges stop <Node> <Topic> | Delete a bridge |
  358. +----------------------------------------+------------------------------+
  359. Suppose we create a bridge between emqttd1 and emqttd2 on localhost:
  360. +---------+---------------------+-----------+
  361. | Name | Node | MQTT Port |
  362. +---------+---------------------+-----------+
  363. | emqttd1 | emqttd1@127.0.0.1 | 1883 |
  364. +---------+---------------------+-----------+
  365. | emqttd2 | emqttd2@127.0.0.1 | 2883 |
  366. +---------+---------------------+-----------+
  367. The bridge will forward all the the 'sensor/#' messages from emqttd1 to emqttd2::
  368. $ ./bin/emqttd_ctl bridges start emqttd2@127.0.0.1 sensor/#
  369. bridge is started.
  370. $ ./bin/emqttd_ctl bridges list
  371. bridge: emqttd1@127.0.0.1--sensor/#-->emqttd2@127.0.0.1
  372. The the 'emqttd1--sensor/#-->emqttd2' bridge::
  373. #emqttd2 node
  374. mosquitto_sub -t sensor/# -p 2883 -d
  375. #emqttd1节点上
  376. mosquitto_pub -t sensor/1/temperature -m "37.5" -d
  377. bridges options
  378. ---------------
  379. Show bridge options::
  380. $ ./bin/emqttd_ctl bridges options
  381. Options:
  382. qos = 0 | 1 | 2
  383. prefix = string
  384. suffix = string
  385. queue = integer
  386. Example:
  387. qos=2,prefix=abc/,suffix=/yxz,queue=1000
  388. bridges stop <Node> <Topic>
  389. ---------------------------
  390. Delete the emqttd1--sensor/#-->emqttd2 bridge::
  391. $ ./bin/emqttd_ctl bridges stop emqttd2@127.0.0.1 sensor/#
  392. bridge is stopped.
  393. .. _command_vm::
  394. --
  395. vm
  396. --
  397. Query the load, cpu, memory, processes and IO information of the Erlang VM.
  398. +-------------+-----------------------------------+
  399. | vm all | Query all |
  400. +-------------+-----------------------------------+
  401. | vm load | Query VM Load |
  402. +-------------+-----------------------------------+
  403. | vm memory | Query Memory Usage |
  404. +-------------+-----------------------------------+
  405. | vm process | Query Number of Erlang Processes |
  406. +-------------+-----------------------------------+
  407. | vm io | Query Max Fds of VM |
  408. +-------------+-----------------------------------+
  409. vm load
  410. -------
  411. Query load::
  412. $ ./bin/emqttd_ctl vm load
  413. cpu/load1 : 2.21
  414. cpu/load5 : 2.60
  415. cpu/load15 : 2.36
  416. vm memory
  417. ---------
  418. Query memory::
  419. $ ./bin/emqttd_ctl vm memory
  420. memory/total : 23967736
  421. memory/processes : 3594216
  422. memory/processes_used : 3593112
  423. memory/system : 20373520
  424. memory/atom : 512601
  425. memory/atom_used : 491955
  426. memory/binary : 51432
  427. memory/code : 13401565
  428. memory/ets : 1082848
  429. vm process
  430. ----------
  431. Query number of erlang processes::
  432. $ ./bin/emqttd_ctl vm process
  433. process/limit : 8192
  434. process/count : 221
  435. vm io
  436. -----
  437. Query max, active file descriptors of IO::
  438. $ ./bin/emqttd_ctl vm io
  439. io/max_fds : 2560
  440. io/active_fds : 1
  441. .. _command_trace::
  442. -----
  443. trace
  444. -----
  445. Trace MQTT packets, messages(sent/received) by ClientId or Topic.
  446. +-----------------------------------+-----------------------------------+
  447. | trace list | List all the traces |
  448. +-----------------------------------+-----------------------------------+
  449. | trace client <ClientId> <LogFile> | Trace a client |
  450. +-----------------------------------+-----------------------------------+
  451. | trace client <ClientId> off | Stop tracing the client |
  452. +-----------------------------------+-----------------------------------+
  453. | trace topic <Topic> <LogFile> | Trace a topic |
  454. +-----------------------------------+-----------------------------------+
  455. | trace topic <Topic> off | Stop tracing the topic |
  456. +-----------------------------------+-----------------------------------+
  457. trace client <ClientId> <LogFile>
  458. ---------------------------------
  459. Start to trace a client::
  460. $ ./bin/emqttd_ctl trace client clientid log/clientid_trace.log
  461. trace client clientid successfully.
  462. trace client <ClientId> off
  463. ---------------------------
  464. Stop tracing the client::
  465. $ ./bin/emqttd_ctl trace client clientid off
  466. stop tracing client clientid successfully.
  467. trace topic <Topic> <LogFile>
  468. -----------------------------
  469. Start to trace a topic::
  470. $ ./bin/emqttd_ctl trace topic topic log/topic_trace.log
  471. trace topic topic successfully.
  472. trace topic <Topic> off
  473. -----------------------
  474. Stop tracing the topic::
  475. $ ./bin/emqttd_ctl trace topic topic off
  476. stop tracing topic topic successfully.
  477. trace list
  478. ----------
  479. List all traces::
  480. $ ./bin/emqttd_ctl trace list
  481. trace client clientid -> log/clientid_trace.log
  482. trace topic topic -> log/topic_trace.log
  483. .. _command_listeners::
  484. ---------
  485. listeners
  486. ---------
  487. Show all the TCP listeners::
  488. $ ./bin/emqttd_ctl listeners
  489. listener on mqtt:ws:8083
  490. acceptors : 4
  491. max_clients : 64
  492. current_clients : 0
  493. shutdown_count : []
  494. listener on mqtt:ssl:8883
  495. acceptors : 4
  496. max_clients : 512
  497. current_clients : 0
  498. shutdown_count : []
  499. listener on mqtt:tcp:1883
  500. acceptors : 8
  501. max_clients : 1024
  502. current_clients : 0
  503. shutdown_count : []
  504. listener on dashboard:http:18083
  505. acceptors : 2
  506. max_clients : 512
  507. current_clients : 0
  508. shutdown_count : []
  509. listener parameters:
  510. +-----------------+--------------------------------------+
  511. | acceptors | TCP Acceptor Pool |
  512. +-----------------+--------------------------------------+
  513. | max_clients | Max number of clients |
  514. +-----------------+--------------------------------------+
  515. | current_clients | Count of current clients |
  516. +-----------------+--------------------------------------+
  517. | shutdown_count | Statistics of client shutdown reason |
  518. +----------------+---------------------------------------+
  519. .. _command_mnesia::
  520. ------
  521. mnesia
  522. ------
  523. Show system_info of mnesia database.
  524. ------
  525. admins
  526. ------
  527. The 'admins' CLI is used to add/del admin account, which is registered by the dashboard plugin.
  528. +------------------------------------+-----------------------------+
  529. | admins add <Username> <Password> | Add admin account |
  530. +------------------------------------+-----------------------------+
  531. | admins passwd <Username> <Password>| Reset admin password |
  532. +------------------------------------+-----------------------------+
  533. | admins del <Username> | Delete admin account |
  534. +------------------------------------+-----------------------------+
  535. admins add
  536. ----------
  537. Add admin account::
  538. $ ./bin/emqttd_ctl admins add root public
  539. ok
  540. admins passwd
  541. -------------
  542. Reset password::
  543. $ ./bin/emqttd_ctl admins passwd root private
  544. ok
  545. admins del
  546. ----------
  547. Delete admin account::
  548. $ ./bin/emqttd_ctl admins del root
  549. ok