ContextBroker 订阅错误

2023-12-28

我已按照本教程安装 NGSI,将 cygnus 从版本 0.13 更新到 1.7.0:

https://github.com/telefonicaid/fiware-cygnus/tree/master/cygnus-ngsi https://github.com/telefonicaid/fiware-cygnus/tree/master/cygnus-ngsi

订阅出错

    [
        {
            "id": "59d38a92dbaa1e477aef9c00",
            "description": "A subscription to get info about pruebas",
            "status": "failed",
            "subject": {
                "entities": [
                    {
                        "id": "pruebas",
                        "type": "pruebas"
                    }
                ],
                "condition": {
                    "attrs": [
                        "pressure"
                    ]
                }
            },
            "notification": {
                "timesSent": 2,
                "lastNotification": "2017-10-03T13:03:43.00Z",
                "attrs": [
                    "temperature",
                    "pressure"
                ],
                "attrsFormat": "legacy",
                "http": {
                    "url": "http://localhost:5050/notify"
                },
                "lastFailure": "2017-10-03T13:03:43.00Z"
            }
        }
]

查看 contextBroker 日志会显示以下内容:

$pp[328]:notificationError | msg=Raising alarm NotificationError http://localhost:5050/notify: (curl_easy_perform failed: Couldn't connect to server)

我有 contextBroker 与 cygnus 在同一台机器上,所以我已经尝试更改服务器和本地主机的通知 ip,但它对任何一个都不起作用。

如果它适用于 localhost,则使用版本 0.13。

可能是什么问题呢?

它甚至不会访问 cygnus 配置文件,因为它无法从 contextBroker 访问。

问候并谢谢你。

EDIT1:

我使用 fiwareLab 机器进行了测试,并删除了使用 YUM REMOVE CYGNUS 预安装的 cygnus 0.13。然后我用 YUM INSTALL CYGNUS-NGSI 安装了 1.7,并安装了两个包 ngsi 和 common。

使用 service cygnus restart 重新启动服务表明以下内容:

Dependencies Resolved

================================================================================
 Package              Arch          Version                 Repository     Size
================================================================================
Installing:
 cygnus-ngsi          x86_64        1.7.1-0.g9df0d4d        fiware         74 M
Installing for dependencies:
 cygnus-common        x86_64        1.7.1-0.g9df0d4d        fiware        128 M

Transaction Summary
================================================================================
Install       2 Package(s)

Total size: 202 M
Installed size: 223 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
[INFO] Creating cygnus user
  Installing : cygnus-common-1.7.1-0.g9df0d4d.x86_64                        1/2
[INFO] Creating log directory
Done
  Installing : cygnus-ngsi-1.7.1-0.g9df0d4d.x86_64                          2/2
  Verifying  : cygnus-common-1.7.1-0.g9df0d4d.x86_64                        1/2
  Verifying  : cygnus-ngsi-1.7.1-0.g9df0d4d.x86_64                          2/2

Installed:
  cygnus-ngsi.x86_64 0:1.7.1-0.g9df0d4d

Dependency Installed:
  cygnus-common.x86_64 0:1.7.1-0.g9df0d4d

Complete!
[centos@centos6 cygnus]$ sudo service cygnus restart
There aren't any instance of Cygnus  running               [  OK  ]
Starting Cygnus 1...                                       [  OK  ]

当我在我的服务器上尝试时,我执行相同的步骤,但是在执行服务 cygnus restart 时,有两个 cygnus,即 1 和 2,而不是像 vuesta 机器中只有一个,因此表明端口 8081 已在使用中。

Dependencias resueltas

============================================================================================================================================================================
 Paquete                                     Arquitectura                         Versión                                        Repositorio                          Tamaño
============================================================================================================================================================================
Instalando:
 cygnus-ngsi                                 x86_64                               1.7.1-0.g9df0d4d                               fiware                                74 M
Instalando para las dependencias:
 cygnus-common                               x86_64                               1.7.1-0.g9df0d4d                               fiware                               128 M

Resumen de la transacción
============================================================================================================================================================================
Instalar       2 Paquete(s)

