首页 > 解决方案 > 无法运行 Orion 上下文代理

问题描述

必须将 MongoDB 移动到外部 VM 上,因此重新配置 Orion CB 以不在本地主机上使用 Mongo,而是通过外部 mongoDB 的 IP(mongoDB 还配置为绑定外部 IP)。每当我尝试运行 Orion CB 时,它都会停止,日志说它失败了:

cat: /run/var/contextBroker/contextBroker.pid: no such file or directory

但是,当我创建这个文件时 - 它给了我这个:

contextBroker dead but pidfile exists.

starting contextBroker....pidfile not found

尝试使用 yum 和可用的最新 yum repo 配置重新安装它,但它似乎已关闭或未更新?- 给我 404 未找到。

编辑 1 yum repo 的配置取自 Orion 官方 Github:

[fiware-release]
name=FIWARE release repository
baseurl=https://nexus.lab.fiware.org/repository/el/7/x86_64/release
enabled=1
protect=0
gpgcheck=0
metadata_expire=30s
autorefresh=1
type=rpm-md

我尝试了多种运行 Orion 的方法。最常见的是:

contextBroker

除此之外,还使用了以下内容:

contextBroker -ngsiv1Autocast
service contextBroker start

编辑 2

按照 fgalan 的建议,以下是回复: contextBroker 启动

标签: fiware-orion

解决方案


服务脚本和 yum 存储库 appart 的问题,请注意默认情况下 Orion 期望数据库在 localhost 中运行。因此,如果您的 MongoDB 实例在单独的服务器中运行,则必须使用该-dbhost参数,例如:

contextBroker -fg -dbhost 10.1.1.1:27017

可以在此处找到有关 CB CLI 的额外文档。

编辑 1:如果您有一个 pid 文件,因为过去调用不干净退出(请注意日志跟踪中的 msg=),那么您必须在运行 CB 之前将其删除。例如:

rm -f /tmp/contextBroker.pid
contextBroker -fg -dbhost 10.1.1.1:27017

推荐阅读