Recently the company has been using MQTT as a push protocol, so they looked into RabbitMq, which is said to support millions of concurrent requests, did some research and found that there are still pits in some places, so they are listed in case the children behind them also use the pits. RabbitMq: http://www.rabbitmq.com/ If you don’t know what RabbitMq is, find out for yourself. Students who are good at English are still recommended to read English materials. Official documents are more accurate than those on the Internet. I used centos7.2 to build rabbitMQ server, and then Xshell5, you can also build Linux Windows, not described here! 1. First install Erlang with EPEL source (there are many contents to be installed, and the broadband should be able to keep up) :

sudo yum install erlang
Copy the code
There is another way to install it on Github. To find out, go to Github to search for RabbitMQ, which I used first. 2. Install RabbitMQ first install the following dependencies:Copy the code
rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
Copy the code

Then download rabbit. Note that the wget command is the download link

Wget HTTP: / / http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.5/rabbitmq-server-3.6.5-1.noarch.rpmCopy the code

This command only downloads rabbitMQ and does not install it. Check the command ll on xshell and there is an RPM file.

Then install with the following command:

Yum install -- y the rabbitmq server - 3.6.5-1. Noarch. RPMCopy the code

To start the service: —–> check your hostname: hostname, for example, my hostname is: test; —–> Modify the host file: vim /etc/hosts, add a line: 127.0.0.1 test (must do this), here is the vim installation command:

yum install vim-enhanced
Copy the code

Rabbitmq —–> start: service rabbitmq-server start, it is usually slow to start, so don’t be hasty —–> stop: Service rabbitmq-server stop —–> Restart: service rabbitmq-server restart —-> Chkconfig Rabbitmq-server on

Find / -name “rabbitmq.config.example”; The/usr/share/doc/the rabbitmq server – 3.6.5. / the rabbitmq config. The results of the example copy the default configuration cp / usr/share/doc/the rabbitmq server – 3.6.5. / the rabbitmq config. The example/etc/rabbitmq/modify profile name: CD/etc/rabbitmq; Run the following command to enable remote access to rabbitmq.config: mv rabbitmq.config.example rabbitmq.config: %% {loopback_users, []} %% {loopback_users, []}, {loopback_users, []} Rabbitmq_plugins enable rabbitmq_management Restart rabbitMQ service: service rabbitmq-server restart sudo iptables -I INPUT -p tcp -m tcp –dport 15672 -j ACCEPT sudo iptables -I INPUT -p tcp -m tcp –dport 5672 -j Sudo service iptables save sudo service iptables restart sudo service iptables restart Service systemctl stop firewalld.service systemctl disable firewalld.service

rabbitmqctl add_user admin admin
rabbitmqctl set_user_tags admin administrator
rabbitmqctl list_users

All right, that’s it. Might write something MQTT push in a few days… Interested children’s shoes welcome to discuss together