centos 安装 rabbitmq-server 笔记

环境:centos Linux service.linxk.lan 3.10.0-862.14.4.el7.x86_64

安装包:

curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
yum install erlang.x86_64

curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash

yum install rabbitmq-server   (3.7.14版本)

启动方法:

1, systemctl start rabbitmq-server

2,service rabbitmq-server start

3,  /usr/lib/rabbitmq/bin/rabbitmq-server start 

 

安装好启动之后发现 执行: rabbitmqctl-status 

报错:

Status of node rabbit@service ...
Error: unable to perform an operation on node 'rabbit@service'. Please see diagnostics information and suggestions below.

Most common reasons for this are:

 * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
 * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
 * Target node is not running

In addition to the diagnostics info below:

 * See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
 * Consult server logs on node rabbit@service
 * If target node is configured to use long node names, don't forget to use --longnames with CLI tools

DIAGNOSTICS
===========

attempted to contact: [rabbit@service]

rabbit@service:
  * connected to epmd (port 4369) on service
  * epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic 
  * can't establish TCP connection to the target node, reason: timeout (timed out)
  * suggestion: check if host 'service' resolves, is reachable and ports 25672, 4369 are not blocked by firewall

Current node details:
 * node name: 'rabbitmqcli-3378-rabbit@service'
 * effective user's home directory: /var/lib/rabbitmq
 * Erlang cookie hash: 6y0V31QE7e3kp972ErQd/w==

 

Error: unable to perform an operation on node 'rabbit@service'. Please see diagnostics information and suggestions below. 

没有rabbit@service节点, server就是本机的hostname

解决方法:

在/etc/hosts 中 添加

127.0.0.1 server

在次执行  rabbitmqctl-status 

正常显示

Status of node rabbit@service ...
[{pid,1034},
 {running_applications,
     [{rabbitmq_management,"RabbitMQ Management Console","3.7.14"},
      {rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.7.14"},
      {rabbitmq_management_agent,"RabbitMQ Management Agent","3.7.14"},
      {rabbit,"RabbitMQ","3.7.14"},
      {sysmon_handler,"Rate-limiting system_monitor event handler","1.1.0"},
      {os_mon,"CPO  CXC 138 46","2.4.7"},

 .....

 

开启web管理命令:rabbitmq-plugins enable rabbitmq_management

执行此命令后, 需重启rabbitmq-server

 

服务系统有个默认的guest账号, 但是只能在本机访问,因此最好在命令好增加一个账号

rabbitmqctl add_user username userpasswd     # 添加账号密码

rabbitmqctl set_user_tags  username administrator  #把账号加入到高级管理

 

到此就可以用创建的账号密码登录rabbitmq web了!

 

web 端的配置, 可查看此链接:

https://www.jianshu.com/p/7b6e575fd451

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值