简体   繁体   中英

Mosquitto giving error on launch

I installed Mosquitto 1.4.9 on my Ubuntu 16.04 machine from source files

I ran a test and things worked fine with localhost but when I tried to connect using my domain I got a connection refused error message.

When I went back to my mosquitto.conf file I found I had made a typo in my url so I corrected the typo (I even tried with the IP Addy in place of the domain).

I then killed the running Mosquitto process and when I ran sudo mosquitto -c /etc/mosquitto/mosquitto.conf

I got the following output:

1513023494: mosquitto version 1.4.9 (build date 2017-12-11 13:46:59-0500) starting
1513023494: Config loaded from /etc/mosquitto/mosquitto.conf.
1513023494: Opening ipv4 listen socket on port 8883.
1513023494: Error: Cannot assign requested address

When I remove the domain and put in localhost I get:

1513024906: mosquitto version 1.4.9 (build date 2017-12-11 13:46:59-0500) starting
1513024906: Config loaded from /etc/mosquitto/mosquitto.conf.
1513024906: Opening ipv4 listen socket on port 8883.

My mosquitto.conf file looks like this:

listener 8883 <domain>.com
persistence true
persistence_location /var/lib/mosquitto/
persistence_file mosquitto.db
log_dest syslog
log_dest stdout
log_dest topic
log_type error
log_type warning
log_type notice
log_type information
connection_messages true
log_timestamp true
allow_anonymous false
password_file /etc/mosquitto/pwfile

As recommended by hardillb,

Removing the FQDN, Localhost, or IP address from the Listener line allowed mosquitto to launch properly and accept connections on the FQDN.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM