I. Installation of the ERLANG environment
1. Download Erlang Source code
wget http://erlang.org/download/otp_src_19.1.tar.gz
2. Install dependent library files
Yum Install ncurses ncurses-base ncurses-devel ncurses-libs ncurses-static ncurses-term ocaml-curses Ocaml-curses-devel Openssl-devel zlib-devel-y
3. Compiling and installing Erlang
tar zxf otp_src_19. 1. Tar . GZCD otp_src_19. 1 . /configure--prefix=/opt/erlang/19.1 --with-ssl-enable-threads-enable-smmp-support-enable-kernel-poll-- Enable-hipe--without-javacmake make andinstall
4. Configuring environment variables (/etc/profile.d/erlang.sh)
erlang_home=/opt/erlang/19.1Path= $ERLANG _home/bin: $PATHexport erlang_homeexport Path
source/etc/profile.d/erlang.sh
5. Verify that the Erlang environment is correct or not
Execution command: Erl
Second, installation RabbitMQ3.6.6
1. Download RABBITMQ Source code
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/ Rabbitmq-server-generic-unix-3.6.6.tar.xz
Rabbitmq-server-generic-unix-3.6.6.tar.xz
Rabbitmq-server-generic-unix-3.6.6.tar
2. Start and close Rabbitmq-server
./rabbitmq-server-detached
./rabbitmq-plugins Enable rabbitmq_management #开启插件管理页面 open Port 15672
./rabbitmqctl Stop #关闭服务
3. Create user
./rabbitmqctl add_user admin password. /rabbitmqctl set_user_tags mquser Administrator. " / " " .* " " .* " " .* " rabbitmqctl list_user_permissions Admin
4. Web Login
http://*.*.*.*:15672
Third, cluster construction
1. Server Selection
Hostname IP
Node1 192.168. 1.100 node2 192.168. 1.101 node3 192.168. 1.102
2. Modify the configuration on three servers separately
(1) Modify/etc/hosts
192.168. 1.100 node1192.168. 1.101 node2192.168. 1.102 Node3
(2) Modify/etc/sysconfig/network
Hostname=node1 #node1服务器HOSTNAME=node2 #node2服务器HOSTNAME=node3 #node3服务器
(3) Setting hostname
hostname node1 #node1服务器 hostname node2 #node2服务器 hostname NODE3 #node3服务器
3, modify the Erlang.cookie, so that three servers remain consistent
Either by remotely copying the file (SCP) or by copying the content directly
4. After setting Erlang.cookie, use detached background to start rabbitmq-server
Start:./rabbitmq-server-detached
View the status of each node:./rabbitmqctl cluster_status
5, add Node2, node3 respectively into the cluster node1
Rabbitmqctl Stop_app---Close the app only, the node is not closed
(1) Node2
./rabbitmqctl Stop_app. /rabbitmqctl join_cluster-ram [email protected]. /rabbitmqctl Start_app
(2) Node3
./rabbitmqctl Stop_app. /rabbitmqctl join_cluster-ram [email protected]. /rabbitmqctl Start_app
6. View cluster status
./rabbitmqctl Cluster_status
[{nodes,[{disc,[[email protected]]},{ram,[[email protected],[email protected]}]}, {Running_nodes,[[email Protected],[email Protected],[email Protected]}, {cluster_name,<<"[email protected] ">>}, {partitions,[]}, {Alarms,[{[email protected],[]},{[email protected],[]},{[email protected] ,[]}]}]
Configuring Rabbitmq3.6.6 cluster Scenarios in CentOS6.5