fiware contextBroker 1.10更新错误服务启动

fiware contextBroker 1.10 update error service start

我已成功将 ContextBroker 更新到 1.10 版。但是我有一系列的疑惑:

我正在使用此文档:

http://fiware-orion.readthedocs.io/en/1.10.0/user/walkthrough_apiv2/index.html#introduction

并且命令不起作用

  1. 如何启动或重新启动 contextBroker 服务?,使用此指令不起作用:

    /etc/init.d/contextBroker start
    
  2. contextBroker 信息托管在哪里?

  3. 在哪里可以看到日志?它不在这个目录中:

    /tmp/contextBroker.log
    

如果 Orion 不是 运行ning,http://fiware-orion.readthedocs.io/en/1.10.0/user/walkthrough_apiv2/index.html#introduction 中的命令不起作用是正常的(从您提出的问题看来是这样;)

注意 /etc/init.d/contextBroker start 仅在您从 RPM 安装 Orion 时才有效。如果您是从源安装的,您应该直接使用 contextBroker 命令,如 this piece of documentation.

中所述

首先,检查是否正确安装了 Context Broker 运行ning:

contextBroker --version

接下来,要在终端的前台运行 Context Broker,只需使用:

contextBroker -fg

您也可以在后台 运行 关闭 -fg 开关(在这种情况下,您将需要使用 kill 命令来停止 ContextBroker 进程):

contextBroker

无论选择哪个选项来启动 ContextBroker,您都可以检查它是否正在使用(在 ContextBroker 运行s 所在的同一主机中):

curl localhost:1026/version

关于日志文件的默认位置是/tmp/contextBroker.log。如果 ContextBroker 还没有追踪到任何东西,可能会发生文件不存在的情况。使用 -logLevel 提高日志级别:

contextBroker -fg -logLevel INFO

然后使用 curl localhost:1026/version 重试。

关于托管 Context Broker 信息的位置,Context Broker 使用 MongoDB 数据库实例。默认情况下,它假定数据库位于 Orion 运行s 所在的同一主机中,但可以使用 -dbhost CLI 参数对其进行更改。查看 aforementioned documentation 以获取有关此(和其他)CLI 参数的信息。

请注意,无法连接到 MongoDB 实例是可能导致 Context Broker 无法启动的原因之一。在这种情况下,您会收到这样的错误消息:

Database Startup Error (cannot connect to mongo - doing 100 retries with a 1000 microsecond interval)

为了向社区澄清这一点,这个问题是 的后续问题。

  1. How can I start or restart the contextBroker service ?, with this instruction it does not work: /etc/init.d/contextBroker start

如果您的安装方法是 source build,则您不能 使用此命令启动 Orion。但是,您可以为 Orion 创建自己的自定义 systemd 服务。您可以在网上找到很多关于如何执行此操作的信息。

Where is the contextBroker information hosted?

你能在评论中澄清一下吗?

Where can I see the log? It is not in this directory: /tmp/contextBroker.log

您的 /tmp 文件夹的内容可能已被您的 OS 清除。您应该能够在启动时使用 logDir 命令选项配置 Orion Context Broker 的日志目录,但查看源代码,这种用法可能已过时。

也许@fgalan 可以提供更多相关信息,稍后我们可以更新此答案。