centos7下安装rabbit(避免版本的坑)
rabbit官网强烈建议使用PackageCloud
https://www.rabbitmq.com/install-rpm.html
执行PackageCloud命令如下,获取erlang的rpm
curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
安装erlang
yum install erlang
执行PackageCloud命令如下,获取rabbitmq的rpm
curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash
安装rabbitmq
yum install rabbitmq-server
启动
service rabbitmq-server start
启动管理平台
rabbitmq-plugins enable rabbitmq_management
添加需要访问的端口(一条条执行)
firewall-cmd --zone=public --add-port=15672/tcp --permanent
firewall-cmd --zone=public --add-port=5671-5672/tcp --permanent
firewall-cmd --zone=public --add-port=4369/tcp --permanent
firewall-cmd --zone=public --add-port=25672/tcp --permanent
firewall-cmd --zone=public --add-port=35672-35682/tcp --permanent
firewall-cmd --reload
访问 机器IP:15672
新的rabbit不允许guest用户在localhost以外的机器访问
添加用户
rabbitmqctl add_user admin 123456
配置角色
rabbitmqctl set_user_tags admin administrator
配置权限
rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"
然后就可以登录访问了