码迷,mamicode.com
首页 > 其他好文 > 详细

rabbitmq3.6.6安装,环境centos7

时间:2017-02-27 17:31:54      阅读:1333      评论:0      收藏:0      [点我收藏+]

标签:release   failed   mqc   tags   attempted   cli   登录   man   文件   

环境:centos7
附上安装脚本 ,附上官网地址 http://www.rabbitmq.com/ ,从这上面可以下载rabbitmq-server-3.6.6-1.el7.noarch.rpm包
#/bin/bash 
SRC_URI="https://github.com/rabbitmq/rabbitmq-server/releases/download/rabbitmq_v3_6_6/rabbitmq-server-3.6.6-1.el7.noarch.rpm"
PKG_NAME=`basename $SRC_URI`
DIR=`pwd`
DATE=`date +%Y%m%d%H%M%S`
 
yum install -y erlang.x86_64
yum install -y socat.x86_64
 
if [ ! -s $PKG_NAME ]; then
wget -c $SRC_URI
fi
rpm -ivh rabbitmq-server-3.6.6-1.el7.noarch.rpm
 
service rabbitmq-server start #启动
rabbitmqctl add_user admin adminpasswd #设置密码
rabbitmqctl set_user_tags admin administrator
rabbitmq-plugins enable rabbitmq_management
 
if ! cat /etc/rc.d/rc.local | grep ‘service rabbitmq-server start‘ &> /dev/null;then
echo "service rabbitmq-server start" >> /etc/rc.d/rc.local
fi #加入开机启动
chmod +x /etc/rc.d/rc.local  #centos7里面默认这个文件没有执行权限
 
 
访问rabbitmq的网址ip:15672
 
可以网页了,进行登录,大功告成!
 
问题:
rabbitmq启动报错
Feb 20 18:30:09 test rabbitmqctl[822]: attempted to contact: [rabbit@test]
Feb 20 18:30:09 test rabbitmqctl[822]: rabbit@test:
Feb 20 18:30:09 test rabbitmqctl[822]: * unable to connect to epmd (port 4369) on test: address (cannot connect to host/port)
Feb 20 18:30:09 test rabbitmqctl[822]: current node details:
Feb 20 18:30:09 test rabbitmqctl[822]: - node name: ‘rabbitmq-cli-76@test‘
Feb 20 18:30:09 test rabbitmqctl[822]: - home dir: .
Feb 20 18:30:09 test rabbitmqctl[822]: - cookie hash:xxxxxxxxxxxxx==
Feb 20 18:30:09 test systemd[1]: Failed to start RabbitMQ broker.
Feb 20 18:30:09 test systemd[1]: Unit rabbitmq-server.service entered failed state.
Feb 20 18:30:09 test systemd[1]: rabbitmq-server.service failed.
解决:
在/etc/hosts里添加主机名解析
 运行如下命令即可
sed -i s/"127.0.0.1 localhost"/"127.0.0.1 localhost `hostname`"/g /etc/hosts  #解释:将/etc/hosts 里的127.0.0.1 localhos字段替换成127.0.0.1 localhost `本机主机名`
 
附上centos7查看所有已启动的服务的命令
systemctl list-units --type=service
 

rabbitmq3.6.6安装,环境centos7

标签:release   failed   mqc   tags   attempted   cli   登录   man   文件   

原文地址:http://www.cnblogs.com/echo-valley/p/6475384.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!