How To Install VerneMQ on UbunTu, RHEL, Docker, Debian and Cent OS
VerneMQ is a high-performance, distributed MQTT message broker. It scales horizontally and vertically on commodity hardware to support a high number of concurrent publishers and consumers while maintaining low latency and fault tolerance. To use it, all you need to do is install the VerneMQ package.
For more information about VerneMQ Read this – VerneMQ – Clustering MQTT for high availability and scalability
Recommended: MQTT Servers/Brokers
How To Install VerneMQ on Ubuntu and Debian
VerneMQ can be installed on Debian or Ubuntu-based systems using the binary package. Download Package
Install VerneMQ
Once you have downloaded the binary package, execute the following command to install VerneMQ:
sudo dpkg -i vernemq_1.7.1-1_amd64.deb
Note : Check Version and modify
Verify your installation
You can verify that VerneMQ is successfully installed by running:
dpkg -s vernemq | grep Status
If VerneMQ has been installed successfully Status: install ok installed
is returned.
Activate VerneMQ node
Once you’ve installed VerneMQ, start it on your node:
service vernemq start
Default Directories and Paths
The whereis vernemq
command will give you a couple of directories:
whereis vernemq
vernemq: /usr/sbin/vernemq /usr/lib/vernemq /etc/vernemq /usr/share/vernemq
/usr/sbin/vernemq: | the vernemq and vmq-admin commands |
/usr/lib/vernemq | the vernemq package |
/etc/vernemq | the vernemq.conf file |
/usr/share/vernemq | the internal vernemq schema files |
/var/lib/vernemq | the vernemq data dirs for LevelDB (Metadata Store and Message Store) |
Installing on CentOS and RHEL
VerneMQ can be installed on CentOS-based systems using the binary package. Download Package
Install VerneMQ
Once you have downloaded the binary package, execute the following command to install VerneMQ:
sudo yum install vernemq-1.7.1-1.el7.centos.x86_64.rpm
or:
sudo rpm -Uvh vernemq-1.7.1-1.el7.centos.x86_64.rpm
Activate VerneMQ node
Once you’ve installed VerneMQ, start it on your node:
service vernemq start
Verify your installation
You can verify that VerneMQ is successfully installed by running:
rpm -qa | grep vernemq
If VerneMQ has been installed successfully vernemq
is returned.
Running VerneMQ using Docker
As well as being available as packages that can be installed directly into the operating systems, VerneMQ is also available as a Docker image. Below is an example of how to set up a couple of VerneMQ nodes using Docker.
Start a VerneMQ cluster node
docker run --name vernemq1 -d erlio/docker-vernemq
Somtimes you need to configure a forwarding for ports (on a Mac for example):
docker run -p 1883:1883 --name vernemq1 -d erlio/docker-vernemq
This starts a new node that listens on 1883 for MQTT connections and on 8080 for MQTT over websocket connections. However, at this moment the broker won’t be able to authenticate the connecting clients. To allow anonymous clients use the DOCKER_VERNEMQ_ALLOW_ANONYMOUS=on
environment variable.
docker run -e "DOCKER_VERNEMQ_ALLOW_ANONYMOUS=on" --name vernemq1 -d erlio/docker-vernemq
Autojoining a VerneMQ cluster
This allows a newly started container to automatically join a VerneMQ cluster. Assuming you started your first node like the example above you could autojoin the cluster (which currently consists of a single container ‘vernemq1’) like the following:
docker run -e "DOCKER_VERNEMQ_DISCOVERY_NODE=<IP-OF-VERNEMQ1>" --name vernemq2 -d erlio/docker-vernemq
(Note, you can find the IP of a docker container using docker inspect <containername/cid> | grep \"IPAddress\"
).
Checking cluster status
To check if the above containers have successfully clustered you can issue the vmq-admin
command:
docker exec vernemq1 vmq-admin cluster show
+--------------------+-------+
| Node |Running|
+--------------------+-------+
|VerneMQ@172.17.0.151| true |
|VerneMQ@172.17.0.152| true |
+--------------------+-------+
All vmq-admin
commands are available. See https://vernemq.com/docs/administration/ for more information.
You may like also:
- Mongoose OS – an IoT firmware development framework
- How To Enable Free HTTPS on your website
- How To Create Secure MQTT Broker
- MQTT Public Brokers List
- Controlling LED with Raspberry Pi
- Home automation | IoT Products for Home Automation
Pingback: VerneMQ - Clustering MQTT for high availability and scalability
Pingback: How To Install VerneMQ on UbunTu, RHEL, Docker, Debian and Cent OS — IoTbyHVM – Explore TechBytes – hashstacks
Pingback: Mongoose OS is now an STMicroelectronics Authorized Partner
is there any way to create a vernemq docker from source code
Pingback: Connecting to VerneMQ Tutorial - IoTbyHVM - Bits & Bytes of IoT
Pingback: Linux File system & Basic commands - onionlinux.com
Pingback: Linux Basic Commands | File System Hierarchy Standard | Linux Tutorials
Pingback: Vernemq Notes - Phanix's Blog