Orion Context Broker工作一半 [英] Orion Context Broker works half of the times
问题描述
我已经安装了Orion Context Broker 0.23.0,它的行为很少见:它只能工作一半.例如,当尝试检索版本时,出现以下错误消息:
I've installed Orion Context Broker 0.23.0 and it behaves rare: it only works half of the times. For instance, when trying to retrieve the version I get this error message:
$ 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中的所有操作都会发生这种情况.
This behaviour is deterministic, I mean, after failing it always works, and after working it always fails. This occurs with all the operations within the REST API.
我已经检查了侦听端口,运行它们的进程与Orion的端口匹配:
I've checked the listening ports and the process running them matches the Orion's one:
$ 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默认运行,以侦听IPv4和IPv6.我们发现,在与您描述的情况类似的情况下,禁用IPv6可以解决问题(我们尚不知道确切的原因,可能与操作系统有关或涉及某种方式...).
Orion runs by default listening to IPv4 and IPv6. We have found that in cases similar to the ones you described disabling IPv6 solves the problem (we don't know yet the exact cause, maybe is related with the operating system or it is involved is some way...).
仅在IPv4模式下运行Orion,您必须在contextBroker命令行中使用-ipv4
选项,或者(如果您将Orion作为服务运行)编辑/etc/sysconfig/contextBroker
文件以将-ipv4
添加到BROKER_EXTRA_OPS变量(请参阅文档了解有关将Orion配置为服务).修改/etc/sysconfig/contextBroker
后,您必须使用以下命令重新启动Orion:
Tu run Orion in only-IPv4 mode you have to use the -ipv4
option either in the contextBroker command line or (if you are running Orion as a service) editing the /etc/sysconfig/contextBroker
file to add -ipv4
to the BROKER_EXTRA_OPS variable (have a look to the documentation for more information about configuring Orion as a service). After modifying /etc/sysconfig/contextBroker
you have to restart Orion using:
sudo /etc/init.d/contextBroker restart
这篇关于Orion Context Broker工作一半的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!