CentOS6.9下安装rabbitmq消息队列

时间:2021-10-25 23:40:25

安装如下步骤:

首先安装erlang

yum install erlang

安装rabbitmq rpm包

wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.5.0/rabbitmq-server-3.5.0-1.noarch.rpm
rpm -ivh rabbitmq-server-3.5.0-1.noarch.rpm

启动rabbitmq

service rabbitmq-server start

注:如果启动失败,报错如下:

CentOS6.9下安装rabbitmq消息队列

则修改hosts,添加hostname:

vi /etc/hosts

添加hostname:

CentOS6.9下安装rabbitmq消息队列

再次重启即可:

CentOS6.9下安装rabbitmq消息队列

打开5672端口

/sbin/iptables -I INPUT -p tcp --dport 5672 -j ACCEPT
/etc/rc.d/init.d/iptables save
/etc/init.d/iptables restart

CentOS6.9下安装rabbitmq消息队列

启用插件

rabbitmq-plugins enable rabbitmq_management

重启rabbitmq

service rabbitmq-server restart

web访问

CentOS6.9下安装rabbitmq消息队列

无法登录请使用如下:

vim /etc/rabbitmq/rabbitmq.config

写入如下信息并保存:

[{rabbit, [{loopback_users, []}]}].

CentOS6.9下安装rabbitmq消息队列

再重启:

CentOS6.9下安装rabbitmq消息队列

再次访问即可:

CentOS6.9下安装rabbitmq消息队列