mosquitto icon indicating copy to clipboard operation
mosquitto copied to clipboard

Why doesn't the second broker start?

Open 12343954 opened this issue 3 years ago • 1 comments

i installed two brokers in the same server as windows service.

two commands to create services:

  1. sc create mqtt_1883 binpath= "\"D:\NoSQL\mosquitto_1883\mosquitto_1883.exe\" run" type= own start= auto displayname= "MQTT (port:1883)",renamed "mosquitto.exe" to "mosquitto_1883.exe"
  2. sc create mqtt_1884 binpath= "\"D:\NoSQL\mosquitto_1884\mosquitto_1884.exe\" run" type= own start= auto displayname= "MQTT (port:1884)",renamed "mosquitto.exe" to "mosquitto_1884.exe"

and then i stated one of them net start mqtt_1883 it's ok.

but run the second cmd with: net start mqtt_1884 it's not ok. mqtt_1884 can not startup.

image

image

It seems that the two services cannot run at the same time.

and how can i run two brokers on the same server? thank you very much!

12343954 avatar Mar 15 '22 10:03 12343954

This behaviour isn't supported in 2.0.x, but is possible with the upcoming 2.1 release.

It expects to load a config file from a path based on the name of the executable. So if you have mosquitto_1884.exe as the exe name, it expects to load %MOSQUITTO_1884_DIR%/mosquitto.conf. Any non-alphanumeric characters in the exe name are replaced with _.

ralight avatar Aug 11 '22 10:08 ralight