RabbitMQ集羣搭建node
##CentOS7.2 ##RabbitMQ 3.6.5 ####全部節點運行 下面命令 cat >/etc/yum.repos.d/CentOS-OpenStack-liberty.repo <<EOF [centos-openstack-liberty] name=CentOS-7 - OpenStack liberty baseurl=http://vault.centos.org/centos/7.3.1611/cloud/x86_64/openstack-liberty/ gpgcheck=0 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Centos-7 EOF ### yum install -y rabbitmq-server systemctl enable rabbitmq-server.service systemctl restart rabbitmq-server.service rabbitmqctl add_user admin admin rabbitmqctl set_user_tags admin administrator rabbitmqctl add_user openstack 123456 rabbitmqctl change_password openstack 123456 rabbitmqctl set_permissions openstack ".*" ".*" ".*" rabbitmqctl set_user_tags openstack administrator rabbitmq-plugins list rabbitmq-plugins enable rabbitmq_management netstat -tnlp|grep beam ####全部節點執行命令 羣集配置,/var/lib/rabbitmq/.erlang.cookie文件內容必須一致 echo $(echo 123456 |md5sum |cut -d ' ' -f1) >/var/lib/rabbitmq/.erlang.cookie systemctl restart rabbitmq-server.service netstat -tnlp|grep beam ######## ######其它節點運行,主節點不用運行 rabbitmqctl stop_app rabbitmqctl join_cluster rabbit@ops171 rabbitmqctl start_app rabbitmqctl cluster_status ####此時 node2 與 node3 也會自動創建鏈接;若是要使用內存節點,則可使用 ####rabbitmqctl join_cluster --ram rabbit@ops232 #更改羣集名稱 ###rabbitmqctl set_cluster_name RabbitMQ-Cluster #查看羣集狀態 rabbitmqctl cluster_status ###訪問RabbitMQ,訪問地址是http://ip:15672