Orion Context Broker 工作一半时间
Orion Context Broker works half of the times
我已经安装了 Orion Context Broker 0.23.0,它很少见:它只有一半的时间有效。例如,在尝试检索版本时,我收到此错误消息:
$ curl "http://localhost:1026/version"
curl: (52) Empty reply from server
$ curl "http://localhost:1026/version"
<orion>
<version>0.23.0</version>
<uptime>15 d, 22 h, 13 m, 18 s</uptime>
<git_hash>f5d76a6f11736d52402e63a4aa0ba990bff7f5eb</git_hash>
<compile_time>Fri Jul 10 13:21:42 CEST 2015</compile_time>
<compiled_by>fermin</compiled_by>
<compiled_in>centollo</compiled_in>
</orion>
$ curl "http://localhost:1026/version"
curl: (52) Empty reply from server
$ curl "http://localhost:1026/version"
<orion>
<version>0.23.0</version>
<uptime>15 d, 22 h, 13 m, 53 s</uptime>
<git_hash>f5d76a6f11736d52402e63a4aa0ba990bff7f5eb</git_hash>
<compile_time>Fri Jul 10 13:21:42 CEST 2015</compile_time>
<compiled_by>fermin</compiled_by>
<compiled_in>centollo</compiled_in>
</orion>
这种行为是确定性的,我的意思是,在失败之后它总是有效,而在工作之后它总是失败。 REST API.
中的所有操作都会发生这种情况
我检查了侦听端口和进程 运行 它们与 Orion 的端口相匹配:
$ sudo netstat -ntlp | grep 1026
tcp 0 0 0.0.0.0:1026 0.0.0.0:* LISTEN 9944/contextBroker
tcp 0 0 :::1026 :::* LISTEN 9944/contextBroker
$ ps ax | grep contextBroker | grep -v grep
9944 ? Ssl 0:13 /usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/run/contextBroker/contextBroker.pid -dbhost localhost -db orion -multiservice
有什么提示吗?谢谢!
Orion 运行s 默认侦听 IPv4 和 IPv6。我们发现在与您描述的情况类似的情况下,禁用 IPv6 可以解决问题(我们还不知道确切的原因,可能与操作系统有关,或者以某种方式涉及...)。
Tu 运行 Orion 在 only-IPv4 模式下,您必须在 contextBroker 命令行中使用 -ipv4
选项,或者(如果您使用 运行ning Orion 作为服务)编辑 /etc/sysconfig/contextBroker
文件以将 -ipv4
添加到 BROKER_EXTRA_OPS 变量(查看 the documentation 了解有关将 Orion 配置为服务的更多信息)。修改 /etc/sysconfig/contextBroker
后,您必须使用以下命令重新启动 Orion:
sudo /etc/init.d/contextBroker restart
我已经安装了 Orion Context Broker 0.23.0,它很少见:它只有一半的时间有效。例如,在尝试检索版本时,我收到此错误消息:
$ curl "http://localhost:1026/version"
curl: (52) Empty reply from server
$ curl "http://localhost:1026/version"
<orion>
<version>0.23.0</version>
<uptime>15 d, 22 h, 13 m, 18 s</uptime>
<git_hash>f5d76a6f11736d52402e63a4aa0ba990bff7f5eb</git_hash>
<compile_time>Fri Jul 10 13:21:42 CEST 2015</compile_time>
<compiled_by>fermin</compiled_by>
<compiled_in>centollo</compiled_in>
</orion>
$ curl "http://localhost:1026/version"
curl: (52) Empty reply from server
$ curl "http://localhost:1026/version"
<orion>
<version>0.23.0</version>
<uptime>15 d, 22 h, 13 m, 53 s</uptime>
<git_hash>f5d76a6f11736d52402e63a4aa0ba990bff7f5eb</git_hash>
<compile_time>Fri Jul 10 13:21:42 CEST 2015</compile_time>
<compiled_by>fermin</compiled_by>
<compiled_in>centollo</compiled_in>
</orion>
这种行为是确定性的,我的意思是,在失败之后它总是有效,而在工作之后它总是失败。 REST API.
中的所有操作都会发生这种情况我检查了侦听端口和进程 运行 它们与 Orion 的端口相匹配:
$ sudo netstat -ntlp | grep 1026
tcp 0 0 0.0.0.0:1026 0.0.0.0:* LISTEN 9944/contextBroker
tcp 0 0 :::1026 :::* LISTEN 9944/contextBroker
$ ps ax | grep contextBroker | grep -v grep
9944 ? Ssl 0:13 /usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/run/contextBroker/contextBroker.pid -dbhost localhost -db orion -multiservice
有什么提示吗?谢谢!
Orion 运行s 默认侦听 IPv4 和 IPv6。我们发现在与您描述的情况类似的情况下,禁用 IPv6 可以解决问题(我们还不知道确切的原因,可能与操作系统有关,或者以某种方式涉及...)。
Tu 运行 Orion 在 only-IPv4 模式下,您必须在 contextBroker 命令行中使用 -ipv4
选项,或者(如果您使用 运行ning Orion 作为服务)编辑 /etc/sysconfig/contextBroker
文件以将 -ipv4
添加到 BROKER_EXTRA_OPS 变量(查看 the documentation 了解有关将 Orion 配置为服务的更多信息)。修改 /etc/sysconfig/contextBroker
后,您必须使用以下命令重新启动 Orion:
sudo /etc/init.d/contextBroker restart