【问题标题】:Connecting to RabbitMQ via hostname/ip (using NServiceBus)通过主机名/IP 连接到 RabbitMQ(使用 NServiceBus)
【发布时间】:2016-04-04 18:40:14
【问题描述】:

我使用 NServiceBus (5.x) 和 RabbitMQ (3.6) 作为传输。此连接字符串有效:

 <connectionStrings>
<add name="NServiceBus/Transport"
     connectionString="host=localhost;username=****;password=***;RequestedHeartbeat=600;"/>
</connectionStrings>

但在同一台服务器上(安装了 RabbitMQ 服务器),使用主机名或 IP 不起作用:

 <connectionStrings>
<add name="NServiceBus/Transport"
     connectionString="host=myServerPC;username=****;password=***;RequestedHeartbeat=600;"/>
</connectionStrings>

我收到此错误:

2016-04-04 14:37:45.370 ERROR NServiceBus.Transports.RabbitMQ.RabbitMqConnectionManager Failed to connect to Broker: 'myServerPC', Port: 5672 VHost: '/'. ExceptionMessage: 'None of the specified endpoints were reachable'

我尝试了以下方法:

  1. 创建了我自己的管理员用户(不是来宾)并通过登录 RabbitMQ 管理 UI 对其进行了验证。也可以在远程机器上工作。全部使用 myServerPC。
  2. 使用 Service Insight 为 NServicebus 安装许可证 -> 注册。

谢谢!

【问题讨论】:

    标签: rabbitmq connection-string nservicebus


    【解决方案1】:

    这很可能是因为您的 RabbitMq 实例仅侦听 localhost。检查RABBITMQ_NODE_IP_ADDRESS 的配置,它应该是空的或者还包含您的主机外部IP 地址。如果是127.0.0.1localhost,则只能使用你的环回地址连接RabbitMq。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-21
      • 1970-01-01
      • 2017-11-07
      • 2021-03-17
      • 2021-01-19
      • 1970-01-01
      • 1970-01-01
      • 2017-06-01
      相关资源
      最近更新 更多