【问题标题】:Hono adapters cannot connect to enmasseHono 适配器无法连接到 enmasse
【发布时间】:2019-01-07 12:40:37
【问题描述】:

我目前正在 openshift/okd 上安装 hono 和 enmasse。除了适配器和 enmasse 之间的连接外,一切都很好。例如,当我部署 amqp 适配器时(也发生在 http 和 mqtt 适配器上),我从 hono 适配器获得以下日志记录:

12:25:45.404 [vert.x-eventloop-thread-0] DEBUG o.e.hono.client.impl.HonoClientImpl - starting attempt [#5] to connect to server [messaging-hono-default.enmasse-infra.svc:5672]
12:25:45.404 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.ConnectionFactoryImpl - connecting to AMQP 1.0 container [amqp://messaging-hono-default.enmasse-infra.svc:5672]
12:25:47.720 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.ConnectionFactoryImpl - can't connect to AMQP 1.0 container [amqp://messaging-hono-default.enmasse-infra.svc:5672]: connection timed out: messaging-hono-default.enmasse-infra.svc.cluster.local/172.30.83.158:5672
12:25:47.720 [vert.x-eventloop-thread-0] DEBUG o.e.hono.client.impl.HonoClientImpl - connection attempt failed
io.netty.channel.ConnectTimeoutException: connection timed out: messaging-hono-default.enmasse-infra.svc.cluster.local/172.30.83.158:5672
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:267)
    at io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38)
    at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:125)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)
12:25:47.720 [vert.x-eventloop-thread-0] DEBUG o.e.h.c.impl.ConnectionFactoryImpl - can't connect to AMQP 1.0 container [amqp://messaging-hono-default.enmasse-infra.svc:5672]: connection timed out: messaging-hono-default.enmasse-infra.svc.cluster.local/172.30.83.158:5672
12:25:47.720 [vert.x-eventloop-thread-0] DEBUG o.e.hono.client.impl.HonoClientImpl - connection attempt failed
io.netty.channel.ConnectTimeoutException: connection timed out: messaging-hono-default.enmasse-infra.svc.cluster.local/172.30.83.158:5672
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:267)
    at io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38)
    at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:125)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)

收集以下日志:

2019-01-07 12:36:24.962160 +0000 SERVER (info) [160]: Accepted connection to 0.0.0.0:5672 from 10.128.0.1:44664
2019-01-07 12:36:24.962258 +0000 SERVER (info) [160]: Connection from 10.128.0.1:44664 (to 0.0.0.0:5672) failed: amqp:connection:framing-error No valid protocol header found

附加信息:

  • Hono 版本:0.8.x
  • Enmasse 版本:0.24.1

谁能告诉我我错过了什么?
谢谢! PS:如果有足够声誉的人可以添加一个新的“enmasse”标签,那就太好了。

【问题讨论】:

  • 您是否一直按照 Hono 网站上的说明部署到 OpenShift/enMasse?如那里所示,它是否适用于 enMasse 0.20.0?
  • 我已按照eclipse.org/hono/deployment/openshift_s2i 上的说明进行操作。我一直在使用 enmasse 0.24.0 进行测试(如网站上所示)。您能否提供提到使用 0.20.0 的链接?

标签: openshift okd eclipse-hono


【解决方案1】:

我已经找到了解决这个问题的方法。
首先:帧错误不是来自hono的传入连接。我已经在安装 enmasse 而没有安装 hono 的情况下看到了这个日志记录。我不知道他们从哪里来。如果有人有想法,请告诉我。
至于真正的问题:似乎我需要允许两个项目(enmasse-infra 和 hono)之间的通信。这记录在 Openshift documentation
TLDR

  • 使用的解决方案:oc adm pod-network make-projects-global enmasse-infra。我之所以使用这个,是因为所有项目(包括 hono 以及同上以及我们的自定义后端应用程序)都需要访问 enmasse 框架。
  • 应该也可以工作(未经测试):oc adm pod-network join-projects --to=enmasse-infra hono

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-22
    • 1970-01-01
    • 1970-01-01
    • 2012-02-23
    • 1970-01-01
    相关资源
    最近更新 更多