I have installed mosquito broker on my mac using brew install mosquitto.
Normally I don't give any commands to start the mosquitto server. It is started automatically.
I have verified that it is running by using the command ps -ef | grep mosquitto, which gives the following output
➜ ~ /usr/local/opt/mosquitto/sbin/mosquitto stop
Error: Unknown option 'stop'.
mosquitto version 1.4.14 (build date 2017-10-22 16:34:39+0100)
mosquitto is an MQTT v3.1.1/v3.1 broker.
Usage: mosquitto [-c config_file] [-d] [-h] [-p port]
-c : specify the broker config file.
-d : put the broker into the background after starting.
-h : display this help.
-p : start the broker listening on the specified port.
Not recommended in conjunction with the -c option.
-v : verbose mode - enable all logging types. This overrides
any logging options given in the config file.
See http://mosquitto.org/ for more information.
install/start/stop on macOS
I have installed mosquito broker on my mac using
brew install mosquitto
.Normally I don't give any commands to start the mosquitto server. It is started automatically. I have verified that it is running by using the command
ps -ef | grep mosquitto
, which gives the following outputUsage
stop:
kill -9 above-pid
orkillall mosquitto
start:/usr/local/opt/mosquitto/sbin/mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf
Pub
Simple
Watson
Sub
Simple
Watson
Troubleshoot
Connection refused的原因是mosquitto service未启动.
References