Configuration Weblogic群集配置

Configuration Weblogic群集配置,configuration,weblogic,cluster-computing,jdeveloper,Configuration,Weblogic,Cluster Computing,Jdeveloper,我正在用jdeveloper11.1.1.6.0开发一个应用程序。当我试图从应用程序内的集群连接到weblogic服务器时,我的客户端应用程序出现问题。我想调用的某个服务在此服务器上运行 情况如下: 有一个weblogic实例,我现在无法更改它的配置。weblogic实例具有以下服务器和群集: 管理服务器AS-(在机器M1上运行)URL:A,端口:1-连接的URLt3://A:1 C组包含: 服务器S1-(在机器M1上运行)URL:A,端口:2-使用数据库D1-URL进行连接t3://A:2

我正在用jdeveloper11.1.1.6.0开发一个应用程序。当我试图从应用程序内的集群连接到weblogic服务器时,我的客户端应用程序出现问题。我想调用的某个服务在此服务器上运行

情况如下:

有一个weblogic实例,我现在无法更改它的配置。weblogic实例具有以下服务器和群集:

  • 管理服务器AS-(在机器M1上运行)URL:A,端口:1-连接的URLt3://A:1
  • C组包含:
    • 服务器S1-(在机器M1上运行)URL:A,端口:2-使用数据库D1-URL进行连接t3://A:2
    • 服务器S2-(在机器M2上运行)URL:B,端口:1-使用数据库D2-URL进行连接t3://B:1
    • 服务器S3-(在机器M2上运行)URL:B,端口:2-使用数据库D2-URL进行连接t3://B:2
我正在尝试连接到t3://A:2,而不是连接到集群或其他两台服务器中的任何一台。但是,它每三次工作一次,可能是因为集群中有三台服务器。集群使用单播进行消息传递,使用循环关联进行负载平衡

我正试图找出这是什么原因。我是否可以在运行客户端应用程序的weblogic配置中更改某些内容(集成或独立)?或者必须更改服务器群集实例的配置设置

提前谢谢你

致意

(23.05.2013) 编辑:

在所描述的场景中,我们使用普通JNDI查找来访问远程服务器上的EJB

Context ctx=新的InitialContext()

对象o=ctx.lookup(…)

jndi.properties:

java.naming.provider.url=t3://A:2 java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory

通过将属性PIN_设置为_PRIMARY_server,似乎可以将JNDI请求发送到正确的服务器。然而,后续的ejb请求仍然使用循环路由到整个集群


我们可以在客户端做些什么来改变这种行为,以便始终使用url t3://A:2对特定服务器进行寻址吗?

我也遇到了类似的问题,在尝试更改InvocationContext环境属性之后,我发现我的运气很差。相反,我必须为我的无状态会话bean更改weblogic ejb jar.xml

String destination = "t3://node-alpha:2010";
Hashtable<String, String> env = new Hashtable<String, String>();
env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put( Context.PROVIDER_URL, destination );
// env.put( weblogic.jndi.WLContext.ENABLE_SERVER_AFFINITY, "true" );
// env.put( weblogic.jndi.WLContext.PIN_TO_PRIMARY_SERVER, "true" );
InitialContext ctx = new InitialContext( env );

EJBHome home = (EJBHome) ctx.lookup( JNDI_REMOTE_SYSTEM_SF );
sf = SomeSf.class.cast( home.getClass().getMethod( "create" ).invoke( home ) );

// Check that we are hitting the right server node.
System.out.println( destination + " => " + sf );

home可聚集时
&
无状态bean可聚集时
设置为false


下面是weblogic-ejb-jar.xml示例

<weblogic-ejb-jar>
  <weblogic-enterprise-bean>
    <ejb-name>SomeSf</ejb-name>
    <stateless-session-descriptor>
      <pool>
        <max-beans-in-free-pool>42</max-beans-in-free-pool>
      </pool>
      <stateless-clustering>
        <home-is-clusterable>false</home-is-clusterable>
        <stateless-bean-is-clusterable>false</stateless-bean-is-clusterable>
        <stateless-bean-methods-are-idempotent>true</stateless-bean-methods-are-idempotent>
      </stateless-clustering>
    </stateless-session-descriptor>
    <transaction-descriptor>
      <trans-timeout-seconds>20</trans-timeout-seconds>
    </transaction-descriptor>
    <enable-call-by-reference>true</enable-call-by-reference>
    <jndi-name>SomeSf</jndi-name>
  </weblogic-enterprise-bean>
