如何在CentOS7部署RabbitMQ服务MQ全称为MessageQueue,消息队列(MQ)是一种应用程序对应用程序的通信方法。作者:王辉来源:Linux就该这么学|2016-12-2609:19收藏分享推广|令人窒息的奖品等你—2016最权威的全球开发者调研MQ全称为MessageQueue,消息队列(MQ)是一种应用程序对应用程序的通信方法。应用程序通过读写出入队列的消息(针对应用程序的数据)来通信,而无需专用连接来链接它们。消息传递指的是程序之间通过在消息中发送数据进行通信,而不是通过直接调用彼此来通信,直接调用通常是用于诸如远程过程调用的技术。排队指的是应用程序通过队列来通信。队列的使用除去了接收和发送应用程序同时执行的要求。其中较为成熟的MQ产品有IBMWEBSPHEREMQ等等。RabbitMQ简介安装RabbitMQ的消息代理软件,实现了AMQP(高级消息队列协议)RabbitMQ教程:安装:安装1.#InstallfromEPEL2.[root@vdevops~]#yum--enablerepo=epel-yinstallrabbitmq-server3.[root@vdevops~]#systemctlstartrabbitmq-server4.[root@vdevops/]#journalctl-xe5.Nov1201:30:01vdevops.orgCROND[3856]:(root)CMD(/usr/lib64/sa/sa111)6.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:DIAGNOSTICS7.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:===========8.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:attemptedtocontact:[rabbit@vdevops]9.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:rabbit@vdevops:10.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:*unabletoconnecttoepmd(port4369)onvdevops:timeout(timedout)11.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:currentnodedetails:12.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:-nodename:rabbitmqctl3831@vdevops13.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:-homedir:/var/lib/rabbitmq14.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:-cookiehash:s++dDMtIhAufFItw+ercBw==15.Nov1201:30:04vdevops.orgpolkitd[1007]:UnregisteredAuthenticationAgentforunix-process:3798:36632(systembusname:1.23,objectpath/org/freedesktop/PolicyKit1/AuthenticationAgent,localeen_US.UTF-8)(disconnectedf16.Nov1201:30:04vdevops.orgsystemd[1]:rabbitmq-server.service:controlprocessexited,code=exitedstatus=217.Nov1201:30:04vdevops.orgsystemd[1]:FailedtostartRabbitMQbroker.18.--Subject:Unitrabbitmq-server.servicehasfailed--Defined-By:systemd--Support::30:04vdevops.orgsystemd[1]:Unitrabbitmq-server.serviceenteredfailedstate.Nov1201:30:04vdevops.orgsystemd[1]:rabbitmq-server.servicefailed.Nov1201:30:42vdevops.orgsystemd[1]:Gotautomountrequestfor/proc/sys/fs/binfmt_misc,triggeredby3860(find)Nov1201:30:42vdevops.orgsystemd[1]:MountingArbitraryExecutableFileFormatsFileSystem...--Subject:Unitproc-sys-fs-binfmt_misc.mounthasbegunstart-up--Defined-By:systemd--Support::30:42vdevops.orgsystemd[1]:MountedArbitraryExecutableFileFormatsFileSystem.--Subject:Unitproc-sys-fs-binfmt_misc.mounthasfinishedstart-up--Defined-By:systemd--Support:启动报错:FailedtostartRabbitMQbroker度娘解析:主机hostname配置错误,原本hostname为vdevops.org,更改为vdevops,修改hosts文件中hostname设置1.#InstallfromEPEL2.[root@vdevops~]#yum--enablerepo=epel-yinstallrabbitmq-server3.[root@vdevops~]#systemctlstartrabbitmq-server4.[root@vdevops/]#journalctl-xe5.Nov1201:30:01vdevops.orgCROND[3856]:(root)CMD(/usr/lib64/sa/sa111)6.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:DIAGNOSTICS7.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:===========8.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:attemptedtocontact:[rabbit@vdevops]9.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:rabbit@vdevops:10.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:*unabletoconnecttoepmd(port4369)onvdevops:timeout(timedout)11.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:currentnodedetails:12.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:-nodename:rabbitmqctl3831@vdevops13.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:-homedir:/var/lib/rabbitmq14.Nov1201:30:04vdevops.orgrabbitmqctl[3831]:-cookiehash:s++dDMtIhAufFItw+ercBw==15.Nov1201:30:04vdevops.orgpolkitd[1007]:UnregisteredAuthenticationAgentforunix-process:3798:36632(systembusname:1.23,objectpath/org/freedesktop/PolicyKit1/AuthenticationAgent,localeen_US.UTF-8)(disconnectedf16.Nov1201:30:04vdevops.orgsystemd[1]:rabbitmq-server.service:controlprocessexited,code=exitedstatus=217.Nov1201:30:04vdevops.orgsystemd[1]:FailedtostartRabbitMQbroker.18.--Subject:Unitrabbitmq-server.servicehasfailed--Defined-By:systemd--Support::30:04vdevops.orgsystemd[1]:Unitrabbitmq-server.serviceenteredfailedstate.Nov1201:30:04vdevops.orgsystemd[1]:rabbitmq-server.servicefailed.Nov1201:30:42vdevops.orgsystemd[1]:Gotautomountrequestfor/proc/sys/fs/binfmt_misc,triggeredby3860(find)Nov1201:30:42vdevops.orgsystemd[1]:MountingArbitraryExecutableFileFormatsFileSystem...--Subject:Unitproc-sys-fs-binfmt_misc.mounthasbegunstart-up--Defined-By:systemd--Support::30:42vdevops.orgsystemd[1]:MountedArbitraryExecutableFileFormatsFileS