zoukankan      html  css  js  c++  java
  • RabbitMQ问题解决:TCP connection succeeded but Erlang distribution failed

    说明

    本来是要先把Hystrix 仪表盘更完的,但是出现了Turbine、Dashboard、RabbitMQ整合实现监控。

    所以先在学RabbitMq的基本操作,在安装过程中出现了

    E:RabbitMQ Server
    abbitmq_server-3.6.5sbin>rabbitmqctl status
    Status of node 'rabbit@DESKTOP-T5RBR6M' ...
    Error: unable to connect to node 'rabbit@DESKTOP-T5RBR6M': nodedown
    
    DIAGNOSTICS
    ===========
    
    attempted to contact: ['rabbit@DESKTOP-T5RBR6M']
    
    rabbit@DESKTOP-T5RBR6M:
      * connected to epmd (port 4369) on DESKTOP-T5RBR6M
      * epmd reports node 'rabbit' running on port 25672
      * TCP connection succeeded but Erlang distribution failed
      * suggestion: hostname mismatch?
      * suggestion: is the cookie set correctly?
      * suggestion: is the Erlang distribution using TLS?
    
    current node details:
    - node name: 'rabbitmq-cli-27@DESKTOP-T5RBR6M'
    - home dir: C:UsersAdministrator
    - cookie hash: +Xg8GwzCRQiqRrJZqqF30A==
    

    重点在TCP connection succeeded but Erlang distribution failedsuggestion: is the cookie set correctly?这两行,在网上看了两个小时了,发现很多都是不明所以弄成了就随便捊一下就写。。

    有一些现在没有suggestion的输出,这不是很重要,这里我先恢复事故现场,大家一起踩坑

    WorkArounds

    问题复现

    分别安装 Erlang (otp_win64_20.3.exe) 、RabbitMQ Server(rabbitmq-server-3.7.5.exe)

    这里为了能看清晰问题是出在安装目录上还是其它,都装到D盘,其他不变

    安装完成在菜单栏中会有这个显示,这里用win10演示(公司电脑)

    查看服务,服务已经正常启动

    cmd命令cd到D:RabbitMQ Server abbitmq_server-3.7.5sbin (你实际的安装位置)

    小提示:如果是默认的安装位置,用 可以直接定位到sbin下

    输入rabbitmqctl status

    D:RabbitMQ Server
    abbitmq_server-3.7.5sbin>rabbitmqctl status
    Status of node rabbit@DESKTOP-T5RBR6M ...
    Error: unable to perform an operation on node 'rabbit@DESKTOP-T5RBR6M'. 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 http://rabbitmq.com/documentation.html to learn more
     * Consult server logs on node rabbit@DESKTOP-T5RBR6M
    
    DIAGNOSTICS
    ===========
    
    attempted to contact: ['rabbit@DESKTOP-T5RBR6M']
    
    rabbit@DESKTOP-T5RBR6M:
      * connected to epmd (port 4369) on DESKTOP-T5RBR6M
      * epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic
      * TCP connection succeeded but Erlang distribution failed
    
      * Authentication failed (rejected by the remote node), please check the Erlang cookie
    
    
    Current node details:
     * node name: 'rabbitmqcli49@DESKTOP-T5RBR6M'
     * effective user's home directory: C:UsersAdministrator
     * Erlang cookie hash: joVCp1tjZbhK/nWhgoYyjQ==
    

    问题复现。

    Authentication failed (rejected by the remote node), please check the Erlang cookie是重点,说明cookie可能有问题。

    问题解决

    这里直接告诉大家问题出在哪吧,是Erlang新版本的cookie位置换了!

    两种解决办法:

    • 使用旧版本Erlang
    • cookie替换到正确的位置

    打开路径C:WindowsSystem32configsystemprofile

    我们看到了这里有一个.erlang.cookie,复制这个文件到C:Users你的用户名

    如果没有这个文件,请打开菜单栏的Erlang快捷方式,出现白色窗口的时候,C:WindowsSystem32configsystemprofile这个目录下就会出现这个文件,可能会慢一些耐心等

    要确保C:WindowsSystem32configsystemprofileC:Users你的用户名下的cookie是同一个文件!

    替换完成后,无需重启服务,直接rabbitmqctl status,如图这样就成功了。

    以上

  • 相关阅读:
    UVA 12901 Refraction 折射 (物理)
    UVA 12898
    UVA 690 PipelineScheduling 位运算+dfs+剪枝
    UVA1602 Lattice Animals 网格动物 (暴力,STL)
    UVA 810 A Dicey Promblem 筛子难题 (暴力BFS+状态处理)
    UVA 1600 Patrol Robert 巡逻机器人 (启发搜索BFS)
    UVA 536 TreeRocvery 树重建 (递归)
    二分查找
    OI记忆口诀
    OI经典语录
  • 原文地址:https://www.cnblogs.com/hellxz/p/9104028.html
Copyright © 2011-2022 走看看