1.添加rabbitmq yum源
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版本和操作系统版本问题。
2.yum安装rabbitmq
#更新yum源
yum update -y
#install these dependencies from standard OS repositories
yum install socat logrotate -y
#安装erlang和rabbitmq
yum install erlang rabbitmq-server -y
3.查看安装版本
#查看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
4.启动rabbitmq
#启动
systemctl start rabbitmq-server
#查看状态
systemctl status rabbitmq-server
5.防火墙开放端口访问
需要开放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
6.启用WEB管理页面插件
sudo /sbin/rabbitmq-plugins enable rabbitmq_management
7.添加访问用户
#查询安装默认的用户(一般有一个guest 用户和一个administrator管理员用户)
rabbitmqctl list_users
#其中admin 是用户名,123456是密码
rabbitmqctl add_user admin 123456
#通过命令给用户增加角色权限
rabbitmqctl set_user_tags admin administrator
#给用户增加所有访问权限
rabbitmqctl set_permissions -p "/" admin '.*' '.*' '.*'
番外篇:安装延迟队列
1、获取延迟队列插件
官方下载:https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases
文件:请查看本文档所携带的附件【rabbitmq_delayed_message_exchange-3.10.0.ez】
2、插件安装启用
#将文件上传至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
3、检查插件是否安装成功
登录至RabbitMQ的WEB管理后台,检查Exchanges-->Add a new exchange --> type是否有X-delayed-message选项
4. 附件:
插件百度云地址:
以上就是安装Centos7系统下的安装RabbitMQ3.10的全部教程.
Centos7系统下的安装RabbitMQ3.10,添加rabbitmq yum源,yum安装rabbitmq,启动rabbitmq
今天又有一个项目上线,总结下来已经是腾讯云的第5个项目, 某光K8s项目v8.3.9版本, 弃用k8s的Ingress. 因为腾讯云的clb按小时收费,而且费用相对而言比较高,
Minio是我们项目中经常用到的文件存储系统,今天项目升级,原本用cos的,现在改为minio,结果报错no path allowed in endpoint。瞬间我们都不知道怎么回事了,测试环境也大了一个minio的系统,用的很正常,怎么生产环境就出问题了呢?今天一起解决一下minio的问题no path allowed in endpoint,希望能解决。