赞
踩
yum源配置文件夹(/etc/yum.repos.d)下添加rabbitmq.repo,文件内容如下:
# In /etc/yum.repos.d/rabbitmq.repo ## ## Zero dependency Erlang ## [rabbitmq_erlang] name=rabbitmq_erlang baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/$basearch repo_gpgcheck=1 gpgcheck=1 enabled=1 # PackageCloud's repository key and RabbitMQ package signing key gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300 [rabbitmq_erlang-source] name=rabbitmq_erlang-source baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/SRPMS repo_gpgcheck=1 gpgcheck=0 enabled=1 gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300 ## ## RabbitMQ server ## [rabbitmq_server] name=rabbitmq_server baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/7/$basearch repo_gpgcheck=1 gpgcheck=1 enabled=1 # PackageCloud's repository key and RabbitMQ package signing key gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300 [rabbitmq_server-source] name=rabbitmq_server-source baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/7/SRPMS repo_gpgcheck=1 gpgcheck=0 enabled=1 gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300
猜测:使用这个yum之后,可以解决Erlang版本和操作系统版本问题。
#更新yum源
yum update -y
#install these dependencies from standard OS repositories
yum install socat logrotate -y
#安装erlang和rabbitmq
yum install erlang rabbitmq-server -y
#查看Erlang
erl -v
Erlang/OTP 24 [erts-12.1.5] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1]
Eshell V12.1.5 (abort with ^G)
1>
1>halt().
#查看rabbitmq,可能要启动后才能使用rabbitmqctl
rabbitmqctl version
3.9.10
#启动
systemctl start rabbitmq-server
#查看状态
systemctl status rabbitmq-server
需要开放5672与15672端口,15672端口为管理界面使用
#添加5672及15672
firewall-cmd --permanent --zone=public --add-port=5672/tcp
firewall-cmd --permanent --zone=public --add-port=15672/tcp
#重新加载防火墙数据
firewall-cmd --reload
sudo /sbin/rabbitmq-plugins enable rabbitmq_management
#查询安装默认的用户(一般有一个guest 用户和一个administrator管理员用户)
rabbitmqctl list_users
#其中admin 是用户名,123456是密码
rabbitmqctl add_user admin 123456
#通过命令给用户增加角色权限
rabbitmqctl set_user_tags admin administrator
#给用户增加所有访问权限
rabbitmqctl set_permissions -p "/" admin '.*' '.*' '.*'
官方下载:https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases
#将文件上传至RabbitMQ的插件目录下,按照以上步骤操作的文件目录是:/usr/lib/rabbitmq/lib/rabbitmq_server-3.10.0/plugins
#如果没有此目录,那就使用find命令进行查找
find / -name rabbitmq
#文件上传后,到RabbitMQ的bin目录下启动插件
rabbitmq-plugins enable rabbitmq_delayed_message_exchange
#最后一步,重启RabbitMQ
systemctl restart rabbitmq-server
登录至RabbitMQ的WEB管理后台,检查Exchanges–>Add a new exchange --> type是否有X-delayed-message选项
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。