</weblogic-ejb-jar>

一些
42
假的
假的
真的
20
真的
一些

我也遇到了类似的问题,在尝试更改InvocationContext环境属性后,我发现自己运气很差。相反,我必须为我的无状态会话bean更改weblogic ejb jar.xml

String destination = "t3://node-alpha:2010";
Hashtable<String, String> env = new Hashtable<String, String>();
env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put( Context.PROVIDER_URL, destination );
// env.put( weblogic.jndi.WLContext.ENABLE_SERVER_AFFINITY, "true" );
// env.put( weblogic.jndi.WLContext.PIN_TO_PRIMARY_SERVER, "true" );
InitialContext ctx = new InitialContext( env );

EJBHome home = (EJBHome) ctx.lookup( JNDI_REMOTE_SYSTEM_SF );
sf = SomeSf.class.cast( home.getClass().getMethod( "create" ).invoke( home ) );

// Check that we are hitting the right server node.
System.out.println( destination + " => " + sf );

home可聚集时
&
无状态bean可聚集时
设置为false


下面是weblogic-ejb-jar.xml示例

<weblogic-ejb-jar>
  <weblogic-enterprise-bean>
    <ejb-name>SomeSf</ejb-name>
    <stateless-session-descriptor>
      <pool>
        <max-beans-in-free-pool>42</max-beans-in-free-pool>
      </pool>
      <stateless-clustering>
        <home-is-clusterable>false</home-is-clusterable>
        <stateless-bean-is-clusterable>false</stateless-bean-is-clusterable>
        <stateless-bean-methods-are-idempotent>true</stateless-bean-methods-are-idempotent>
      </stateless-clustering>
    </stateless-session-descriptor>
    <transaction-descriptor>
      <trans-timeout-seconds>20</trans-timeout-seconds>
    </transaction-descriptor>
    <enable-call-by-reference>true</enable-call-by-reference>
    <jndi-name>SomeSf</jndi-name>
  </weblogic-enterprise-bean>
</weblogic-ejb-jar>

一些
42
假的
假的
真的
20
真的
一些

像t3://A:2那样直接连接应该可以工作。。。当它失败时,您是否会收到某种错误消息,您可以发布?我可以在集群中的特定计算机上点击WSDLs/代理,没有任何问题。没有错误消息。我只是在循环中被路由到另外两个服务器。每三次连接到我想连接的那个。我支持这一点,因为集群的管理服务器和我想要访问的服务器位于同一台机器和URL上(只是端口号不同)。是不是我的集成weblogic与客户端应用程序错误地连接到集群,因此路由到三个应用程序之一?谢谢。也许可以编辑你的帖子,输入一些关于你如何连接的代码,或者你到底想做什么?是JMS吗?它是WSDL吗?等等。我们已经发布了关于我们环境的信息。谢谢。根据这些信息:我不确定你能做你想做的事。“WebLogic Server中的上下文工厂可以选择集群中最适合客户端的WebLogic服务器”除非您将特定部署定位到单个节点,否则WebLogic将继续在集群中对您进行循环。为什么需要使用特定的服务器?如果您只想在一个节点上提供服务,请更改目标。像t3://A:2这样直接连接应该可以正常工作。。。当它失败时,您是否会收到某种错误消息,您可以发布?我可以在集群中的特定计算机上点击WSDLs/代理,没有任何问题。没有错误消息。我只是在循环中被路由到另外两个服务器。每三次连接到我想连接的那个。我支持这一点,因为集群的管理服务器和我想要访问的服务器位于同一台机器和URL上(只是端口号不同)。是不是我的集成weblogic与客户端应用程序错误地连接到集群,因此路由到三个应用程序之一?谢谢。也许可以编辑你的帖子,输入一些关于你如何连接的代码,或者你到底想做什么?是JMS吗?它是WSDL吗?等等。我们已经发布了关于我们环境的信息。谢谢。根据这些信息:我不确定你能做你想做的事。“WebLogic Server中的上下文工厂可以选择集群中最适合客户端的WebLogic服务器”除非您将特定部署定位到单个节点,否则WebLogic将继续在集群中对您进行循环。为什么需要使用特定的服务器?如果你只想要se