CentOS 7.2下 RabbitMQ 安装记录

前端之家收集整理的这篇文章主要介绍了CentOS 7.2下 RabbitMQ 安装记录前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

为什么安装它?

这得说那坑爹的Intel® Collaboration Suite for WebRTC,按照官方参考安装之后无法启动,提示

# bin/start-all.sh
starting nuve,stdout -> /home/Release-v3.1/logs/woogeen-nuve.stdout

starting cluster-manager,stdout -> /home/Release-v3.1/logs/woogeen-cluster-manager.stdout
2016-09-12 10:28:30.091  - ERROR: AMQPER - Connection error... { [Error: connect ECONNREFUSED 127.0.0.1:5672]
  code: 'ECONNREFUSED',errno: 'ECONNREFUSED',syscall: 'connect',address: '127.0.0.1',port: 5672 }
Error: connect ECONNREFUSED 127.0.0.1:5672
    at Object.exports._errnoException (util.js:849:11)
    at exports._exceptionWithHostPort (util.js:872:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1060:14)
starting portal,stdout -> /home/Release-v3.1/logs/woogeen-portal.stdout
2016-09-12 10:28:31.429  - ERROR: AMQPER - Connection error... { [Error: connect ECONNREFUSED 127.0.0.1:5672]
  code: 'ECONNREFUSED',port: 5672 }
Error: connect ECONNREFUSED 127.0.0.1:5672
    at Object.exports._errnoException (util.js:849:11)
    at exports._exceptionWithHostPort (util.js:872:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1060:14)
starting webrtc-agent,stdout -> /home/Release-v3.1/logs/woogeen-webrtc-agent.stdout
2016-09-12 10:28:32.690  - ERROR: AMQPER - Connection error... { [Error: connect ECONNREFUSED 127.0.0.1:5672]
  code: 'ECONNREFUSED',port: 5672 }
Error: connect ECONNREFUSED 127.0.0.1:5672
    at Object.exports._errnoException (util.js:849:11)
    at exports._exceptionWithHostPort (util.js:872:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1060:14)
starting rtsp-agent,stdout -> /home/Release-v3.1/logs/woogeen-rtsp-agent.stdout
2016-09-12 10:28:33.750  - ERROR: AMQPER - Connection error... { [Error: connect ECONNREFUSED 127.0.0.1:5672]
  code: 'ECONNREFUSED',port: 5672 }
Error: connect ECONNREFUSED 127.0.0.1:5672
    at Object.exports._errnoException (util.js:849:11)
    at exports._exceptionWithHostPort (util.js:872:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1060:14)
starting recording-agent,stdout -> /home/Release-v3.1/logs/woogeen-recording-agent.stdout
2016-09-12 10:28:35.070  - ERROR: AMQPER - Connection error... { [Error: connect ECONNREFUSED 127.0.0.1:5672]
  code: 'ECONNREFUSED',port: 5672 }
Error: connect ECONNREFUSED 127.0.0.1:5672
    at Object.exports._errnoException (util.js:849:11)
    at exports._exceptionWithHostPort (util.js:872:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1060:14)
starting audio-agent,stdout -> /home/Release-v3.1/logs/woogeen-audio-agent.stdout
2016-09-12 10:28:36.379  - ERROR: AMQPER - Connection error... { [Error: connect ECONNREFUSED 127.0.0.1:5672]
  code: 'ECONNREFUSED',port: 5672 }
Error: connect ECONNREFUSED 127.0.0.1:5672
    at Object.exports._errnoException (util.js:849:11)
    at exports._exceptionWithHostPort (util.js:872:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1060:14)
starting video-agent,stdout -> /home/Release-v3.1/logs/woogeen-video-agent.stdout
2016-09-12 10:28:37.639  - ERROR: AMQPER - Connection error... { [Error: connect ECONNREFUSED 127.0.0.1:5672]
  code: 'ECONNREFUSED',port: 5672 }
Error: connect ECONNREFUSED 127.0.0.1:5672
    at Object.exports._errnoException (util.js:849:11)
    at exports._exceptionWithHostPort (util.js:872:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1060:14)
starting app,stdout -> /home/Release-v3.1/logs/woogeen-app.stdout
明明依赖RabbitMQ ,但在依赖项中没有列出,结果就跑不起来。

什么是MQ?

