This article only records which pits have been trampled ...
Test environment:
-Centos6.7_x64
-rabbitmq-3.5.7
First, install the RABBITMQ
Install RABBITMQ in yum mode here
1, the dependency package and the compilation environment preparation:
Yum-y install build-essential OpenSSL openssl-devel unixODBC unixodbc-devel make gcc glibc-devel gcc-c++ autoconf kernel- Devel M4 ncurses-devel TK TC
2. Installing Erlang
RABBITMQ is based on Erlang, so you must first configure the Erlang environment.
Yum-y Install Erlang
3, Installation Rabbitmq-server
RPM--import HTTP://WWW.RABBITMQ.COM/RABBITMQ-SIGNING-KEY-PUBLIC.ASC wget http://www.rabbitmq.com/releases/ RABBITMQ-SERVER/V3.5.7/RABBITMQ-SERVER-3.5.7-1.NOARCH.RPMRPM-IVH rabbitmq-server-3.5.7-1.noarch.rpm
Or:
Yum-y Install rabbitmq-server-3.5.7-1.noarch.rpm
Before you proceed, make sure that the SELinux and iptables on this machine remain off, otherwise ...
4. Server Host Configuration:
Please edit the Hosts file, the host name and IP address corresponding to write in, RABBITMQ all the host to write, an example:
vim/etc/hosts192.168.71.128 demo1192.168.71.134 centos67-01
5. Start RABBITMQ
Perform the following commands on each of the two machines:
Service Rabbitmq-server Start
6. Edit the. Erlang.cookie file
Make sure that the files on all RABBITMQ cluster nodes are consistent in the Erlang.cookie content.
You can copy the contents of one of the nodes to all the. erlang.cookie files on each of the other nodes.
The directory where the. erlang.cookie file is located is as follows:
$HOME/.erlang.cookie/var/lib/rabbitmq/.erlang.cookie
The. Erlang.cookie in the above two paths are modified.
If a permissions issue occurs, proceed as follows:
chmod $HOME/.erlang.cookiechmod 600/var/lib/rabbitmq/.erlang.cookie
Otherwise the following error will appear [many pits here ...] :
ERROR:EPMD error for Host demo1:address (cannot connect to host/port) * TCP connection succeeded but Erlang distribution Failederror:unable to connect to nodes [[email protected]: nodedownerror:mnesia_unexpectedly_running ...
And so many questions.
7, select a RABBITMQ master node (centos67-01), start RABBITMQ
Service Rabbitmq-server Start
Note: After the Hsots file has been modified and the. erlang.cookie file is modified, the next RABBITMQ (all nodes) will be restarted
Service Rabbitmq-server Restart
8. Join the node demo1 to the cluster
[Email protected] ~]# rabbitmqctl stop_appstopping node [email protected] ... [Email protected] ~]# rabbitmqctl reset[[email protected] ~]# rabbitmqctl join_cluster--ram [email protected] Clu stering node [email protected] with ' [email protected] ' ... [Email protected] ~]# rabbitmqctl cluster_status cluster Status of node [email protected]. .. [{nodes,[{disc,[' [email protected] ']},{ram,[[email protected]}]}]
View cluster information on the master node
[Email protected] ~]# rabbitmqctl cluster_statuscluster Status of node ' [email protected] ' ... [{nodes,[{disc,[' [email protected] '}]}, {running_nodes,[' [email protected] ']}, {cluster_name,<< "[Email Protected] ">>}, {partitions,[]}]
If a node fails to join the cluster, it is done in the following order
[Email protected] ~]# rabbitmqctl stop_appstopping node [email protected] ... [Email protected] ~]# rabbitmqctl reset[[email protected] ~]# rabbitmqctl join_cluster--ram [email protected]
If it still fails, check that the sixth step above is done and make sure that the. erlang.cookie files for each node are consistent.
Another: Make sure that the server's firewall and SELinux are off.
If you have checked the not yet, please leave a message to communicate ...
Next, organize the RABBITMQ cluster usage and the management of the cluster nodes ...
This article is from the "Cold Tea" blog, please be sure to keep this source http://miaocbin.blog.51cto.com/689091/1854074
rabbitmq-3.5.7 Cluster Installation configuration