作者:【吴业亮】
博客:http://blog.csdn.net/wylfengyujiancheng
1、安装软件包
yum install erlang rabbitmq-server –y
2、启动服务并设置开机启动
systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service
3、创建用户
rabbitmqctl add_user openstack Changeme_123
4、赋予用户权限
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
5、修改配置文件
cat <<END> /etc/rabbitmq/rabbitmq-env.conf
RABBITMQ_NODE_PORT=5672
ulimit -S -n 4096
RABBITMQ_SERVER_ERL_ARGS="+K true +A30 +P 1048576 -kernel inet_default_connect_options [{nodelay,true},{raw,6,18,<<5000:64/native>>}] -kernel inet_default_listen_options [{raw,6,18,<<5000:64/native>>}]"
RABBITMQ_NODE_IP_ADDRESS=172.16.8.60
END
替换为本机的IP
6、将节点node1的cookie拷贝到其他节点上
scp /var/lib/rabbitmq/.erlang.cookie node2:/var/lib/rabbitmq/.erlang.cookie
scp /var/lib/rabbitmq/.erlang.cookie node3:/var/lib/rabbitmq/.erlang.cookie
7、将其他节点加入到集群中
在第二个节点中
systemctl restart rabbitmq-server
rabbitmqctl stop_app
rabbitmqctl join_cluster --ram rabbit@node1
rabbitmqctl start_app
第三个节点
systemctl restart rabbitmq-server
rabbitmqctl stop_app
rabbitmqctl join_cluster --ram rabbit@node1
rabbitmqctl start_app
8、查看集群状态
rabbitmqctl cluster_status
9、打开管理界面
rabbitmq-plugins enable rabbitmq_management
systemctl restart rabbitmq-server
10、赋予管理员权限
rabbitmqctl set_user_tags openstack administrator
11、登录界面
http://172.16.8.60:15672