1883, 8883 (if MQTT is enabled)??
The appropriate port to turn on firewall settings
??
??
Add EPEL Source
??
[email protected] ~]# RPM-UVH https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Retrieving https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Warning:/var/tmp/rpm-tmp.2hdpsr:header V3 rsa/sha256 Signature, key ID 352c64e5:nokey
Preparing ... ################################# [100%]
Updating/installing ...
1:epel-release-7-8 ################################# [100%]
??
Add Erlang Source
??
[email protected] ~]# RPM-UVH http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
Retrieving http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
Preparing ... ################################# [100%]
Updating/installing ...
1:erlang-solutions-1.0-1 ################################# [100%]
--2016-11-29 06:34:38--Http://packages.erlang-solutions.com/rpm/centos/erlang_solutions.repo
Resolving packages.erlang-solutions.com (packages.erlang-solutions.com) ... 31.172.186.53
Connecting to Packages.erlang-solutions.com (packages.erlang-solutions.com) |31.172.186.53|:80 ... Connected.
HTTP request sent, awaiting response ... OK
length:245
Saving to: ' Erlang_solutions.repo '
??
100%[==========================================================================>] 245--.-K/s in 0s
??
2016-11-29 06:34:39 (27.5 mb/s)-' Erlang_solutions.repo ' saved [245/245]
??
installation RabbitMQ
software version:http://www.rabbitmq.com/releases/rabbitmq-server
??
[email protected] ~]# wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/ rabbitmq-server-3.6.6-1.el7.noarch.rpm
[email protected] ~]# rpm--import HTTPS://WWW.RABBITMQ.COM/RABBITMQ-SIGNING-KEY-PUBLIC.ASC
[email protected] ~]# yum Install rabbitmq-server-3.6.6-1.el7.noarch.rpm
??
Start the service
[email protected] ~]# systemctl enable Rabbitmq-server.service
[email protected] ~]# systemctl start Rabbitmq-server.service
??
enabled RabbitMQ Monitoring Plugins
[email protected] ~]# rabbitmq-plugins enable Rabbitmq_management
The following plugins has been enabled:
Mochiweb
Webmachine
Rabbitmq_web_dispatch
Amqp_client
Rabbitmq_management_agent
Rabbitmq_management
??
Applying plugin configuration to [email protected] started 6 plugins.
[email protected] ~]# NETSTAT-APN | grep 15672
TCP 0 0 0.0.0.0:15672 0.0.0.0:* LISTEN 4119/beam.smp
??
RabbitMQ User Management
??
Add User (user name root, password Admin)
[[email protected] ~]# rabbitmqctl add_user Admin Admin
??
Set User Role (set Admin user as Admin role)
[email protected] ~]# rabbitmqctl set_user_tags Admin Administrator
Setting tags for the user "admin" to [Administrator] ...
??
Set user permissions (set Admin user Configuration, write, read permissions)
[email protected] ~]# rabbitmqctl set_permissions-p/admin ". *". * "". * "
Setting permissions for the user "admin" in Vhost "/" ...
??
Delete User (delete guest user)
[email protected] ~]# rabbitmqctl Delete_user Guest
??
??
RabbitMQ Cluster Configuration
The cluster configuration is based on the completion of the single-machine configuration
The following takes node140 as an example, node132 needs to do the same
in the node132 , node139 , node140 In the /etc/hosts file, respectively:
192.168.190.132 node132
192.168.190.139 node139
192.168.190.140 node140
??
RABBITMQ the cluster is dependent on the Erlang cluster to work, you must first build the Erlang cluster environment. the nodes in Erlang 's cluster are implemented by a magic?cookie , which is stored in ?/var/lib/rabbitmq/.erlang.cookie? , the file is - the permissions. Therefore, you must ensure that each node cookie is consistent, otherwise the node cannot communicate
??
[email protected] /]# echo-n "Azvoczyzzbvflbptbxu" >/var/lib/rabbitmq/.erlang.cookie
[email protected] ~]# chown Rabbitmq:root/var/lib/rabbitmq/.erlang.cookie
[email protected] /]# chmod 600/var/lib/rabbitmq/.erlang.cookie
[email protected] /]# Cat/var/lib/rabbitmq/.erlang.cookie
Azvoczyzzbvflbptbxu
??
Start the service
[email protected] ~]# systemctl start Rabbitmq-server.service
[email protected] ~]# rabbitmq-server-detached
??
Open firewall
[email protected] ~]# firewall-cmd--permanent--add-port={4369/tcp,25672/tcp}
Success
[email protected] ~]# firewall-cmd--reload
Success
??
Set mirroring Policy??
[[email protected] ~]# rabbitmqctl set_policy ha-all "^" ' {"Ha-mode": "All", "Ha-sync-mode": "Automatic"} '
Setting policy "Ha-all" for the pattern "^" to "{\" ha-mode\ ": \" all\ ", \" ha-sync-mode\ ": \" Automatic\ "}" with priority "0" ...
??
enabled RabbitMQ Monitoring Plugins
if cluster is set up, rabbitmq_management overview nodes part of the Web management tool, see " node Statistics not available " information that the Web Management plug-in is not enabled on this node.
[email protected] ~]# rabbitmq-plugins enable Rabbitmq_management
??
once the cluster is configured, you can RabbitMQ execute the following command on any node to see if the cluster configuration was successful.
[email protected] ~]# rabbitmqctl cluster_status
??
Other nodes need to do the same
??
??
Login Site http://192.168.190.139:15672/
??
??
??
??
??
Reference URL: http://www.rabbitmq.com/clustering.html
Problems encountered during installation:
This/var/lib/rabbitmq/.erlang.cookie file needs to modify the file owner and file permissions for RW, otherwise the RABBITMQ service cannot start;
??
??
??
??
??
??
??
??
??
??
??
??
??
??