1.安装rabbitmq
【摘要】 前言
本文介绍如何安装rabbitmq,安装版本为写该文章时的稳定最新版。
安装步骤
安装erlang
CentOS 7中安装Erlang 20.x,新建文件/etc/yum.repos.d/rabbitmq-erlang.repo:
# In /etc/yum.repos.d/rabbitmq-erlang.repo
[rabbitmq-erlang]
name=rabb...
前言
本文介绍如何安装rabbitmq,安装版本为写该文章时的稳定最新版。
安装步骤
安装erlang
- CentOS 7中安装Erlang 20.x,新建文件
/etc/yum.repos.d/rabbitmq-erlang.repo
:
# In /etc/yum.repos.d/rabbitmq-erlang.repo
[rabbitmq-erlang]
name=rabbitmq-erlang
baseurl=https://dl.bintray.com/rabbitmq/rpm/erlang/20/el/7
gpgcheck=1
gpgkey=https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
repo_gpgcheck=0
enabled=1
- CentOS 6中安装Erlang 20.x ,新建文件
/etc/yum.repos.d/rabbitmq-erlang.repo
:
# In /etc/yum.repos.d/rabbitmq-erlang.repo
[rabbitmq-erlang]
name=rabbitmq-erlang
baseurl=https://dl.bintray.com/rabbitmq/rpm/erlang/20/el/6
gpgcheck=1
gpgkey=https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
repo_gpgcheck=0
enabled=1
- 安装erlang,并验证是否安装成功
yum install erlang
erl # 验证是否安装成功
注: 参考https://github.com/rabbitmq/erlang-rpm
安装rabbitmq-server
- 下载rabbitmq-server(如果没安装wget可以通过
yum install -y wget
安装该软件)
wget https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.6/rabbitmq-server-3.7.6-1.el7.noarch.rpm
- 安装并启动
yum -y install socat
rpm -ivh rabbitmq-server-3.7.6-1.el7.noarch.rpm
service rabbitmq-server start # centos 6执行该命令
systemctl start rabbitmq-server.service # centos 7执行该命令
- 执行开机启动
chkconfig rabbitmq-server on # centos 6执行该命令
systemctl enable rabbitmq-server.service # centos 7执行该命令
- 编辑配置文件允许guest用户登录(注意后面逗号)
cd /etc/rabbitmq/
cp /usr/share/doc/rabbitmq-server-3.7.6/rabbitmq.config.example /etc/rabbitmq/
mv rabbitmq.config.example rabbitmq.config
- 开启web页面管理工具
[root@bogon rabbitmq]# rabbitmq-plugins enable rabbitmq_management
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
Applying plugin configuration to rabbit@bogon...
The following plugins have been enabled:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
started 3 plugins.
- 重启rabbitmq
service rabbitmq-server restart # centos 6执行该命令
systemctl restart rabbitmq-server.service # centos 7执行该命令
-
开启防火墙
- centos 6
iptables -I INPUT -p tcp --dport 15675 -j ACCEPT iptables -I INPUT -p tcp --dport 5672 -j ACCEPT service iptables
- centos 7
firewall-cmd --zone=public --add-port=15672/tcp --permanent firewall-cmd --zone=public --add-port=5672/tcp --permanent firewall-cmd --reload
网页访问,验证mq安装成功
http://192.168.1.249:15672
name: guest
name: guest
补充说明
centos 6 命令
service rabbitmq-server start
service rabbitmq-server stop
service rabbitmq-server restartcentos 7 命令
systemctl start rabbitmq-server.service
systemctl stop rabbitmq-server.service
systemctl restart rabbitmq-server.service
文章来源: www.jianshu.com,作者:Nick_4438,版权归原作者所有,如需转载,请联系作者。
原文链接:www.jianshu.com/p/06cd9e37a268
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)