layout:     post
title:      在阿里云服务器上(centos 8) 安装自己的MQTT服务器 (mosquitto)
subtitle:   
date:       2020-3-2
author:     Dapenson
header-img: img/post-bg-ios9-web.jpg
catalog: true
tags:
    - MQTT
    - 阿里云

配置

sudo yum install epel-release
sudo yum install snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap

重新登录

安装

sudo snap install mosquitto

此时反馈

mosquitto 1.6.8 from Roger Light (ralight) installed

测试

  • 订阅
mosquitto_sub -t 'test/topic' -v
  • 发布
    新建一个命令行窗口进行发布
mosquitto_pub -t 'test/topic' -m 'hello world #1'

此时将看见订阅窗口出现发布的消息hello world #1

  • 最后一步 ,如果您是阿里云的服务器,则需要打开1883端口

参考链接:

相关文章:

  • 2021-09-29
  • 2021-06-27
  • 2021-09-25
  • 2021-11-28
  • 2021-10-26
  • 2022-12-23
  • 2021-12-20
猜你喜欢
  • 2021-06-03
  • 2021-05-12
  • 2021-06-04
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案