参考链接: https://www.jianshu.com/p/ce1c9db3523a
1.解决erlang版本过低问题
创建erlang.repo文件
cat > /etc/yum.repos.d/erlang.repo <<EOT
[rabbitmq-erlang]
name=rabbitmq-erlang
baseurl=https://dl.bintray.com/rabbitmq/rpm/erlang/20/el/7
gpgcheck=1
gpgkey=https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
repo_gpgcheck=0
enabled=1
EOT
yum clean all && yum makecache
yum install -y erlang
2.rabbitmq-server-3.7.8安装
rpm -Uvh https://mirrors.tuna.tsinghua.edu.cn/epel/epel-release-latest-7.noarch.rpm
rabbitmq-server官网下载地址
http://www.rabbitmq.com/install-rpm.html
安装
yum install https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.8/rabbitmq-server-3.7.8-1.el7.noarch.rpm
rabbitmqctl reset
rabbitmq-plugins enable rabbitmq_mqtt
rabbitmq-plugins enable rabbitmq_stomp
rabbitmq-plugins enable rabbitmq_web_mqtt
rabbitmq-plugins enable rabbitmq_web_stomp
3.启动
systemctl enable rabbitmq-server
systemctl start rabbitmq-server
systemctl status rabbitmq-server
4.配置
cp /usr/share/doc/rabbitmq-server-3.7.8/rabbitmq.config.example /etc/rabbitmq/
mv rabbitmq.config.example rabbitmq.config
vim rabbitmq.config
将此行取消注释: {loopback_users, [<<"guest">>]}
:x
开启web管理插件
rabbitmq-plugins enable rabbitmq_management
systemctl restart rabbitmq-server
5.其他配置
rabbitmq-plugins enable rabbitmq_tracing #rabbitmq启用trace插件
rabbitmqctl trace_on #打开trace的开关
rabbitmqctl trace_on -p test #打开trace的开关(test为需要日志追踪的vhost)
rabbitmqctl trace_off #关闭trace的开关
6.插件存储目录: /usr/lib/rabbitmq/lib/rabbitmq_server-3.7.8/plugins
安装rabbitmq_delayed_message_exchange(延时队列)
wget https://dl.bintray.com/rabbitmq/community-plugins/rabbitmq_delayed_message_exchange-0.0.1.ez
启用插件
rabbitmq-plugins enable rabbitmq_delayed_message_exchange
7.访问
web端口:15672
服务端口:5672
curl localhost:15672
8.设置用户
rabbitmqctl add_user admin admin
rabbitmqctl set_user_tags admin administrator
rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"
rabbitmqctl list_users