mosquitto经纪人服务ubuntu16.04

mosquitto经纪人服务ubuntu16.04,ubuntu,server,mqtt,mosquitto,broker,Ubuntu,Server,Mqtt,Mosquitto,Broker,我正在尝试在我的ubuntu16.04服务器上设置一个MOSQUITO代理。 我可以开始,停止,重新开始。。。等等。经纪人与: /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:1

我正在尝试在我的ubuntu16.04服务器上设置一个MOSQUITO代理。 我可以开始,停止,重新开始。。。等等。经纪人与:

/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
但在我启动这样的代理之前,我必须先终止Mosquito服务。我该怎么做


感谢您使用与服务相同的配置文件
/etc/mosquitto/mosquitto.conf
,因此它们都将被配置为使用相同的网络端口

除非将不同的配置文件与不同的端口一起使用(使用
port
listen
指令),否则如果另一个正在运行,则其中一个总是无法启动

这些选择包括:

  • 使用
    service mosquitt停止服务,停止
    并手动运行您自己的实例
  • 编辑默认配置文件以匹配所需内容并重新启动服务(
    service-mosquitt-restart
  • 为手动版本使用单独的配置文件,并使用不同的端口号对其进行配置