首页 新闻 论坛 群组 Blog 文档 下载 读书 Tag 网摘 搜索 .NET Java 游戏 视频 人才 外包 培训 数据库 书店 程序员
中国软件网
欢迎您:游客 | 登录 注册 帮助
  • [紧急]JBoss集群部署不成功的原因,在线等 [已结贴,结贴人:pushboy]
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-05 10:06:55 楼主
    部署两台JBoss4.0.3SP1
    修改了cluster-service.xml & jboss-service.xml的配置
    但是启动JBoss,日志中是这样的信息
    -------------------------------------------------------
    GMS: address is sztp02:32850
    -------------------------------------------------------
    2007-12-05 09:54:07,912 INFO  [org.jboss.cache.TreeCache] viewAccepted(): new members: [sztp02:32845]
    2007-12-05 09:54:07,919 INFO  [org.jboss.cache.TreeCache] state could not be retrieved (must be first member in group)
    ......

    GMS: address is sztp02:32847 (additional data: 18 bytes)
    -------------------------------------------------------
    2007-12-05 09:54:12,547 INFO  [org.jboss.ha.framework.interfaces.HAPartition.test] Number of cluster members: 1
    2007-12-05 09:54:12,550 INFO  [org.jboss.ha.framework.interfaces.HAPartition.lifecycle.test] New cluster view for partition test (id: 0, delta: 0) : [192.168.0.238:1099]
    2007-12-05 09:54:12,551 INFO  [org.jboss.ha.framework.interfaces.HAPartition.test] Other members: 0
    2007-12-05 09:54:12,552 INFO  [org.jboss.ha.framework.interfaces.HAPartition.test] Fetching state (will wait for 30000 milliseconds):

    使用客户端测试,也只能一台服务器接收到消息,请问这是哪里的配置的原因呢
    谢谢
    50  修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-05 14:50:111楼 得分:0
    lz修改了cluster-service.xml  &  jboss-service.xml中的哪些信息?缺省情况下没有问题
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-05 14:54:562楼 得分:0
    cluster-service.xml      中的域的定义
    <mbean code="org.jboss.ha.framework.server.ClusterPartition"
          name="jboss:service=test">
           
          <!-- Name of the partition being built -->
          <attribute name="PartitionName">test </attribute>

    和HANaming部分:
    <mbean code="org.jboss.ha.jndi.HANamingService"
          name="jboss:service=HAJNDI">
          <depends>jboss:service=test </depends>
          <!-- Name of the partition to which the service is linked -->
          <attribute name="PartitionName">test </attribute>
    ......
          <attribute name="AutoDiscoveryBindAddress">192.168.100.9 </attribute>

    jboss-service.xml中增加了节点
    <hosts>
                  <host>
                      <!-- The URL to use to connect the host. URLs like http://www.xx.yy:8080/ are also allowed -->
                      <host-url>http://192.168.0.238/ </host-url>
                  </host>
                  <host>
                      <host-url>http://192.168.0.16/ </host-url>
                  </host>                         
                 
                </hosts>
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-06 12:20:423楼 得分:0
    现在奇怪的是,我用两台windows的机器做集群可以正常使用
    使用两台linux的机器就不行
    有什么不同么?
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-06 14:38:544楼 得分:0
      帮顶!!!!!!!!!!!!!!
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-06 16:32:065楼 得分:0
    多谢LS帮顶
    我发现一个问题,就是这两台服务器虽然不能负载,但是可以互相识别

    关掉一台Jboss,在另外一台可以看到
    2007-12-06 16:06:34,179 INFO  [org.jboss.ha.framework.server.DistributedReplicantManagerImpl.test] I am (192.168.0.16:1099) received membershipChanged event:
    2007-12-06 16:06:34,179 INFO  [org.jboss.ha.framework.server.DistributedReplicantManagerImpl.test] Dead members: 1 ([192.168.0.238:1099])
    2007-12-06 16:06:34,179 INFO  [org.jboss.ha.framework.server.DistributedReplicantManagerImpl.test] New Members : 0 ([])
    2007-12-06 16:06:34,179 INFO  [org.jboss.ha.framework.server.DistributedReplicantManagerImpl.test] All Members : 1 ([192.168.0.16:1099])

    再启动之后都又可以看到对方
    2007-12-06 16:14:32,463 INFO  [org.jboss.cache.TreeCache] viewAccepted(): new members: [sztp01:32905, sztp02:32945]

    但是就是客户端发消息过来的时候,不能够分发,只能始终是其中一台接收到数据
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-06 16:38:436楼 得分:0
    dfdf
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-06 20:32:277楼 得分:0
    1、如果只是linux系统下不行,一般都是网络配置方面的问题,特别是防火墙的配置
    2、客户端发送过来的是什么消息?有没有可能测试代码有问题呢?
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-06 21:35:388楼 得分:0
    防火墙让网关去掉过,一样的毛病
    测试代码的话,问题也不应该,因为之前正常的时候也是这个测试代码,要不我把配置贴出来看看?
    cluster-service.xml:
    <?xml version="1.0" encoding="UTF-8"?>

    <server>

      <!-- ==================================================================== -->
      <!-- Cluster Partition: defines cluster                                  -->
      <!-- ==================================================================== -->

      <mbean code="org.jboss.ha.framework.server.ClusterPartition"
          name="jboss:service=test">
           
          <!-- Name of the partition being built -->
          <attribute name="PartitionName">test </attribute>
          <!-- The address used to determine the node name -->
          <attribute name="NodeAddress">${jboss.bind.address} </attribute>
          <!-- Determine if deadlock detection is enabled -->
          <attribute name="DeadlockDetection">False </attribute>
          <!-- Max time (in ms) to wait for state transfer to complete. Increase for large states -->
          <attribute name="StateTransferTimeout">30000 </attribute>
          <!-- The JGroups protocol configuration -->
          <attribute name="PartitionConfig">
            <Config>
                <UDP mcast_addr="${jboss.partition.udpGroup:228.1.2.3}" mcast_port="45566"
                  ip_ttl="8" ip_mcast="true"
                  mcast_send_buf_size="800000" mcast_recv_buf_size="150000"
                  ucast_send_buf_size="800000" ucast_recv_buf_size="150000"
                  loopback="false"/>
                <PING timeout="2000" num_initial_members="3"
                  up_thread="true" down_thread="true"/>
                <MERGE2 min_interval="10000" max_interval="20000"/>
                <FD shun="true" up_thread="true" down_thread="true"
                  timeout="2500" max_tries="5"/>
                <VERIFY_SUSPECT timeout="3000" num_msgs="3"
                  up_thread="true" down_thread="true"/>
                <pbcast.NAKACK gc_lag="50" retransmit_timeout="300,600,1200,2400,4800"
                  max_xmit_size="8192"
                  up_thread="true" down_thread="true"/>
                <UNICAST timeout="300,600,1200,2400,4800" window_size="100" min_threshold="10"
                  down_thread="true"/>
                <pbcast.STABLE desired_avg_gossip="20000"
                  up_thread="true" down_thread="true"/>
                <FRAG frag_size="8192"
                  down_thread="true" up_thread="true"/>
                <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
                  shun="true" print_local_addr="true"/>
                <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>
            </Config>
            <!-- Alternate TCP stack: customize it for your environment, change bind_addr and initial_hosts -->
            </attribute>
          <depends>jboss:service=Naming </depends>
      </mbean>

      <!-- ==================================================================== -->
      <!-- HA Session State Service for SFSB                                    -->
      <!-- ==================================================================== -->

      <mbean code="org.jboss.ha.hasessionstate.server.HASessionStateService"
          name="jboss:service=HASessionState">
          <!-- Name of the partition to which the service is linked -->
          <attribute name="PartitionName">${jboss.partition.name:DefaultPartition} </attribute>
          <!-- JNDI name under which the service is bound -->
          <attribute name="JndiName">/HASessionState/Default </attribute>
          <!-- Max delay before cleaning unreclaimed state.
              Defaults to 30*60*1000 => 30 minutes -->
          <attribute name="BeanCleaningDelay">0 </attribute>
          <depends>jboss:service=Naming </depends>
          <depends>jboss:service=${jboss.partition.name:DefaultPartition} </depends>
      </mbean>

      <!-- ==================================================================== -->
      <!-- HA JNDI                                                              -->
      <!-- ==================================================================== -->

      <mbean code="org.jboss.ha.jndi.HANamingService"
          name="jboss:service=HAJNDI">
          <depends>jboss:service=test </depends>
          <!-- Name of the partition to which the service is linked -->
          <attribute name="PartitionName">test </attribute>
          <!-- Bind address of bootstrap and HA-JNDI RMI endpoints -->
          <attribute name="BindAddress">${jboss.bind.address} </attribute>
          <!-- Port on which the HA-JNDI stub is made available -->
          <attribute name="Port">1100 </attribute>
          <!-- RmiPort to be used by the HA-JNDI service once bound. 0 => auto. -->
          <attribute name="RmiPort">1101 </attribute>
          <!-- Accept backlog of the bootstrap socket -->
          <attribute name="Backlog">50 </attribute>
          <!-- The thread pool service used to control the bootstrap and
          auto discovery lookups -->
          <depends optional-attribute-name="LookupPool"
            proxy-type="attribute">jboss.system:service=ThreadPool </depends>

          <!-- A flag to disable the auto discovery via multicast -->
          <attribute name="DiscoveryDisabled">false </attribute>
          <!-- Set the auto-discovery bootstrap multicast bind address. If not
          specified and a BindAddress is specified, the BindAddress will be used. -->
          <attribute name="AutoDiscoveryBindAddress">192.168.0.238 </attribute>
          <!-- Multicast Address and group port used for auto-discovery -->
          <attribute name="AutoDiscoveryAddress">${jboss.partition.udpGroup:230.0.0.4} </attribute>
          <attribute name="AutoDiscoveryGroup">1102 </attribute>
          <!-- The TTL (time-to-live) for autodiscovery IP multicast packets -->
          <attribute name="AutoDiscoveryTTL">16 </attribute>
      </mbean>

      <mbean code="org.jboss.invocation.jrmp.server.JRMPInvokerHA"
          name="jboss:service=invoker,type=jrmpha">
          <attribute name="ServerAddress">${jboss.bind.address} </attribute>
          <attribute name="RMIObjectPort">4447 </attribute>
          <!--
          <attribute name="RMIClientSocketFactory">custom </attribute>
          <attribute name="RMIServerSocketFactory">custom </attribute>
          -->
          <depends>jboss:service=Naming </depends>
      </mbean>

      <!-- the JRMPInvokerHA creates a thread per request.  This implementation uses a pool of threads -->
      <mbean code="org.jboss.invocation.pooled.server.PooledInvokerHA"
          name="jboss:service=invoker,type=pooledha">
          <attribute name="NumAcceptThreads">1 </attribute>
          <attribute name="MaxPoolSize">300 </attribute>
          <attribute name="ClientMaxPoolSize">300 </attribute>
          <attribute name="SocketTimeout">60000 </attribute>
          <attribute name="ServerBindAddress">${jboss.bind.address} </attribute>
          <attribute name="ServerBindPort">4446 </attribute>
          <attribute name="ClientConnectAddress">${jboss.bind.address} </attribute>
          <attribute name="ClientConnectPort">0 </attribute>
          <attribute name="EnableTcpNoDelay">false </attribute>
          <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager </depends>
          <depends>jboss:service=Naming </depends>
      </mbean>

      <!-- ==================================================================== -->
      <!-- Distributed cache invalidation                                      -->
      <!-- ==================================================================== -->

      <mbean code="org.jboss.cache.invalidation.bridges.JGCacheInvalidationBridge"
          name="jboss.cache:service=InvalidationBridge,type=JavaGroups">
          <attribute name="InvalidationManager">jboss.cache:service=InvalidationManager </attribute>
          <attribute name="PartitionName">${jboss.partition.name:DefaultPartition} </attribute>
          <attribute name="BridgeName">DefaultJGBridge </attribute>
          <depends>jboss:service=${jboss.partition.name:DefaultPartition} </depends>
          <depends>jboss.cache:service=InvalidationManager </depends>
      </mbean>

    </server>
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-06 21:36:569楼 得分:0
    jboss-service.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE server>
    <server>
        <mbean code="org.jboss.web.loadbalancer.scheduler.RoundRobinSchedulerService"
            name="jboss.web.loadbalancer:service=Scheduler">
          <depends>jboss.web:service=WebServer </depends>
          <attribute name="Config">
              <scheduler>
                <!-- Use sticky sessions ? -->
                <sticky-session>false </sticky-session>

                <!-- The name of the session-cookie to use -->
                <sticky-session-cookie-name>JBoss_LB_ID </sticky-session-cookie-name>

                <!-- The list of the target hosts -->
                <hosts>
                  <host>
                      <!-- The URL to use to connect the host. URLs like http://www.xx.yy:8080/ are also allowed -->
                      <host-url>http://192.168.0.16/ </host-url>
                  </host>
                  <host>
                      <host-url>http://192.168.0.238/ </host-url>
                  </host>                         
                 
                </hosts>
              </scheduler>
          </attribute>
        </mbean>

        <mbean code="org.jboss.web.loadbalancer.LoadbalancerService"
            name="jboss.web.loadbalancer:service=Loadbalancer">
          <depends optional-attribute-name="Scheduler">jboss.web.loadbalancer:service=Scheduler </depends>
          <!-- The timeout for a connection from the loadbalancer to a target host in ms -->
          <attribute name="ConnectionTimeout">20000 </attribute>
        </mbean>

        <!-- Monitor Services -->
        <!--  A monitor that only checks that a given path is reachable
        <mbean code="org.jboss.web.loadbalancer.monitor.SimpleMonitorService"
            name="jboss.web.loadbalancer:service=Monitor">
          <depends optional-attribute-name="Scheduler">jboss.web.loadbalancer:service=Scheduler </depends>
          <attribute name="Interval">15000 </attribute>
          <attribute name="Timeout">20000 </attribute>
          <attribute name="Path">/ </attribute>
        </mbean>
        -->
        <!--
          Another monitor that tries to match a regular expression against the
          server response
        <mbean code="org.jboss.web.loadbalancer.monitor.ECVMonitorService"
            name="jboss.web.loadbalancer:service=Monitor">
          <depends optional-attribute-name="Scheduler">jboss.web.loadbalancer:service=Scheduler </depends>
          <attribute name="Interval">15000 </attribute>
          <attribute name="Timeout">20000 </attribute>
          <attribute name="Path">/index.html </attribute>
          <attribute name="RegExp">JBOSS </attribute>
        </mbean>
        -->
    </server>
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-06 21:37:4410楼 得分:0
    jndi.properties:

    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.factory.url.pkgs=org.jboss.naming
    java.naming.provider.url=192.168.0.238:1100
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-10 09:32:0811楼 得分:0
    ...没人能解决这个问题么
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-10 12:36:3512楼 得分:0
    测试的是web集群还是HAJNDI?另外最好把配置情况、测试方法和测试结果的详细信息贴出来,我可以帮你模拟一下
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-10 16:02:1913楼 得分:0
    1、测试的是HAJNDI
    2、测试配置就是上面的那些配置文件
    3、Jboss里面有一个EJB,客户端去调,但是现在只有一个服务器响应,而不是两个都响应,查看启动日志见一楼和五楼
    4、代码:
    服务端EJB类...略
    服务端Clustered.java:
    import org.jboss.ha.framework.interfaces.RoundRobin;

    public @interface Clustered {
        Class loadBalancePolicy() default RoundRobin.class;
        String partition() default "test";
    }
    客户端相关代码:
    private static final String EJBNAME = "ServiceInvokerBean/remote";
    /**
        * 系统初始化
        *
        */
        @SuppressWarnings("unchecked")
    private void init()
        {
            LoggerWrapper.getLogger(this.getClass()).info("初始化开始");
            Properties prop = new Properties();

            try
            {
                InitialContext ctx = new InitialContext(prop);
                IServiceInvoker aProcessor = null;

                    aProcessor = (IServiceInvoker) ctx.lookup(EJBNAME);
                    aProcessorList.add(aProcessor);       
            }
        }
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-10 16:10:0414楼 得分:0
    补充:
    jndi.properties配置是在客户端的引用的服务端jar包中,如下:

    Server.jar
    ¦--com(服务端类包)
    ¦--META-INF
    ¦--jndi.properties


    测试结果的话,就是jndi.prop里面指定的那个IP的服务器响应客户端消息,另外一台不响应
    如果改一下jndi为另一台ip,则还是一台响应
    如果写192.168.0.16:1100,192.168.238:10100
    那么,只有写在前面一台的机器响应,后面一台不响应
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-10 19:52:0515楼 得分:0
    按照集群配置指南的说明,上面的测试结果没有问题。因为HAJNDI的lookup原则是只要集群中有一个节点提供命名服务就会返回。英文说明如下:
    There is no load balancing behavior in the JNP client lookup process. It just goes through the provider list and use the first available server.
    是不是ejb的集群配置可能有问题?
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-11 07:08:2416楼 得分:0

    我客户端是模拟的大并发的情况
    在服务端一次处理的过程中,会有多个客户端请求过来
    这样,服务器A来说,当他正在处理请求时候,又有新的请求过来,这时候,是排队等待他的处理,还是将此请求分配给另外一台闲置的服务器B来处理呢?我觉得应该是分配给服务器B来处理,否则负载岂不是失去了他的意义?
    但是测试结果看到的是A在哪里不停的处理,B却是一动不动


    你说的"ejb的集群配置可能有问题",具体指哪一部分?
    谢谢你的回复
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-11 14:35:1317楼 得分:0
    根据你的描述,我想你的应用中可能使用了ejb的集群。如果是这样的话,则需要在jboss.xml文件中对ejb进行集群的配置
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-11 14:52:2618楼 得分:0
    哦?
    可否详细说说?
    我刚才查了一下,只在%jboss%\server\all\conf下找到了standardjboss.xml文件
    没有看到jboss.xml文件
    请问它应该放在哪里,又怎么配置?

    百拜!
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-11 16:20:3119楼 得分:0
    Bean使用了如下注释

    @Stateless
    @Clustered
    public class ServiceInvokerBean implements IServiceInvokerRemote{
    }

    难道是因为安全问题?
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-11 17:33:5520楼 得分:0
    现在看起来应该是负载均衡没起作用
    查了手头所有的资料,都是指向在%jbossnew%/server/all/deploy/loadbalancer.sar/META-INF/jboss-service.xml中的 <host>节点配置
    看不出来问题阿
    郁闷死
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-11 22:05:4421楼 得分:0
    看资料,全是apache的mod_jk负载介绍
    就没有jboss自身负载介绍
    不过我觉得配置应该没错啊
    真奇怪
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-12 10:41:0122楼 得分:0
    又查了一下http://192.168.0.16:8080/web-control
    在JBoss.Web.loadbalancer下面明明的看到了三个节点
    但是负载就是不起作用,真怪
    要疯掉了
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-12 10:51:4723楼 得分:0
    [[URL=http://192.168.0.16/, State=DOWN, LbFactor=1, Stats=[CurrentConnections=0, Requests=0, AvgResponseTime=0]], [URL=http://192.168.0.232/, State=DOWN, LbFactor=1, Stats=[CurrentConnections=0, Requests=0, AvgResponseTime=0]], [URL=http://192.168.0.224/, State=DOWN, LbFactor=1, Stats=[CurrentConnections=0, Requests=0, AvgResponseTime=0]]]

    555,仔细一看,MBean的状态都是down
    这是怎么回事阿
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-12 23:06:2624楼 得分:0
    1、因为修改了集群partition的名称,所以ejb3的定义为:
    @Stateless
    @Clustered(partition="test")
    public  class  ServiceInvokerBean  implements  IServiceInvokerRemote{
    }
    如果使用的ejb3是rc9版本,最好是在自己应用的/META-INFO目录下创建一个jboss.xml文件,在该文件里进行集群的配置

    2、ejb3的集群是在JBossAOP的基础上实现的,如果有问题,请检查一下ejb3-interceptors-aop.xml是否正确
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-14 11:03:1025楼 得分:0
    启动命令改成
    ./run.sh -c all -Djboss.partition.name=test &
    现在看MBean的状态是UP
    [[URL=http://192.168.0.16/, State=UP, LbFactor=1, Stats=[CurrentConnections=0, Requests=0, AvgResponseTime=0]], [URL=http://192.168.0.224/, State=UP, LbFactor=1, Stats=[CurrentConnections=0, Requests=0, AvgResponseTime=0]], [URL=http://192.168.0.232/, State=UP, LbFactor=1, Stats=[CurrentConnections=0, Requests=0, AvgResponseTime=0]]]

    ejb3-interceptors-aop.xml文件,没做过改动,应该没问题的吧

    但是16那台机器还是没有收到消息
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-14 20:59:3226楼 得分:0
    是web层没有收到测试消息,还是ejb3组件里没有接到消息?
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-15 10:29:5227楼 得分:0

    这里没有web应用,是ejb组件没有收到消息
    客户端loopup到ejb,然后直接调用接口方法

    奇怪的是,我把线上这个环境拷到线下两台机器之后
    直接修改对应的IP,就完全可以负载分发
    是否和端口相关?
    但是我查了涉及到的端口,都是没有问题的
    [root@sz03 bin]# lsof -i :1098
    COMMAND  PID USER  FD  TYPE DEVICE SIZE NODE NAME
    java    14583 root  149u  IPv4 201013      TCP *:1098 (LISTEN)
    问题会在哪里呢?

    另外,我修改jndi.prop配置为
    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.factory.url.pkgs=jboss.naming:org.jnp.interfaces
    jnp.partitionName=test

    之后,客户端会报错如下:
    {java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, jnp.partitionName=test, java.naming.factory.url.pkgs=jboss.naming:org.jnp.interfaces}
    java.lang.IndexOutOfBoundsException: Index: 3, Size: 0
            at java.util.ArrayList.RangeCheck(ArrayList.java:547)
            at java.util.ArrayList.get(ArrayList.java:322)
            at com.a8.tptm.ice.mo.server.MoServerI$TimeOutThread.doEvent(MoServerI.java:331)
            at com.a8.tptm.ice.mo.server.MoServerI$TimeOutThread.sendMoMsg2(MoServerI.java:292)
            at com.a8.tptm.ice.mo.server.MoServerI$TimeOutThread.run(MoServerI.java:276)
    javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
            at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1302)
            at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1419)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at com.a8.tptm.ice.mo.server.MoServerI.init(MoServerI.java:93)
            at com.a8.tptm.ice.mo.server.MoServerI. <init>(MoServerI.java:55)
            at com.a8.tptm.ice.mo.server.MoServer.main(MoServer.java:91)
    Caused by: java.net.SocketTimeoutException: Receive timed out
            at java.net.PlainDatagramSocketImpl.receive0(Native Method)
            at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
            at java.net.DatagramSocket.receive(DatagramSocket.java:712)
            at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1272)
            ... 7 more

    socket连接不上......
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-15 18:00:1028楼 得分:0
    我的妈,看晕了,学习中~~