MQ全称为Message Queue,消息队列(MQ)是一种应用程序对应用程序的通信方法。应用程序通过读写出入队列的消息(针对应用程序的数据)来通信,而无需专用连接来链接它们。消息传递指的是程序之间通过在消息中发送数据进行通信,而不是通过直接调用彼此来通信,直接调用通常是用于诸如远程过程调用的技术。排队指的是应用程序通过 队列来通信。队列的使用除去了接收和发送应用程序同时执行的要求。

查看系统版本

# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core) 

安装 Erlang

yum install erlang

下载 rabbitmq

wget https://github.com/rabbitmq/rabbitmq-server/releases/download/rabbitmq_v3_6_5/rabbitmq-server-3.6.5-1.noarch.rpm
可能不容易下载成功,你可以使用其它下载工具来下载;

安装 rabbitmq

# rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
以上命令执行后没有任何输出,接着执行下面的安装命令:
# yum install rabbitmq-server-3.6.5-1.noarch.rpm
# yum install rabbitmq-server-3.6.5-1.noarch.rpm
已加载插件:fastestmirror,langpacks
正在检查 rabbitmq-server-3.6.5-1.noarch.rpm: rabbitmq-server-3.6.5-1.noarch
rabbitmq-server-3.6.5-1.noarch.rpm 将作为 rabbitmq-server-3.3.5-23.el7.noarch 的更新
正在解决依赖关系
--> 正在检查事务
---> 软件包 rabbitmq-server.noarch.0.3.3.5-23.el7 将被 升级
---> 软件包 rabbitmq-server.noarch.0.3.6.5-1 将被 更新
--> 正在处理依赖关系 socat,它被软件包 rabbitmq-server-3.6.5-1.noarch 需要
Loading mirror speeds from cached hostfile
 * base: mirrors.btte.net
 * epel: ftp.jaist.ac.jp
 * extras: mirrors.cn99.com
 * updates: mirrors.cn99.com
--> 正在检查事务
---> 软件包 socat.x86_64.0.1.7.2.2-5.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

===============================================================================================================================================================================================
 Package                                     架构                               版本                                         源                                                           大小
===============================================================================================================================================================================================
正在更新:
 rabbitmq-server                             noarch                             3.6.5-1                                      /rabbitmq-server-3.6.5-1.noarch                             5.9 M
为依赖而安装:
 socat                                       x86_64                             1.7.2.2-5.el7                                base                                                        255 k

事务概要
===============================================================================================================================================================================================
安装           ( 1 依赖软件包)
升级  1 软件包

总计:6.2 M
总下载量:255 k
Is this ok [y/d/N]: y
Downloading packages:
socat-1.7.2.2-5.el7.x86_64.rpm                                                                                                                                          | 255 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : socat-1.7.2.2-5.el7.x86_64                                                                                                                                                 1/3 
Redirecting to /bin/systemctl stop  rabbitmq-server.service
  正在更新    : rabbitmq-server-3.6.5-1.noarch                                                                                                                                             2/3 
  清理        : rabbitmq-server-3.3.5-23.el7.noarch                                                                                                                                        3/3 
  验证中      : socat-1.7.2.2-5.el7.x86_64                                                                                                                                                 1/3 
  验证中      : rabbitmq-server-3.6.5-1.noarch                                                                                                                                             2/3 
  验证中      : rabbitmq-server-3.3.5-23.el7.noarch                                                                                                                                        3/3 

作为依赖被安装:
  socat.x86_64 0:1.7.2.2-5.el7                                                                                                                                                                 

更新完毕:
  rabbitmq-server.noarch 0:3.6.5-1                                                                                       
完毕!

启动服务

rabbitmq 安装后默认不是以后台进程的方式启动的,要想使 rabbitmq 在系统启动时默认以后台进程的方式启动,请以管理员身份执行以下命令:
chkconfig rabbitmq-server on
管理员身份,启动或停止服务通常使用以下命令:
/sbin/service rabbitmq-server stop
/sbin/service rabbitmq-server start
你可能会遇到以下错误,点击链接查看解决方法

Failed to start LSB: Enable AMQP service provided by RabbitMQ broker

小结

参考官方帮助:http://www.rabbitmq.com/install-rpm.html

只要英语不是很烂,参考官方帮助安装起来还是很简单的!

===========文档信息============版权声明:非商用自由转载-保持署名-注明出处署名(BY) :testcs_dn(微wx笑)文章出处:[无知人生,记录点滴](http://blog.csdn.net/testcs_dn)

猜你在找的CentOS相关文章