CentOS 使用yum安装rabbitmq
在安装RabbitMQ之前,必须安装受支持的Erlang / OTP版本
centos7版本:在/etc/yum.repos.d/目录下新建编辑 rabbitmq-erlang.repo
[rabbitmq-erlang] name=rabbitmq-erlang baseurl=https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/22/el/7 gpgcheck=1 gpgkey=https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc repo_gpgcheck=0 enabled=1
然后执行 sudo yum install erlang 即可安装
执行 erl -version 查看erlang版本。
安装rabbitmq
wget https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.8.x/el/7/noarch/rabbitmq-server-3.8.14-1.el7.noarch.rpm
下载好想安装版本的rpm包,cd进入存放目录
导入签名
rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
安装
yum install rabbitmq-server-3.8.14-1.el8.noarch.rpm
安装成功后,就可以通过systemctl启动rabbitmq了
开机启动 sudo systemctl enable rabbitmq-server 重新启动 sudo systemctl restart rabbitmq-server 启动 sudo systemctl start rabbitmq-server 停止 sudo systemctl stop rabbitmq-server 启动插件 rabbitmq-plugins enable rabbitmq_management启动插件 systemctl restart rabbitmq-server重新启动 开放端口 firewall-cmd --zone=public --add-port=5672/tcp --permanent firewall-cmd --zone=public --add-port=15672/tcp --permanent firewall-cmd --reload firewall-cmd --list-ports 创建用户 :admin为用户名 123456是密码,更改为自己的 sudo rabbitmqctl add_user admin 123456 设置角色【administrator】 sudo rabbitmqctl set_user_tags admin administrator 设置权限 sudo rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"
重启
sudo systemctl start rabbitmq-server