Compilation and configuration of Mqtt under Linux environment __linux

Source: Internet
Author: User

Installed method Reference http://blog.csdn.net/Netown_Ethereal/article/details/22653125

Do MQTT development, record some learning process.

Installation includes:

1. RPM Installation

2, the source code installation


(i) the use of RPM installation

Installation Environment Centos6.4

Download the Mosquitto RPM installation package from the link below: Click on the Open link (http://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-6/i686/)


Run the Install command: [HTML] view plain copy <span style= "FONT-SIZE:18PX;"  >[root@localhost xxx]# rpm-i mosquitto-1.3.1-3.1.i686.rpm warning:mosquitto-1.3.1-3.1.i686.rpm:header V3 Signature, Key ID 49e1d0b1:nokey</span>
Hint has warning, check a bit, this warning can be neglected. The method is to install the following instructions:


[HTML] view plain copy <span style= "FONT-SIZE:18PX;" >[root@localhost xxx]# RPM-UHV mosquitto-1.3.1-3.1.i686.rpm warning:mosquitto-1.3.1-3.1.i686.rpm:header V3       A1 Signature, key ID 49e1d0b1:nokey preparing ... ########################################### [100%] Package mosquitto-1.3.1-3.1.i686 is already installed</span>
As shown above, the display is successfully installed.

Check out the service below.[HTML]View plain copy <span style= "FONT-SIZE:18PX;" >[root@localhost/]# mosquitto Mosquitto mosquitto_passwd </span>
At the command line input: Mosquitto, press TAB two times, the following two instructions appear. Indicates that the Mosquitto has been successfully installed. If you start the Mosquitto service, you only need to enter the Mosquitto command. As follows:[HTML]View plain copy <span style= "FONT-SIZE:18PX;" >[root@localhost/]# mosquitto 1396234681:mosquitto version 1.3.1 (build date 2014-03-25 00:14:12+0000) starting 1   396234681:using Default CONFIG.   1396234681:opening IPv4 Listen socket on port 1883.   1396234681:opening IPv6 Listen socket on port 1883.   1396234750:new connection from 192.168.139.80 on port 1883. 1396234750:new client connected from 192.168.139.80 as QYLMQTT (C1, K60) .</span>

The last line of QYLMQTT is the client ID I developed on the Windows side, indicating that I have connected to the MQTT server from the client.


The above found no mosquitto of the publishing and subscribing clients, only the server. The Mosquitto client is installed below.

1, download the Mosquitto from the address of the above download RPM package to the client.

Mainly the following RPM packages:

libmosquitto1-1.3.1-3.1.i686.rpm   
mosquitto-clients-1.3.1-3.1.i686.rpm  

Note that there are several C + + devel, do not download the wrong, and as if C + + Devel also need to install the first libmosquitto1-1.3.1-3.1.i686.rpm

2, according to the above mentioned installation of the RPM package to install the above two RPM package

3, after the successful installation of the command line to enter Mosquitto,tab two times, the command displayed as follows: [plain] view plain copy [root@localhost ~]# Mosquitto Mosquitto MOSQUITTO_PASSWD mosquitto_pub Mosquitto_sub

Visible, has been installed on the client.


4, Operation

Open server: [plain]   View plain copy [root@localhost ~]# mosquitto   1396235903: mosquitto version 1.3.1  (build date 2014-03-25 00:14:12+0000)  starting   1396235903: using default config.  

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.