Mosquitto Ubuntu 安装
来源:互联网 发布:希腊移民知乎 编辑:程序博客网 时间:2024/05/19 22:25
参考官网
As of version 11.10 Oneiric Ocelot, mosquitto will be in the Ubuntu repositories so you can install as with any other package. If you are on an earlier version of Ubuntu or want a more recent version of mosquitto, add the mosquitto-dev PPA to your repositories list – see the link for details. mosquitto can then be installed from your package manager.sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppasudo apt-get updateIf the command “apt-add-repository” is not recognised, it can be installed with:sudo apt-get install python-software-properties
操作过程
root@iZwz92tbw6nsayzyqcumgdZ:~/download# apt-get install software-properties-common Reading package lists... DoneBuilding dependency tree Reading state information... Donesoftware-properties-common is already the newest version.0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.root@iZwz92tbw6nsayzyqcumgdZ:~/download# root@iZwz92tbw6nsayzyqcumgdZ:~/download# root@iZwz92tbw6nsayzyqcumgdZ:~/download# apt-get install python-software-properties Reading package lists... DoneBuilding dependency tree Reading state information... Donepython-software-properties is already the newest version.root@iZwz92tbw6nsayzyqcumgdZ:~/download# sudo add-apt-repository ppa:mosquitto-dev/mosquitto-ppa More info: https://launchpad.net/~mosquitto-dev/+archive/ubuntu/mosquitto-ppaPress [ENTER] to continue or ctrl-c to cancel adding itgpg: keyring `/tmp/tmphm49azto/secring.gpg' createdgpg: keyring `/tmp/tmphm49azto/pubring.gpg' createdgpg: requesting key 262C4500 from hkp server keyserver.ubuntu.comgpg: /tmp/tmphm49azto/trustdb.gpg: trustdb createdgpg: key 262C4500: public key "Launchpad mosquitto" importedgpg: Total number processed: 1gpg: imported: 1 (RSA: 1)OKroot@iZwz92tbw6nsayzyqcumgdZ:~/download# root@iZwz92tbw6nsayzyqcumgdZ:~/download# sudo apt-get updateIgn http://mirrors.cloud.aliyuncs.com trusty InReleaseIgn http://mirrors.aliyun.com trusty InRelease Get:1 http://mirrors.aliyun.com trusty-security InRelease [65.9 kB] Get:2 http://mirrors.cloud.aliyuncs.com trusty-security InRelease [65.9 kB] Get:3 http://mirrors.cloud.aliyuncs.com trusty-updates InRelease [65.9 kB] Get:4 http://mirrors.cloud.aliyuncs.com trusty-proposed InRelease [65.9 kB] Hit http://mirrors.cloud.aliyuncs.com trusty-backports InRelease ......................................root@iZwz92tbw6nsayzyqcumgdZ:~/download# root@iZwz92tbw6nsayzyqcumgdZ:~/download# sudo apt-get install mosquittoReading package lists... DoneBuilding dependency tree Reading state information... DoneThe following extra packages will be installed: libwebsockets3The following NEW packages will be installed:................................## 安装完成自动运行## 客户端安装root@iZwz92tbw6nsayzyqcumgdZ:/etc/mosquitto# sudo apt-get install mosquitto.clientsReading package lists... DoneBuilding dependency tree
测试过程
打开两个终端,一个发布,一个订阅
发布test
admin@iZwz92tbw6nsayzyqcumgdZ:/data$ mosquitto_pub -h 127.0.0.1 -t test -m 'sfasfds'admin@iZwz92tbw6nsayzyqcumgdZ:/data$
订阅test
root@iZwz92tbw6nsayzyqcumgdZ:/etc/mosquitto# root@iZwz92tbw6nsayzyqcumgdZ:/etc/mosquitto# mosquitto_sub -h 127.0.0.1 -t testhello MqTTaskdfsld
常用命令
sudo service mosquitto start #启动sudo service mosquitto status #查看状态sudo service mosquitto restart #重启sudo service mosquitto stop #停止
监听端口(1883)
admin@iZwz92tbw6nsayzyqcumgdZ:/data$ netstat -an |grep 1883tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN tcp6 0 0 :::1883 :::* LISTEN admin@iZwz92tbw6nsayzyqcumgdZ:/data$
0 0
- Ubuntu 上安装mosquitto
- Ubuntu环境安装mosquitto
- Mosquitto Ubuntu 安装
- Ubuntu 安装Mosquitto
- mosquitto ubuntu 安装
- mosquitto ubuntu下编译和安装
- Mosquitto-Ubuntu 14.04快速安装问题解决
- ubuntu下mosquitto的安装使用
- 在ubuntu上安装,使用MQTT Mosquitto
- 在ubuntu上安装,使用MQTT Mosquitto
- Ubuntu 16.04安装测试MQTT Mosquitto
- mosquitto安装
- mosquitto安装完成
- Mac安装mosquitto错误
- mosquitto安装与使用
- mosquitto 安装与使用
- Centos7下安装mosquitto
- mosquitto安装使用
- 获取数组中的最大值
- 面试宝典大全
- GC与JS内存泄露
- 广义表操作【严蔚敏】
- vc2010 error MSB4023: 无法计算项元数据“%(Extension)”
- Mosquitto Ubuntu 安装
- 如何重构多重嵌套“箭头型”代码
- 关于tomcat部署项目出现的问题并解决方法
- bit_set(位图)
- tensorflow-Optimizer
- 微信小程序商城
- MQTT V3.1 协议说明书(译)
- 百度笔试、一面
- Android 视频播放横屏布局错乱问题