【问题标题】:Orion does not notify Cygnus (timeout error)Orion 不通知 Cygnus(超时错误)
【发布时间】:2016-03-03 14:09:20
【问题描述】:

Orion 似乎无法到达 Cygnus,并发出以下警告(我已隐藏 IP):

WARNING@13:33:21  AlarmManager.cpp[303]: Raising alarm NotificationError Y.Y.Y.Y:5050/notify: (curl_easy_perform failed: Timeout was reached)

我首先创建了一个实体,然后进行了订阅,随后又更新了该实体。有关信息,以下是从 contextBroker 启动时的整个调试日志记录:

INFO@13:31:51  contextBroker.cpp[1808]: Startup completed
INFO@13:32:51  connectionOperations.cpp[626]: Database Operation Successful (command: { listDatabases: 1 })
INFO@13:32:51  connectionOperations.cpp[79]: Database Operation Successful (query: { conditions.type: "ONCHANGE" })
INFO@13:33:16  logMsg.h[1803]: Starting transaction from X.X.X.X:45738/v1/updateContext
INFO@13:33:16  connectionOperations.cpp[79]: Database Operation Successful (query: { _id.id: "1", _id.type: "auto", _id.servicePath: /^\/$/ })
INFO@13:33:16  connectionOperations.cpp[401]: Database Operation Successful (update: <{ _id.id: "1", _id.type: "auto", _id.servicePath: /\// }, { $set: { attrs.kenteken: { value: "TEST", type: "string", creDate: 1457009737, modDate: 1457011996 }, modDate: 1457011996 }, $unset: { location: 1 } }>)
INFO@13:33:16  logMsg.h[1803]: Starting transaction to Y.Y.Y.Y:5050/notify
INFO@13:33:16  logMsg.h[1887]: Transaction ended
INFO@13:33:20  logMsg.h[1803]: Starting transaction from X.X.X.X:45738/v1/subscribeContext
INFO@13:33:20  connectionOperations.cpp[153]: Database Operation Successful (query: { query: { $or: [ { _id.id: "1", _id.type: "auto" } ], _id.servicePath: { $in: [ null, /^$/, /^/.*/ ] }, attrNames: { $in: [ "kenteken", "timestamp" ] } }, orderby: { creDate: 1 } })
INFO@13:33:20  connectionOperations.cpp[153]: Database Operation Successful (query: { query: { $or: [ { _id.id: "1", _id.type: "auto" } ], _id.servicePath: { $in: [ null, /^$/, /^/.*/ ] } }, orderby: { creDate: 1 } })
INFO@13:33:20  logMsg.h[1803]: Starting transaction to Y.Y.Y.Y:5050/notify
INFO@13:33:20  connectionOperations.cpp[336]: Database Operation Successful (insert: { _id: ObjectId('56d83d2070c15b679240ebd6'), expiration: 1459604000, reference: "http://Y.Y.Y.Y:5050/notify", throttling: 1, servicePath: "/#", entities: [ { id: "1", type: "auto", isPattern: "false" } ], attrs: [ "kenteken", "timestamp" ], conditions: [ { type: "ONCHANGE", value: [ "kenteken" ] } ], expression: { q: "", geometry: "", coords: "", georel: "" }, lastNotification: 1457012000, count: 1, format: "JSON" })
INFO@13:33:20  logMsg.h[1887]: Transaction ended
WARNING@13:33:21  AlarmManager.cpp[303]: Raising alarm NotificationError Y.Y.Y.Y:5050/notify: (curl_easy_perform failed: Timeout was reached)
INFO@13:33:21  logMsg.h[1887]: Transaction ended
INFO@13:33:25  logMsg.h[1887]: Transaction ended
INFO@13:33:32  logMsg.h[1803]: Starting transaction from X.X.X.X:45738/v1/updateContext
INFO@13:33:32  connectionOperations.cpp[79]: Database Operation Successful (query: { _id.id: "1", _id.type: "auto", _id.servicePath: /^\/$/ })
INFO@13:33:32  connectionOperations.cpp[401]: Database Operation Successful (update: <{ _id.id: "1", _id.type: "auto", _id.servicePath: /\// }, { $set: { attrs.kenteken: { value: "93XBV4", type: "string", creDate: 1457009737, modDate: 1457012012 }, modDate: 1457012012 }, $unset: { location: 1 } }>)
INFO@13:33:32  logMsg.h[1803]: Starting transaction to Y.Y.Y.Y:5050/notify
INFO@13:33:32  logMsg.h[1887]: Transaction ended
INFO@13:33:32  logMsg.h[1803]: Starting transaction to Y.Y.Y.Y:5050/notify
INFO@13:33:37  logMsg.h[1887]: Transaction ended

超时的原因是什么?

注意:我可以看到在 MongoDB(Orion 的 dbhost)中创建的实体,因此假设请求是正确的。官方文档使用相同格式的事实证实了这一点。 Cygnus 也根据官方文档进行了配置,并且似乎可以正常工作(日志记录中没有错误,只是没有从 Orion 接收数据)。

【问题讨论】:

  • Y.Y.Y.Y虚拟机安全组的5050端口是否开放?该虚拟机中运行的防火墙是否阻止了该流量(通常,您可以运行iptables -F 进行快速测试以清除所有防火墙规则)?

标签: fiware-orion fiware-cygnus


【解决方案1】:

不确定此问题的原因,因为我需要有关 Y.Y.Y.Y 中的安全组配置的更多信息(如问题帖子的评论中所述)。

然而,这个问题最可能的原因是:

  • Cygnus 未在 Y.Y.Y.Y 主机中启动。
  • Cygnus 在 Y.Y.Y.Y 主机中启动,但在不同于 5050 的端口中
  • Y.Y.Y.Y 主机中的某些东西(例如防火墙或安全组)正在阻止传入的通知。
  • Orion 正在运行的主机中的某些东西(例如防火墙)阻止了传出的通知。
  • 还有其他一些网络问题导致了连接问题。

【讨论】:

    【解决方案2】:

    我也面临同样的问题,但使用 Orion -> Proton 通信。我的 Proton 实例没有收到 Orion 通知。

    由于我将 Docker 用于 Orion 和 Proton,因此我解决了在订阅中插入 Proton docker IP 的问题。

    使用sudo docker network inspect bridge 查找您的容器 docker IP。我的 Proton 容器 IP 是 172.17.0.4

    然后,当您订阅上下文时,在 contextSubscription 有效负载中使用该 IP。就我而言,它是"reference": "http://172.17.0.4:8080/ProtonOnWebServer/rest/events",

    在您的情况下,使用 Cygnus,应该类似于 "reference": "http://&lt;cygnus_docker_ip&gt;:5050/notify",

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多