【问题标题】:Python program can not launch redhawksdr component with external network connectedPython程序无法启动连接外部网络的redhawksdr组件
【发布时间】:2015-03-23 22:35:37
【问题描述】:

我是 RedHawkSDR 的新用户,并且在 CentOS 下编写了一个控制“SigGen”组件的 python 程序。如果除了环回之外没有网络连接,它可以工作,但如果我连接有线网络(列为 System ethO)则失败。

我没有在python程序中指定任何IP地址,omniORB.cfg明确列出了如下所示的环回地址,因为其他帖子中有cmets警告不要使用“localhost”

traceLevel=10
InitRef = NameService=corbaname::127.0.0.1:2809
supportBootstrapAgent = 1
InitRef = EventService=corbaloc::127.0.0.1:11169/omniEvents

比较两种情况下打印到屏幕上的 ominORB 数据:

最后相同的步骤 ==> "omniORB: AsyncInvoker: thread id=2 has started. Total threads=1

下一步:

用于工作(无网络)==>“omniORB:将根(激活)添加到对象表

对于非工作(网络连接)==>“omniORB:从对象表中删除根(虚化)

网络连接案例的完整消息流==>

[aecom@crancentos1 Desktop]$ python pTrigger.py keyboard 5555 5050
omniORB: Version: 4.1.6
omniORB: Distribution date: Fri Jul  1 15:57:00 BST 2011 dgrisby
omniORB: Information: the omniDynamic library is not linked.
omniORB: omniORBpy distribution date: Fri Jul  1 14:52:31 BST 2011 dgrisby
omniORB: Initialising incoming endpoints.
omniORB: Attempt to set socket to listen on IPv4 and IPv6.
omniORB: Starting serving incoming endpoints.
omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 1
/usr/local/redhawk/core/lib/python/ossie/utils/sb/domainless.py:863:
DeprecationWarning: Component class is deprecated. Use launch() method instead.
warnings.warn('Component class is deprecated. Use launch() method instead.', DeprecationWarning)
omniORB: Adding root<0> (activating) to object table.
omniORB: Creating ref to local: root<0>
target id      : IDL:omg.org/CORBA/Object:1.0
most derived id: IDL:omg.org/CosNaming/NamingContextExt:1.0
omniORB: Creating Python ref to local: root<0>
target id      : IDL:omg.org/CosNaming/NamingContextExt:1.0
most derived id: IDL:omg.org/CosNaming/NamingContextExt:1.0
omniORB: Version: 4.1.6
omniORB: Distribution date: Fri Jul  1 15:57:00 BST 2011 dgrisby
omniORB: Information: the omniDynamic library is not linked.
omniORB: omniORBpy distribution date: Fri Jul  1 14:52:31 BST 2011 dgrisby
omniORB: Initialising incoming endpoints.
omniORB: Attempt to set socket to listen on IPv4 and IPv6.
omniORB: Starting serving incoming endpoints.
omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 1
omniORB: Removing root<0> (etherealising) from object table
Traceback (most recent call last):
File "pTrigger.py", line 118, in <module>
sigGen=sb.Component("SigGen")
File "/usr/local/redhawk/core/lib/python/ossie/utils/sb/domainless.py", line 872, in __new__
raise AssertionError, "Unable to launch component: '%s'" % e
AssertionError: Unable to launch component: 'resource 'SigGen_2' did not register with virtual environment'

在系统建立网络连接时,是否有一个系统变量/令牌/事物是“127.0.0.1”,在系统建立网络连接时切换到网络 IP 地址,从而混淆了omniORB?

任何建设性的指导将不胜感激......

最好的问候,

布拉德·迈耶

附加数据 // 防火墙关闭==============================

// 确凿证据 ?================================

 omniORB: omniORBpy distribution date: Fri Jul  1 14:52:31 BST 2011 dgrisby
 omniORB: Python thread state scavenger start.
 omniORB: Initialising incoming endpoints.
 omniORB: Instantiate endpoint 'giop:tcp:127.0.0.1:'
 omniORB: Explicit bind to host 127.0.0.1.
 omniORB: Bind to address 127.0.0.1 ephemeral port.
 omniORB: Publish specification: 'addr'
 omniORB: Try to publish 'addr' for endpoint giop:tcp:127.0.0.1:46877
 omniORB: Publish endpoint 'giop:tcp:127.0.0.1:46877'
 omniORB: Starting serving incoming endpoints.
 omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 1
 omniORB: giopRendezvouser task execute for giop:tcp:127.0.0.1:46877
 ==>omniORB: SocketCollection idle. Sleeping.
 omniORB: State root<0> (active) -> deactivating

