【发布时间】:2018-09-28 20:08:33
【问题描述】:
尝试在 FIWARE Orion 上创建订阅以通知 Cygnus 实例。但无论我尝试什么,我都会以订阅状态失败。
主要问题似乎是我用于通知的 Cygnus URL,但 Cygnus 已启动并运行没有任何问题,并且此问题仍然存在。
FIWARE Orion 版本:
"orion" : {
"version" : "1.15.0-next",
"uptime" : "0 d, 0 h, 24 m, 24 s",
"git_hash" : "9cf2ea8243e4757a52c9019d197112abcf715dbe",
"compile_time" : "Mon Sep 24 08:22:30 UTC 2018",
"compiled_by" : "root",
"compiled_in" : "ea5d2e530912",
"release_date" : "Mon Sep 24 08:22:30 UTC 2018",
"doc" : "https://fiware-orion.readthedocs.org/en/master/"
}
FIWARE Cygnus 版本:
version 1.9.0_SNAPSHOT.887d615a9dfc2c09c99e511f8cefb148aa54809e
FIWARE Orion 错误日志:
time=Thursday 27 Sep 13:33:09 2018.712Z | lvl=WARN | corr=N/A |
trans=1538055058-177-00000000002 | from=pending | srv=pending |
subsrv=pending | comp=Orion |
op=AlarmManager.cpp[328]:notificationError | msg=Raising alarm
NotificationError http://172.20.0.2:5050/notify: (curl_easy_perform
failed: Timeout was reached)
订阅正文:
{
"description": "A subscription to get info about Room entity",
"subject": {
"entities": [
{
"idPattern": ".*",
"type": "Room"
}
],
"condition": {
"attrs": [
]
}
},
"notification": {
"http": {
"url": "http://172.20.0.2:5050/notify"
},
"attrs": [
]
},
"expires": "2040-01-01T14:00:00.00Z",
"throttling": 5
}
我发现了很多类似的问题,他们都指出 Cygnus 的 url 问题,因为它是作为 docker 容器运行的。 但是您可以在日志和示例中看到我使用容器的 IP 地址(不是 localhost 等),并且问题是不变的。
我在这里错过了什么,因为与订阅创建没有太大关系,它看起来很简单,但仍然所有订阅都以失败作为我上面描述的状态和问题返回。
谢谢。
【问题讨论】:
-
我同意@fgalan 的观点,认为这可能是连接问题。创建 cygnus 订阅时,对于 URL 字段,请尝试使用 cygnus 容器的 IP docker。如果两个容器都在同一个 docker 网络中,这应该可以工作。否则,请尝试使用 IP 172.17.0.1,它是 Docker 和主机之间的网关,但首先确保您已经映射了 docker 容器为每个服务公开的端口 (see here)。在这种情况下,它将是 cygnus 的端口 5050。
标签: docker fiware fiware-orion docker-networking fiware-cygnus