gpt4 book ai didi

ssl - 如何使 Orion Context Broker 使用 HTTPS 通知?

转载 作者:太空宇宙 更新时间:2023-11-03 13:34:51 26 4
gpt4 key购买 nike

我想为通知启用 https。 Orion Context Broker 版本 1.7.0 安装在 Ubuntu 16.04 中。首先,使用以下命令:

sudo /etc/init.d/contextBroker start -logAppend -https -key /path/to/orion.key -cert /path/to/orion.crt

答案是:

[ ok ] Starting contextBroker (via systemctl): contextBroker.service.

状态是:

sudo systemctl status contextBroker.service
contextBroker.service - LSB: Example initscript
Loaded: loaded (/etc/init.d/contextBroker; bad; vendor preset: enabled)
Active: active (exited) since Tue 2017-04-04 12:56:13 BRT; 14s ago
Docs: man:systemd-sysv-generator(8)
Process: 8312 ExecStart=/etc/init.d/contextBroker start (code=exited, status=0/SUCCESS)
Apr 04 12:56:13 fiware-ubuntu systemd[1]: Starting LSB: Example initscript...
Apr 04 12:56:13 fiware-ubuntu contextBroker[8312]: contextBroker
Apr 04 12:56:13 fiware-ubuntu contextBroker[8312]: /path/bin/contextBroker
Apr 04 12:56:13 fiware-ubuntu systemd[1]: Started LSB: Example initscript.

另一种方法是将 Orion 运行为:

sudo /path/bin/contextBroker -logLevel DEBUG -localIp x.y.z.t -https -key /path/to/orion.key -cert /path/to/orion.crt

日志如下:

time=2017-04-04T18:37:58.881Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=contextBroker.cpp[1705]:main | msg=Orion Context Broker is running
time=2017-04-04T18:37:58.887Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongoConnectionPool.cpp[205]:mongoConnect | msg=Successful connection to database
time=2017-04-04T18:37:58.887Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[681]:setWriteConcern | msg=Database Operation Successful (setWriteConcern: 1)
time=2017-04-04T18:37:58.887Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[724]:getWriteConcern | msg=Database Operation Successful (getWriteConcern)
time=2017-04-04T18:37:58.888Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[626]:runCollectionCommand | msg=Database Operation Successful (command: { buildinfo: 1 })
...
time=2017-04-04T18:37:58.897Z | lvl=FATAL | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=rest.cpp[1720]:restStart | msg=Fatal Error (error starting REST interface)

它不工作...

最佳答案

如果您将 Orion 作为服务运行(如推荐的那样),则必须在 /etc/sysconfig/contexBroker 文件中配置命令行参数。 this piece of documentation 中解释了该文件.

注意文件末尾的 BROKER_EXTRA_OPS 变量。这用于包括未使用任何其他选项设置的 CLI 参数,如与您正在使用的 HTTPS 相关的参数。因此,应该以这种方式设置 BROKER_EXTRA_OPS:

BROKER_EXTRA_OPS="-logAppend -https -key /path/to/orion.key -cert /path/to/orion.crt"

然后使用以下方式启动服务:

sudo /etc/init.d/contextBroker start

(注意'start'后不加参数)

您可以使用 ps ax | 检查 Orion 是否以正确的参数运行grep contextBroker.

最后,关于错误 Fatal Error (error starting REST interface) 当 Orion 由于某种原因无法启动 REST API 的监听服务器时出现。通常这是由于某些其他进程(可能是一个被遗忘的 Orion 实例)在同一端口上运行监听。使用 sudo netstat -ntpld | grep 1026 以了解哪个其他进程可能正在该部分监听(当然,假设 1026 是您尝试运行 Orion 的端口)。

关于ssl - 如何使 Orion Context Broker 使用 HTTPS 通知?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43212442/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com