一、下載
https://www.emqx.cn/downloads#broker
2、安裝運行(比較簡單)
#解壓 unzip emqx-centos8-4.3.0-amd64.zip #啟動 ./bin/emqx start
3、文檔地址
https://docs.emqx.cn/broker/v4.3/
4、編輯用戶名/密碼配置文件
vim /etc/emqx/plugins/emqx_auth_username.conf ##-------------------------------------------------------------------- ## Username Authentication Plugin ##-------------------------------------------------------------------- ## Examples: auth.user.1.username = admin auth.user.1.password = admin888 ## Password hash. ## ## Value: plain | md5 | sha | sha256 auth.user.password_hash = plain #plain 表示透傳
這里建議一個項目設一組用戶/密碼,方便管理。
5、關閉匿名訪問
vim /etc/emqx/emqx.conf allow_anonymous = false
6、啟用插件
7、啟動服務
#啟動 $ emqx start EMQ X v4.0.0 is started successfully! #狀態查看 $ emqx_ctl status Node 'emqx@127.0.0.1' is started emqx 4.0.0 is running #停止 emqx stop #重啟 emqx restart
8、連接(好用的客戶端工具)
(2)MQTT.fx:下載地址