// ifconfig 显示环回运行 =================== 链接封装:本地环回
inet 地址:127.0.0.1 掩码:255.0.0.0 inet6 地址::::1/128 范围:主机 上环回运行 MTU:65536 指标:1 RX 数据包:302 错误:0 丢弃:0 超限:0 帧:0 TX 数据包:302 错误:0 丢弃:0 超限:0 运营商:0 碰撞:0 发送队列:0 RX 字节:26197 (25.5 KiB) TX 字节:26197 (25.5 KiB)

// ping 127.0.0.1 有效 ======================================== ===

// netstat -tulpn 显示 OMIN 连接到某些端口===================================== ===== 活动 Internet 连接(仅限服务器) Proto Recv-Q Send-Q 本地地址 外部地址 状态 PID/程序名称
tcp 0 0 127.0.0.1:42451 0.0.0.0:* LISTEN 2409/omniEvents
tcp 0 0 已为 POST 0.0.0.0 编辑:* 听 2617/dnsmasq
tcp 0 0 0.0.0.0:50517 0.0.0.0:* LISTEN 2067/rpc.statd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2254/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2098/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2346/master
tcp 0 0 127.0.0.1:42251 0.0.0.0:* LISTEN 2022/omniNames
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1902/rpcbind
tcp 0 0 :::39409 :::* LISTEN 2067/rpc.statd
tcp 0 0 :::22 :::* LISTEN 2254/sshd
tcp 0 0 ::1:631 :::* 听 2098/cupsd
tcp 0 0 ::1:25 :::* LISTEN 2346/master
tcp 0 0 :::2809 :::* LISTEN 2022/omniNames
tcp 0 0 :::11169 :::* LISTEN 2409/omniEvents
tcp 0 0 :::111 :::* LISTEN 1902/rpcbind

【问题讨论】:

    标签: redhawksdr


    【解决方案1】:

    当有多个网络接口可用时,omniORB 会任意选择其中一个来发布对象引用(参见http://omniorb.sourceforge.net/omni41/omniNames.html 中的第 5 部分)。在您的情况下,当您连接网络时,它似乎正在抓取 eth0,无论出于何种原因(可能是防火墙设置),它都不能很好地与 omniNames 配合使用。

    为了解决这个问题,我建议在 /etc/omniORB.cfg 文件中添加以下行:

    endPoint = giop:tcp:127.0.0.1:
    

    这将强制 omniNames 始终使用本地环回而不是 eth0。鉴于您当前的 omniORB.cfg 设置,我假设您的应用程序可以接受使用 localhost。如果不是这种情况(即,您确实需要使用 eth0 而不是 localhost),我们将需要找到omniNames 与您的 eth0 接口有问题的根本原因。


    澄清(因为我不能在 cmets 部分使用换行符):

    尝试将日志级别提高到 40,看看这些日志行之间是否显示任何有用的信息:

    omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 1
    omniORB: Removing root<0> (etherealising) from object table
    

    我无法重现您的问题。在我的工作案例中,我得到这样的结果:

    omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 1
    omniORB: giopRendezvouser task execute for giop:tcp:127.0.0.1:60625
    omniORB: Adding root<0> (activating) to object table.
    

    我很好奇第二行的 IP 对你来说是否可疑。

    【讨论】:

    • Drew:感谢您的快速回复,但建议的解决方案不起作用(尽管它符合我的预期答案),但您说得对,我总是可以使用环回。还尝试在响应之前完全关闭并重新启动。我已将其留在 CFG 文件中。是否有任何其他我可以尝试的方法或其他有助于诊断的数据?
    • 在答案中查看我的“澄清”(cmets 字段中的格式很糟糕)。
    • Drew:感谢您的帮助,因为我非常卡住。我还通过编辑添加了数据。对于某些人来说,环回似乎是空闲的。我做了一些基本的检查,没有发现任何问题。想法?
    • 我为此工作了一周……但最终找到了解决方案。在 etc/host 文件中,我添加了一行“127.0.0.1 ‘ComputerName’”,问题就消失了。
    【解决方案2】:

    我为此工作了一周……但最终找到了解决方案,因为 DrewC 为我指明了新的方向。

    在 etc/host 文件中,我添加了一行“127.0.0.1 ‘ComputerName’”,问题就消失了。

    布拉德

    【讨论】:

    • 如果 IP 和主机名不相互映射,您可能会遇到许多问题。仅供参考,DNS 服务器配置错误可能会导致类似问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-01
    • 2018-08-17
    • 1970-01-01
    • 2017-12-30
    相关资源
    最近更新 更多