Install Message Queue Mosquitto on Ubuntu/Debian

Source: Internet
Author: User

Install Message Queue Mosquitto on Ubuntu/Debian

MQTT is an instant messaging protocol developed by IBM. MQTT is a connection protocol for M2M and Iot. It uses a lightweight publishing and subscription message transmission mechanism. Mosquitto is an open-source message proxy software that implements MQTT v3.1 protocol. It provides a lightweight message push mode that supports publishing/subscription, making short message communication between devices easy to use.

If you contact the MQTT Protocol for the first time, you can understand the following concepts:

[MQTT protocol features]-compared with the RESTful Iot system, MQTT can achieve better remote control through message pushing.

MQTT role: An Iot system in a RESTful architecture, which contains two roles: client and server. The MQTT protocol includes publishers, proxies (servers), and subscribers.

MQTT message: the message in MQTT can be understood as the content (load) exchanged between the publisher and the subscriber. The message contains the specific content and can be used by the subscriber.

MQTT topic: a set of messages of the same type or similar type.

The default listening port is:

1883: MQTT, not encrypted

8883: MQTT, encrypted

8884: MQTT, encrypted, and verified by Customer Service

8080: MQTT uses WebSockets and is not encrypted.

By default, Mosquitto is placed in the kernel of the computer or in the microcontroller like Intel-Edison. Next we will explain how to install Mosquitto on the Linux download site.

Install MQTT:

Update source,

$ Sudo wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key

$ Sudo apt-key add mosquitto-repo.gpg.key

Make source, use apt:

$ Sudo cd/etc/apt/sources. list. d/

Select the debian version as follows:

$ Sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.list

$ Sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list

For Ubuntu users please use this address: https://launchpad.net /~ Mosquitto-dev/+ archive/ubuntu/mosquitto-ppa/

Update apt information:

$ Sudo apt-get update

Check the available resources of the mosquitto installation package:

$ Sudo apt-cache search mosquitto

Or directly go to the installation:

$ Sudo apt-get install mosquitto

Enable MQTT:

$ Sudo service mosquitto start

Stop MQTT:

$ Sudo service mosquitto stop

View the MQTT status:

$ Sudo service mosquitto status

View the listening port:

$ Netstat-anplt | grep 1883

You can also test,

$ Sudo mosquitto_sub-h test.mosquitto.org-t "#"-v

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.