報錯內容
1592979788: Error: Unable to open log file /Users/bigbird/mqttconfig/mosquitto/log/mosquitto.log for writing.
-
解決方法
1.查看你的 mosquitto.conf 文件,路徑是否正確!!! 這里的路徑為 docker 的路徑,千萬別寫成自己的路徑!!!
persistence true persistence_location /mosquitto/data log_dest file /mosquitto/log/mosquitto.log port 1883 listener 9001 protocol websockets # 關閉匿名模式 allow_anonymous false # 指定密碼文件 password_file /mosquitto/config/pwfile.conf #備注:這里千萬注意路徑,指向的是 docker 的路徑!!!(直接復制我的內容即可)
2.文件權限問題, 對 mosquitto/log 賦予最高權限
sudo chmod -R 777 mosquitto/log