2017-05-28 93 views
0

我想在我的ubuntu16.04服務器上設置一個mosquitto broker。 我可以啓動,停止,重新開始......等與經紀人:mosquitto broker service ubuntu16.04

/etc/init.d/mosquitto start/stop 

但我怎樣才能重新啓動我自己的配置文件中的服務?

,我要開始與經紀人:

mosquitto -c /etc/mosquitto/mosquitto.conf 

1495978951: mosquitto version 1.4.8 (build date Fri, 19 Feb 2016 12:03:16 +0100) starting 
1495978951: Config loaded from /etc/mosquitto/mosquitto.conf. 
1495978951: Opening ipv4 listen socket on port 1883. 
1495978951: Error: Address already in use 

但在此之前,我可以啓動代理這樣我不得不殺mosquitto服務。我怎樣才能做到這一點?

感謝

回答

0

你使用相同的配置文件作爲服務/etc/mosquitto/mosquitto.conf所以它們都將被配置爲使用同一網絡端口。

除非您使用具有不同端口的其他配置文件(使用portlisten指令),否則如果另一個端口正在運行,則始終無法啓動。

的選擇是:

  1. service mosquitto stop停止該服務,並運行自己的實例手動
  2. 編輯默認的配置文件,以匹配你想要什麼,並重新啓動服務(service mosquitto restart
  3. 使用單獨的手動版本配置文件,並配置一個不同的端口號。