You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

同网络下JADE主容器与远程容器连接失败问题求助

JADE远程二级容器无法连接主容器的问题排查与解决

问题背景

同一WiFi网络下,本地运行远程二级容器可正常连接主容器,但在另一台机器上运行时出现以下错误:

Error adding ICP jade.imtp.leap.JICP.JICPPeer@5eb5c224[Error: 无法在远程主机(ip)上启动JADE,请检查-host和-local-host选项。]
加入代理平台时通信失败:无活跃ICP
jade.core.IMTPException: No ICP active

核心问题分析

  1. 主容器绑定IP错误:若主容器配置的PLATFORM_IP为localhost或127.0.0.1,仅本地可访问,其他机器无法建立连接。
  2. 远程容器创建逻辑错误:远程二级容器不应调用createMainContainer(),该方法会尝试创建新主容器,而非连接现有主容器。
  3. 端口冲突或未开放:主容器的1099端口被防火墙拦截,或远程容器使用与主容器相同的1099端口导致冲突。
  4. 网络参数配置缺失:未正确指定远程容器的本地绑定IP或ICP通信协议参数。

具体修复步骤

1. 修正主容器的IP配置

主容器必须绑定到局域网可访问的IP(如192.168.x.x),修改PlatformMain中的参数:

// 替换为主容器所在机器的实际局域网IP
String PLATFORM_IP = "192.168.1.100";

2. 修正远程容器的创建逻辑

远程容器为二级容器,需调用createAgentContainer(),同时调整端口避免冲突:

public class SecondaryRemoteContainer {
    public static void main(String[] args) {
        if (args.length != 1) {
            System.out.println("Usage: java -jar YourJarFileName.jar <main_container_ip>");
            return;
        }
        
        // 使用非1099的端口避免冲突
        int secondaryContainerPort = 1100;
        String mainContainerIP = args[0];

        Runtime rt = Runtime.instance();

        // 基于主容器的平台信息创建二级容器配置
        Profile secondaryContainerProfile = new ProfileImpl(mainContainerIP, 1099, "MyPlatform");
        secondaryContainerProfile.setParameter(Profile.CONTAINER_NAME, "SecondaryContainer");
        // 可选:若机器有多网卡,显式指定本地绑定IP
        // secondaryContainerProfile.setParameter(Profile.LOCAL_HOST, "远程机器的局域网IP");

        System.out.println("Launching the secondary container..." + secondaryContainerProfile);
        // 创建二级容器而非主容器
        AgentContainer secondaryContainerRef = rt.createAgentContainer(secondaryContainerProfile);

        System.out.println("Secondary container initialized successfully");
    }
}

3. 开放主容器机器的防火墙端口

  • Windows:在Windows Defender防火墙中添加入站规则,允许TCP端口1099的访问。
  • Linux:执行命令开放端口(以ufw防火墙为例):
    sudo ufw allow 1099/tcp
    

4. 验证网络连通性

在远程机器上执行以下命令,确认网络和端口可达:

# 测试主容器IP连通性
ping 192.168.1.100
# 测试端口是否开放
telnet 192.168.1.100 1099

若telnet能成功连接,说明网络配置正常;若失败,需排查防火墙或网络路由问题。

5. 可选:显式指定ICP通信协议

若上述步骤仍未解决,可在主容器和远程容器的Profile中添加ICP参数:

// 主容器配置添加
pMain.setParameter(Profile.ICP, "jade.imtp.leap.JICP.JICPProtocol");
// 远程容器配置添加
secondaryContainerProfile.setParameter(Profile.ICP, "jade.imtp.leap.JICP.JICPProtocol");

验证步骤

  1. 启动主容器,确认控制台输出的IP为局域网IP。
  2. 在远程机器上运行二级容器,传入主容器IP参数:
    java -jar YourJarFileName.jar 192.168.1.100
    
  3. 查看主容器的JADE GUI(若已启动),确认SecondaryContainer已成功加入平台。

内容的提问来源于stack exchange,提问作者mohamedsidabdalla rgagde

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 00:34:59