为了完整模拟RabbitMQ安装的从无到有,本次安装使用了VMware克隆了一个初始状态下的CentOS7镜像,下面介绍一下安装前的准备工作
[root@Jiavg /]# mkdir -p /usr/local/software/
[root@Jiavg /]# cd /usr/local/software/
[root@Jiavg software]#
下载erlang和rabbitmq-server的rpm:
[root@Jiavg software]#wget http://www.rabbitmq.com/releases/erlang/erlang-19.0.4-1.el7.centos.x86_64.rpm
[root@Jiavg software]#wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-3.6.6-1.el7.noarch.rpm
验证文件是否下载成功
[root@Jiavg software]# ls
erlang-19.0.4-1.el7.centos.x86_64.rpm rabbitmq-server-3.6.6-1.el7.noarch.rpm
安装erlang
[root@Jiavg software]#rpm -ivh erlang-19.0.4-1.el7.centos.x86_64.rpm
验证erlang是否安装成功
[root@Jiavg software]# erl
Erlang/OTP 19 [erts-8.0.3] [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V8.0.3 (abort with ^G)
1>
安装socat(安装RabbitMQ需要此命令进行密匙校验)
[root@Jiavg software]# yum install socat
如果不安装socat,则会出现以下情况:
[root@Jiavg software]# rpm -ivh rabbitmq-server-3.6.6-1.el7.noarch.rpm
警告:rabbitmq-server-3.6.6-1.el7.noarch.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID 6026dfca: NOKEY
错误:依赖检测失败:
socat 被 rabbitmq-server-3.6.6-1.el7.noarch 需要
安装RabbitMQ
[root@Jiavg software]# rpm -ivh rabbitmq-server-3.6.6-1.el7.noarch.rpm
警告:rabbitmq-server-3.6.6-1.el7.noarch.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID 6026dfca: NOKEY
准备中… ################################# [100%]
正在升级/安装…
1:rabbitmq-server-3.6.6-1.el7 ################################# [100%]
进入RabbitMQ配置文件目录
[root@Jiavg ebin]# cd /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.6/ebin/
修改rabbit.app文件
[root@Jiavg ebin]#vim rabbit.app
在vim中使用/loopback定位需要修改的文件位置
/loopback
文件被定位到
{loopback_users, [<<“guest”>>]},
修改为
{loopback_users, [guest]},
即:删除<<“和”>>
保存并退出
RabbitMQ的rabbitmq_management插件可以通过浏览器的可视化界面来管理RabbitMQ
启动RabbitMQ
[root@Jiavg ebin]# rabbitmq-server start &
[1] 9843
[root@Jiavg ebin]#
RabbitMQ 3.6.6. Copyright (C) 2007-2016 Pivotal Software, Inc.
## ## Licensed under the MPL. See http://www.rabbitmq.com/
## ##
########## Logs: /var/log/rabbitmq/[email protected]
###### ## /var/log/rabbitmq/[email protected]
##########
Starting broker...
查看本地可用插件
[root@Jiavg ebin]# rabbitmq-plugins list
Configured: E = explicitly enabled; e = implicitly enabled
| Status: [failed to contact rabbit@Jiavg - status not shown]
|/
[ ] amqp_client 3.6.6
[ ] cowboy 1.0.3
[ ] cowlib 1.0.1
[ ] mochiweb 2.13.1
[ ] rabbitmq_amqp1_0 3.6.6
[ ] rabbitmq_auth_backend_ldap 3.6.6
[ ] rabbitmq_auth_mechanism_ssl 3.6.6
[ ] rabbitmq_consistent_hash_exchange 3.6.6
[ ] rabbitmq_event_exchange 3.6.6
[ ] rabbitmq_federation 3.6.6
[ ] rabbitmq_federation_management 3.6.6
[ ] rabbitmq_jms_topic_exchange 3.6.6
[ ] rabbitmq_management 3.6.6
[ ] rabbitmq_management_agent 3.6.6
[ ] rabbitmq_management_visualiser 3.6.6
[ ] rabbitmq_mqtt 3.6.6
[ ] rabbitmq_recent_history_exchange 1.2.1
[ ] rabbitmq_sharding 0.1.0
[ ] rabbitmq_shovel 3.6.6
[ ] rabbitmq_shovel_management 3.6.6
[ ] rabbitmq_stomp 3.6.6
[ ] rabbitmq_top 3.6.6
[ ] rabbitmq_tracing 3.6.6
[ ] rabbitmq_trust_store 3.6.6
[ ] rabbitmq_web_dispatch 3.6.6
[ ] rabbitmq_web_stomp 3.6.6
[ ] rabbitmq_web_stomp_examples 3.6.6
[ ] sockjs 0.3.4
[ ] webmachine 1.10.3
安装rabbitmq_management插件
[root@Jiavg ebin]# rabbitmq-plugins enable rabbitmq_management
使用浏览器访问 IP地址:15672
把IP地址替换为你的RabbitMQ安装的主机IP
注意:如果不能正常访问,可能是防火墙问题
此时需要开启15672端口的访问权限
在对应的输入框输入如下
Username:guest
Password:guest
即:用户名和密码都是guest,这是RabbitMQ默认的账号和密码
此时,RabbitMQ已经安装完成.