安装 RabbitMQ – centos 6

 

1.安装Erlang环境

cd /usr/local/src/  
mkdir rabbitmq  
cd rabbitmq  
  
wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm  
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm  
  
rpm --import http://packages.erlang-solutions.com/rpm/erlang_solutions.asc  
  
sudo yum install erlang

2.安装RabbitMQ

上面都成功后 安装RabbitMQ

wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-3.6.1-1.noarch.rpm
rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
yum install rabbitmq-server-3.6.1-1.noarch.rpm

安装输出log如下:

Loaded plugins: security
Setting up Install Process
Examining rabbitmq-server-3.6.1-1.noarch.rpm: rabbitmq-server-3.6.1-1.noarch
Marking rabbitmq-server-3.6.1-1.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package rabbitmq-server.noarch 0:3.6.1-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================
 Package                    Arch              Version             Repository                                  Size
===================================================================================================================
Installing:
 rabbitmq-server            noarch            3.6.1-1             /rabbitmq-server-3.6.1-1.noarch            5.5 M

Transaction Summary
===================================================================================================================
Install       1 Package(s)

Total size: 5.5 M
Installed size: 5.5 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : rabbitmq-server-3.6.1-1.noarch                                                                  1/1 
  Verifying  : rabbitmq-server-3.6.1-1.noarch                                                                  1/1 

Installed:
  rabbitmq-server.noarch 0:3.6.1-1                                                                                 

Complete!

run the following command to allow SELinux to enable RabbitMQ service:

setsebool -P nis_enabled 1

开启端口,如果是本地测试,关掉iptables也可以

4369 (epmd), 25672 (Erlang distribution)
 5672, 5671 (AMQP 0-9-1 without and with TLS)
 15672 (if management plugin is enabled)
 61613, 61614 (if STOMP is enabled)
 1883, 8883 (if MQTT is enabled)

启动:

/etc/init.d/rabbitmq-server start

log如下:

[root@iZ942k2d5ezZ tools]# /etc/init.d/rabbitmq-server start
Starting rabbitmq-server: SUCCESS
rabbitmq-server.

加入浏览器界面:

rabbitmq-plugins enable rabbitmq_management
chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/

然后访问:

http://120.24.37.249:15672

就可以看到界面了:

RabbitMQ Management - Google Chrome_005

增加账户:

rabbitmqctl add_user mqadmin 123456
rabbitmqctl set_user_tags mqadmin administrator
rabbitmqctl set_permissions -p / mqadmin ".*" ".*" ".*"

 

上面的命令中

mqadmin就是登陆的账户

123456就是登陆的密码

然后就可以看到界面了,如下:

RabbitMQ Management

发表评论

电子邮件地址不会被公开。 必填项已用*标注