流星中mqtt经纪人之间的桥接

时间:2018-05-29 10:01:54

标签: meteor mqtt mosquitto

我的问题是关于mosquitto.conf文件,而桥接,嗯..我在我的电脑上的不同端口上运行2个相同的流星应用程序。其中一个meteor应用程序包含运行在localhost上的mosquitto代理,该应用程序包含运行的mosquitto代理云(地址:ec2-13-211-229-85.ap-southeast-2.compute.amazonaws.com:1883)。现在,我必须在这些蚊子经纪人(2个应用程序之间)和我的主题之间提供桥梁是1234567890.I提到了很多文件,但我仍然感到困惑。 我在ubuntu的/etc/mosquitto/conf.d目录下创建了bridge.conf文件,bridge.conf文件信息如下:

connection mqtt
address ec2-13-211-229-85.ap-southeast-2.compute.amazonaws.com:1883
topic 1234567890 both
try_private true
clientid test
cleansession true
notification true
bridge_protocol_version mqttv311
bridge_attempt_unsubscribe true
start_type automatic

在上面的文件中,如果我没有错,我给连接字段和clientid字段(即分别为mqtt和test)的随机名称。 接下来,我重新启动了mosquitto。然后我检查了包含以下行的/var/log/mosquitto/mosquitto.log文件:

1527655692: mosquitto version 1.4.8 (build date Thu, 01 Mar 2018 09:34:49 -0500) starting
1527655692: Config loaded from /etc/mosquitto/mosquitto.conf.
1527655692: Opening ipv4 listen socket on port 1883.
1527655692: Opening ipv6 listen socket on port 1883.
1527656884: Error in poll: Interrupted system call.
1527656884: mosquitto version 1.4.8 terminating

然后我在终端使用了以下命令:

  

mosquitto -c /etc/mosquitto/mosquitto.conf

我的日志输出再次是:

1527655692: mosquitto version 1.4.8 (build date Thu, 01 Mar 2018 09:34:49 -0500) starting
1527655692: Config loaded from /etc/mosquitto/mosquitto.conf.
1527655692: Opening ipv4 listen socket on port 1883. 
1527655692: Opening ipv6 listen socket on port 1883.
1527656884: Error in poll: Interrupted system call.
1527656884: mosquitto version 1.4.8 terminating
1527656885: mosquitto version 1.4.8 (build date Thu, 01 Mar 2018 09:34:49 -0500) starting
1527656885: Config loaded from /etc/mosquitto/mosquitto.conf.
1527656885: Opening ipv4 listen socket on port 1883.
1527656885: Opening ipv6 listen socket on port 1883.
1527656885: Connecting bridge mqtt (ec2-13-211-229-85.ap-southeast-2.compute.amazonaws.com:1883)
1527657360: Socket error on client local.test, disconnecting.
1527657391: Connecting bridge mqtt (ec2-13-211-229-85.ap-southeast-2.compute.amazonaws.com:1883)
1527658711: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1527658836: New connection from 127.0.0.1 on port 1883.
1527658836: New client connected from 127.0.0.1 as mqttjs_808e4168 (c1, k60).
1527658904: New connection from 127.0.0.1 on port 1883.
1527658904: New client connected from 127.0.0.1 as mqttjs_1ad5b926 (c1, k60).
1527658917: New connection from 127.0.0.1 on port 1883.1527658917: New client connected from 127.0.0.1 as mqttjs_89e1b1cc (c1, k60).
1527658922: New connection from 127.0.0.1 on port 1883.

在此之后,我尝试将命令从一个应用程序发布到其他应用程序(两者都包含不同的代理),但其他应用程序未订阅 第一个应用。我不知道自己哪里出错了,或者我还有什么额外的事情要做..

0 个答案:

没有答案