Tamaño total de la descarga: 202 M
Tamaño instalado: 223 M
Está de acuerdo [s/N]:s
Descargando paquetes:
(1/2): cygnus-common_hadoopcore_1.2.1-1.7.1-0.g9df0d4d.x86_64.rpm                                                                                    | 128 MB     00:14     
(2/2): cygnus-ngsi-1.7.1-0.g9df0d4d.x86_64.rpm                                                                                                       |  74 MB     00:07     
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                       8.9 MB/s | 202 MB     00:22     
Ejecutando el rpm_check_debug
Ejecutando prueba de transacción
La prueba de transacción ha sido exitosa
Ejecutando transacción
[INFO] Creating cygnus user
  Instalando    : cygnus-common-1.7.1-0.g9df0d4d.x86_64                                                                                                                 1/2 
[INFO] Creating log directory
Done
  Instalando    : cygnus-ngsi-1.7.1-0.g9df0d4d.x86_64                                                                                                                   2/2 
  Verifying     : cygnus-common-1.7.1-0.g9df0d4d.x86_64                                                                                                                 1/2 
  Verifying     : cygnus-ngsi-1.7.1-0.g9df0d4d.x86_64                                                                                                                   2/2 

Instalado:
  cygnus-ngsi.x86_64 0:1.7.1-0.g9df0d4d                                                                                                                                     

Dependencia(s) instalada(s):
  cygnus-common.x86_64 0:1.7.1-0.g9df0d4d                                                                                                                                   

¡Listo!


[root@UAL-IoF2020 conf]# ls
agent_1.conf         agent_ngsi.conf.template    cygnus_instance_2.conf         grouping_rules_2.conf         krb5_login.conf              README-cygnus-common.md
agent_3.conf         cartodb_keys.conf.template  cygnus_instance.conf.template  grouping_rules.conf.template  log4j.properties             README-cygnus-ngsi.md
agent.conf.template  cygnus_instance_1.conf      flume-env.sh.template          krb5.conf.template            name_mappings.conf.template
[root@UAL-IoF2020 conf]# service cygnus restart
There aren't any instance of Cygnus  running               [  OK  ]
Starting Cygnus 1...                                       [  OK  ]
Starting Cygnus 2...                                       [  OK  ]
[root@UAL-IoF2020 conf]# 

是否有可能这就是问题所在,并且无法识别我的 NGSI 并且占用了 8081 的公共空间?或者这是正常的吗?

登录天鹅座:

time=2017-10-03T21:51:09.326Z | lvl=INFO | corr= | trans= | srv= | subsrv= | comp=cygnusagent | op=main | msg=com.telefonica.iot.cygnus.nodes.CygnusApplication[301] : Starting a Jetty server listening on 0.0.0.0:8081 (Management Interface)
time=2017-10-03T21:51:09.381Z | lvl=WARN | corr= | trans= | srv= | subsrv= | comp=cygnusagent | op=warn | msg=org.mortbay.log.Slf4jLog[76] : failed [email protected] /cdn-cgi/l/email-protection:8081: java.net.BindException: La dirección ya se está usando
time=2017-10-03T21:51:09.381Z | lvl=WARN | corr= | trans= | srv= | subsrv= | comp=cygnusagent | op=warn | msg=org.mortbay.log.Slf4jLog[76] : failed Server@52992ace: java.net.BindException: La dirección ya se está usando
time=2017-10-03T21:51:09.381Z | lvl=FATAL | corr= | trans= | srv= | subsrv= | comp=cygnusagent | op=run | msg=com.telefonica.iot.cygnus.http.JettyServer[90] : Fatal error running the Management Interface. Details=La dirección ya se está usando

EDIT2

我已经解决了两个天鹅座的问题,创建了两个agent_1和agent_2。我已经删除了其中之一,并且已经执行 service cygnus restart 时只出现了一个 cygnus。我们正在变得更好。

但我的订阅仍然遇到同样的问题:

contextBroker 日志表明:

 

msg = Raising alarm NotificationError http: // localhost: 5050 / notify: (curl_easy_perform failed: could not connect to server)

当我尝试时:

[root @ UAL-IoF2020 conf] # netstat -np | grep 5050

我不觉得有什么。

当我启动这个时:

[root @ UAL-IoF2020 conf] # netstat -np | grep 1026
tcp 0 0 150.XXX.XXX.XXX:1026 XXX.XXX.XXX.XXX:50348 ESTABLISHED 5169 / contextBroker

我正在尝试启动您的页面测试。

./notification-json-simple.sh http: // localhost: 5050 / notify myservice myservicepath

