关于服务器:RabbitMQ无法启动,TCP连接成功,但Erlang分发失败

RabbitMQ failed to start, TCP connection succeeded but Erlang distribution failed

我是一个新手,刚开始学习并在Windows System上安装RabbitMQ。

我将Erlang VM和RabbitMQ安装在自定义文件夹中,而不是默认文件夹中(两者都安装)。

然后,我重新启动了计算机。

顺便说一句,我的电脑名称是" NULL"

我进入RabbitMQ / sbin文件夹并使用命令:

rabbitmqctl status

但是返回的消息是:

Status of node rabbit@NULL ...

Error: unable to perform an operation on node 'rabbit@NULL'.
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@NULL

DIAGNOSTICS

attempted to contact: [rabbit@NULL]

rabbit@NULL:

  • connected to epmd (port 4369) on NULL
  • 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: rabbitmqcli70@NULL
  • effective user's home directory: C:\\Users\\Jerry Song
  • Erlang cookie hash: 51gvGHZpn0gIK86cfiS7vp==

我已经尝试重新启动RabbitMQ,我得到的是:

ERROR: node with name"rabbit" already running on"NULL"

By the way,My Computer name is"NULL"
And I have enable all ports in firewall.


如果您在Windows10中使用专用的驱动器文件夹作为开发工具/软件的位置(而不是Windows默认位置),则https://www.rabbitmq.com/cli.html所述的同步erlang cookie的一种方法是:如下所述复制cookie。

请注意,在我的情况下,HOMEDRIVE和HOMEPATH环境变量均未设置。

将" C:\ Windows \ system32 \ config \ systemprofile \ .erlang.cookie"复制到" C:\ Users \%USERNAME%\。erlang.cookie"之后,

解决了" tcp连接成功但Erlang分发失败"的错误。

现在,我可以成功使用" rabbitmqctl.bat status"命令。因此,无需强制将其安装在默认位置即可解决此错误,因为同步Cookie可以解决该错误。


https://groups.google.com/forum/#!topic/rabbitmq-users/a6sqrAUX_Fg
描述了在全新安装的Rabbit MQ上存在cookie不匹配的问题。 Windows上的简单解决方案是同步cookie

在此处也进行了描述:http://www.rabbitmq.com/clustering.html#erlang-cookie

确保Cookie在下面的1、2和3(可选)之间同步

  • 如果同时设置了HOMEDRIVE和HOMEPATH环境变量,则为%HOMEDRIVE%%HOMEPATH%\\.erlang.cookie(对于用户%USERNAME%,通常为C:\\Users\\%USERNAME%\\.erlang.cookie)

  • 如果未同时设置HOMEDRIVE和HOMEPATH,则为%USERPROFILE%\\.erlang.cookie(通常为C:\\Users\\%USERNAME%\\.erlang.cookie)

  • 对于RabbitMQ Windows服务-%USERPROFILE%\\.erlang.cookie(通常为C:\\WINDOWS\\system32\\config\\systemprofile)
  • Windows服务帐户和运行CLI工具的用户使用的cookie文件必须通过从C:\\WINDOWS\\system32\\config\\systemprofile文件夹中复制一个cookie文件进行同步。


    我已经通过使用默认设置文件夹将RabbitMQ重新安装在计算机中

    然后使用以下命令检查:

    rabbitmqctl status

    现在可以正常工作,而不是Erlang VM的问题。(意味着Er可以在其他文件夹中安装)

    如果我们不使用RabbitMQ默认设置,则将导致一些我现在无法发现的问题(如此问题)(C:\ Program Files \ rabbitMQ Server)

    如果有人发现了,希望您能告诉我原因以及如何解决。


    以我为例,该文件位于c:\\\\Windows\\.erlang.cookie,只需将其复制到C:\ Users {USERNAME}即可完成所有工作,这要归功于所有人的成功


    在Windows 10中使用默认安装文件夹安装Erlang VM和RabbitMQ之后,我遇到了相同的错误。设法启动管理并通过HTTP访问它,但状态因此错误而失败。

    在所有文件夹(%HOMEDRIVE%%HOMEPATH%%USERPROFILE%C:\\WINDOWS\\system32\\config\\systemprofile)中,该cookie均正常。

    我必须执行重新启动Windows才能使其正常工作。重新启动后,它设置了要在启动时运行的内容+要求在防火墙中进行例外处理的权限。


    只是增加我的经验,如果它可以帮助其他人。

    我编写了一个Powershell .ps1脚本来安装和配置RabbitMQ,它将用作为Packer设置服务器的步骤之一。

    我在新的AWS W2016 Server构建中编写了代码。当在盒子上运行时(以管理员身份,从admin PS控制台运行),它运行良好,但是当将相同的代码移到Packer构建服务器上时,通过packer执行Rabbitmqctl.bat配置步骤时,它会掉落,尽管两者都使用(据我所知)管理员运行脚本。

    因此,这适用于编码盒:

    1
    2
    3
    4
    5
    6
    7
    $pathvargs = {cmd.exe /c"rabbitmqctl.bat" add_user Username Password}
    Invoke-Command -ScriptBlock $pathvargs
    $pathvargs = {cmd.exe /c"rabbitmqctl.bat" set_user_tags User administrator}
    Invoke-Command -ScriptBlock $pathvargs
    $pathvargs = {cmd.exe /c"rabbitmqctl.bat" set_permissions -p"/" User"^User-.*"".*"".*"}
    Invoke-Command -ScriptBlock $pathvargs
    Write-Host"Did RabbitMQ"

    但是我必须以...作为前奏

    1
    2
    3
    4
    copy"C:\\Windows\\system32\\config\\systemprofile\\.erlang.cookie""C:\\Program Files\
    abbitMQ Server\
    abbitmq_server-3.7.17\\sbin\\.erlang.cookie"

    copy"C:\\Windows\\system32\\config\\systemprofile\\.erlang.cookie" $env:userprofile\\.erlang.cookie -force

    ...在Packer框上。

    我猜正在发生一些上下文问题,但是我正在使用

    1
    "winrm_username":      "Administrator",

    在Packer builders块中,所以我认为就足够了。

    TL; DR-使用Cookie,即使在某些情况下不使用它也可以使用。


    在Centos。

  • 将ip节点名对添加到每个节点上的/ etc / hosts中。

  • 在每个从节点上重新启动rabbitmq-server服务。

  • 为我工作。