我正在嘗試讓 mosquitto 代理允許埠 1884 上的 websockets。為此,我已經編輯了標準mosquitto.conf:
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
listener 1883
allow_anonymous true
listener 1884
protocol websockets
allow_anonymous true
但是,自從我啟動經紀人以來,這似乎不起作用,它說:
1652941249: mosquitto version 1.4.15 (build date Tue, 18 Jun 2019 11:42:22 -0300) starting
1652941249: Using default config.
1652941249: Opening ipv4 listen socket on port 1883.
1652941249: Opening ipv6 listen socket on port 1883.
我已經嘗試在檔案中添加自定義 .conf 檔案conf.d并將其包含在mosquitto.conf但沒有成功。
我還注意到,每當我嘗試使用-c-flag 來指定要使用的配置時,它似乎在能夠啟動之前就凍結了。
uj5u.com熱心網友回復:
首先Using default config.意味著特定實體根本沒有使用組態檔,它使用的是內置默認值,只是為了監聽埠 1883。
其次,mosquitto 沒有默認組態檔,您必須始終使用該-c選項將路徑傳遞給您要運行的組態檔。
鑒于提供的組態檔,它可能沒有凍結,您剛剛告訴它將日志寫入檔案,因此命令列上不會有輸出。您需要拖尾/var/log/mosquitto/mosquitto.log檔案以查看輸出(日志代碼中還有一個小錯誤,這意味著它僅在緩沖區已歸檔時列印,因此日志條目可能會延遲,直到已將足夠多的內容寫入緩沖區)。
最后 v1.4.x 非常舊,您應該運行 v2.x 版本,因為它包含錯誤/安全修復日志。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/478551.html
下一篇:如何查找和重命名多個檔案