并给我以下错误:

[root @ UAL-IoF2020 ngsi-examples] # ./notification-json-simple.sh http: // localhost: 5050 / notify myservice myservicepath
* About to connect () to localhost port 5050 (# 0)
* Trying :: 1 ... Connection refused
* Trying 127.0.0.1 ... Connection refused
* could not connect to host
* Closing connection # 0
curl: (7) could not connect to host

给人的印象是,在 5050 中我没有什么可听的。

有什么线索吗?

cygnus-ngsi.sources = http-source
cygnus-ngsi.sinks = mysql-sink
cygnus-ngsi.channels = mysql-channel

#=============================================
# source configuration
# channel name where to write the notification events
cygnus-ngsi.sources.http-source.channels = mysql-channel
# source class, must not be changed
cygnus-ngsi.sources.http-source.type = org.apache.flume.source.http.HTTPSource
# listening port the Flume source will use for receiving incoming notifications
cygnus-ngsi.sources.http-source.port = 5050
# Flume handler that will parse the notifications, must not be changed
cygnus-ngsi.sources.http-source.handler = com.telefonica.iot.cygnus.handlers.NGSIRestHandler
# URL target
cygnus-ngsi.sources.http-source.handler.notification_target = /notify
# default service (service semantic depends on the persistence sink)
cygnus-ngsi.sources.http-source.handler.default_service = default
# default service path (service path semantic depends on the persistence sink)
cygnus-ngsi.sources.http-source.handler.default_service_path = /
# source interceptors, do not change
cygnus-ngsi.sources.http-source.interceptors = ts gi
# TimestampInterceptor, do not change
cygnus-ngsi.sources.http-source.interceptors.ts.type = timestamp
# GroupingInterceptor, do not change
cygnus-ngsi.sources.http-source.interceptors.gi.type = com.telefonica.iot.cygnus.interceptors.NGSIGroupingInterceptor$Builder
# Grouping rules for the GroupingInterceptor, put the right absolute path to the file if necessary
# see the doc/design/interceptors document for more details
cygnus-ngsi.sources.http-source.interceptors.gi.grouping_rules_conf_file = /usr/cygnus/conf/grouping_rules.conf

我必须安装 cygnus-common 手册吗?

阅读文档(https://github.com/telefonicaid/fiware-cygnus/tree/master/cygnus-ngsi https://github.com/telefonicaid/fiware-cygnus/tree/master/cygnus-ngsi)它写道:

Cygnus NGSI 基于 Apache Flume,后者通过 cygnus-common 使用,并且 Cygnus NGSI 依赖于 Apache Flume。

我认为你需要安装 cygnus-common。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ContextBroker 订阅错误 的相关文章

随机推荐

  • Gem::Ext::BuildError: 错误: 无法构建 gem 本机扩展。 ArchLinux

    我正在尝试在我的笔记本电脑上本地运行 jekyll 我按照Github的指南做到了这一点 https help github com articles using jekyll with pages https help github co
  • android 在通知中嵌入换行符

    我需要在通知中嵌入换行符 我有两行不同的数据 我需要嵌入换行符来区分这两行 我修改了反斜杠 n 但这不起作用 有没有办法做到这一点 尽管其他人在这里说过 您不需要使用 RemoteViews 或自定义布局来显示多行 多行文本是可能的 但仅限
  • 如何计算圆弧的 SVG 路径

    给定一个以 200 200 为圆心 半径为 25 的圆 如何绘制从 270 度到 135 度的圆弧以及从 270 度到 45 度的圆弧 0 度表示位于 x 轴右侧 右侧 表示位于 3 点钟位置 270度表示是12点钟位置 90度表示是6点钟
  • 非泛型方法“IServiceProvider.GetService(Type)”不能与类型参数一起使用

    我正在使用 NET Core 依赖注入 但是当我尝试在另一个类中获取服务时 出现 IServiceProvider GetService Type 无法与类型参数一起使用的错误 这个错误是什么意思 我知道泛型类型参数是这样的 Generic
  • Android Google 地图 v2:动画标记大小

    我正在尝试在将标记添加到地图时对其大小进行动画处理 基本上我希望标记能够增长 我看不到任何获取标记实际视图的方法 所以我认为我无法使用标准的 Android 动画技术 例如ObjectAnimator 我能看到做到这一点的唯一方法是实现我自
  • 什么时候需要@property和@synthesize?

    我到底什么时候需要添加 property nonatomic retain and synthesize 另外 什么时候声明IBOutlet someObject足够的 我如何在没有 property 和 synthesize 的情况下设置
  • 如何确定字符串是否包含无效编码字符

    使用场景 我们已经实现了一个 Web 服务 我们的 Web 前端开发人员在内部使用 通过 php api 来显示产品数据 用户在网站上输入一些内容 即查询字符串 在内部 网站通过 api 调用该服务 注意 我们使用restlet 而不是to
  • Gulp 失败并显示消息:需要对象

    我正在尝试在 w7 上使用 gulp gruntjs 工作 节点工作 如果我在没有 gulp 文件的情况下启动 gulp 它运行良好 说 没有找到 gulpfile gulp v 给出 cli 版本 3 5 6 本地版本 3 5 6 使用以
  • 将 /EHa 添加到使用 Microsoft Visual C++ 编译器的 QtCreator

    我怎样才能添加 EHaMS 编译器 QtCreator 中的 结构化异常处理 我一直使用 Microsoft Visual C 编译器 这是如何做到的 适用于 Qt 4 和 Qt 5 这将设置 EHa 而不是默认的 EHsc win QMA
  • 寻找正则表达式扩展[关闭]

    Closed 这个问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 我正在寻找一个可以在我们的应用程序中使用的正则表达式库 该库是用 PowerBuilder 编写的 P
  • DIV 内有两个 DIV。如何用第二个DIV自动填充父DIV的空间?

    请拜访这把小提琴 http jsfiddle net nirmand HQwLG 明白我的意思 我有一个父 DIV 其中有两个按垂直顺序放置的 DIV 顶部 DIV 应仅具有其内容的高度 而底部 DIV 应占据父 DIV 的所有剩余空间 无
  • 从 ASP.NET Web 服务接收 DTO

    如果我运行 ASP NET 并且正在访问一个返回 Person 对象列表的外国 asmx Web 服务 其中 Person 是外国公司定义的某个 DTO 那么我处理结果的最佳方法是什么 我是否应该创建自己的名为 Person 的 DTO 对
  • 从命令行获取用户的未截断的 Active Directory 组

    我经常使用net user命令查看用户的 AD 组 net user DOMAIN
  • MVC:如何为视图模型提供一个列表并在 .cshtml 上正确输出它

    我所做的是以给定值作为名称来搜索 Activedirectory 用户 然后 我创建一个包含名称 电子邮件和描述值的视图模型 然后我在索引上将其显示为 cshtml 问题在于我的制作方式 它只发送它找到的第一个用户 如果我从多个安德鲁中搜索
  • Pandas:删除所有 NaN 的列

    我有这个数据框 0 1 2 3 4 5 6 7 0 0915 8 NaN NaN NaN NaN NaN NaN NaN 1 NaN NaN NaN LIVE WGT NaN AMOUNT NaN TOTAL 2 GBW COD NaN N
  • 如何将 Eigen 库添加到 C++ 项目中

    可能是一个愚蠢 简单的问题 但我一直无法找到答案 我不知道如何使用 CodeBlocks c 添加库 我从以下位置下载了 zip 文件http eigen tuxfamily org index php title Main Page ht
  • 使用 ReactiveSecurityContextHolder 手动设置身份验证

    我正在尝试使用 Spring Web Flux 设置 Spring Security 不明白如何手动设置SecurityContext with ReactiveSecurityContextHolder 您有任何资源或提示吗 以我编写的这
  • Git Filter-Branch All 命令

    目前 我正在使用命令 git filter branch subdirectory filter MY DIRECTORY all 从该 git 存储库的所有 30 个分支中获取某个目录 在执行此过滤分支命令之前 我确保检查每个分支以确保
  • 如何更改 SpriteComponent 的颜色?

    我有一个查询系统 可以找到鼠标悬停在其中的对象 这不是一个按钮 但是 我想改变颜色 我不知道从哪里开始 我要查询什么属性以及如何更改它 目前 我有以下内容 fn mouse move mut commands Commands cursor
  • ContextBroker 订阅错误

    我已按照本教程安装 NGSI 将 cygnus 从版本 0 13 更新到 1 7 0 https github com telefonicaid fiware cygnus tree master cygnus ngsi https git