MQTT(RabbitMQ) + NiFi


Download page:
https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.14/

erlang
https://www.rabbitmq.com/releases/erlang/

Install :

sudo yum install erlang
sudo yum install socat
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.14/rabbitmq-server-3.6.14-1.el7.noarch.rpm
sudo rpm -ivh rabbitmq-server-3.6.14-1.el7.noarch.rpm

Run RabbitMQ Server

Start the Server

sudo chkconfig rabbitmq-server on
sudo /sbin/service rabbitmq-server start
sudo /sbin/service rabbitmq-server stop

Check the port opened:

sudo netstat -a -t --numeric-ports -p
sudo rabbitmqctl status

Add RabbitMQ Management Plugin

sudo rabbitmq-plugins enable rabbitmq_management

http://zzeng-hdp-ambari.field.hortonworks.com:15672/

sudo rabbitmqctl add_user admin_user admin_password

sudo rabbitmqctl add_user admin_user admin_password
sudo rabbitmqctl set_user_tags admin_user administrator

# add permission to /
https://www.rabbitmq.com/rabbitmqctl.8.html#Access_Control

[centos@zzeng-hdp-ambari ~]$ sudo rabbitmqctl list_vhosts
Listing vhosts
/
qa1
[centos@zzeng-hdp-ambari ~]$

Start / Stop RabbitMQ service

# stop the local node
sudo service rabbitmq-server stop

# start it back
sudo service rabbitmq-server start
sudo service rabbitmq-server status

Prepare MQTT Client env

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py

sudo pip install pika