Not able to connect coherence cluster from web application

隐身守侯 提交于 2019-12-11 17:45:33

问题


I have a web application which is running on Websphere application server 8.5. I have coherence cluster server running on the WebLogic. I want to connect this web application to join the coherence cluster. I get the error shown blow:

[4/22/14 14:29:40:119 CDT] 00000074 SystemErr     R 2014-04-22 14:29:40.119/94.607 Oracle Coherence GE 12.1.2.0.0 <Info> (thread=WebContainer : 0, member=n/a): Loaded cache configuration from "file:/C:/IBM/WebSphere/AppServer/profiles/AppSrvJDK7/installedApps/Machine01Node02Cell/single-sign-on-coherence-ear.ear/single-sign-on-coherence-WAR1.0.war/WEB-INF/classes/coherence-cache-config.xml"
    [4/22/14 14:29:40:503 CDT] 00000074 SystemErr     R 2014-04-22 14:29:40.503/94.991 Oracle Coherence GE 12.1.2.0.0 <Info> (thread=WebContainer : 0, member=n/a): Created cache factory com.tangosol.net.ExtensibleConfigurableCacheFactory
    [4/22/14 14:29:41:114 CDT] 00000074 SystemErr     R 2014-04-22 14:29:41.114/95.602 Oracle Coherence GE 12.1.2.0.0 <D4> (thread=WebContainer : 0, member=n/a): TCMP bound to /172.17.108.156:8088 using SystemDatagramSocketProvider
[4/22/14 14:30:11:661 CDT] 00000074 SystemErr     R 2014-04-22 14:30:11.660/126.148 Oracle Coherence GE 12.1.2.0.0 <Warning> (thread=Cluster, member=n/a): Delaying formation of a new cluster; waiting for well-known nodes to respond

Below is my override xml file:

<?xml version="1.0" encoding="UTF-8"?>
<coherence
    xmlns="http://xmlns.oracle.com/coherence/coherence-operational-config"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-operational-config http://xmlns.oracle.com/coherence/coherence-operational-config/1.2/coherence-operational-config.xsd">

    <cluster-config>
        <member-identity>
            <cluster-name system-property="tangosol.coherence.cluster">defaultCoherenceCluster</cluster-name>
            <member-name system-property="tangosol.coherence.member">wls_cluster_1</member-name>
            <role-name system-property="tangosol.coherence.role">CacheClient</role-name>
        </member-identity>
        <unicast-listener>

            <well-known-addresses>
                <socket-address id="1">
                    <address>127.0.0.1</address>
                    <port>7003</port>
                </socket-address>
                <socket-address id="2">
                    <address>127.0.0.1</address>
                    <port>7006</port>
                </socket-address>
            </well-known-addresses>
            <!--    
            <address system-property="tangosol.coherence.localhost">localhost</address>
            <port system-property="tangosol.coherence.localport">8088</port>
            <port-auto-adjust system-property="tangosol.coherence.localport.adjust">
                true
            </port-auto-adjust>
            -->

        </unicast-listener>
        <multicast-listener>
            <time-to-live system-property="tangosol.coherence.ttl">0</time-to-live>
        </multicast-listener>
    </cluster-config>
    <configurable-cache-factory-config>
        <init-params>
            <init-param>
                <param-type>java.lang.String</param-type>
                <param-value system-property="tangosol.coherence.cacheconfig">coherence-cache-config.xml
                </param-value>
            </init-param>
        </init-params>
    </configurable-cache-factory-config>
</coherence>

From the error, I can see that the web application is not able to connect to the WKA. Can some one help me on what could be cause that I am not able to connect? I have verified that the cluster is up & running.


回答1:


Can you provide your websphare startup script? Basically you needs to pass both localhost and port in your start script using -D option.




回答2:


You need to pass the hosts and ports as JVM arguments in the startup script of both Weblogic and websphere server provided both the machines where all the JVM are present, must have proper connection each other. JVM arguments should contain both weblogic and webshpere hosts and ports. So that, both servers can identify the other members from JVMs. Example arguments:

COHERENCE_L_HOST="-Dtangosol.coherence.localhost=localhost"
COHERENCE_L_PORT="-Dtangosol.coherence.localport=8080"
COHERENCE_W_HOST1="-Dtangosol.coherence.wka.host.1=localhost"
COHERENCE_W_PORT1="-Dtangosol.coherence.wka.port.1=8085"
COHERENCE_W_HOST2="-Dtangosol.coherence.wka.host.2=localhost"
COHERENCE_W_PORT2="-Dtangosol.coherence.wka.port.2=8089"
COHERENCE_W_HOST3="-Dtangosol.coherence.wka.host.3=localhost"
COHERENCE_W_PORT3="-Dtangosol.coherence.wka.port.3=8090"


来源:https://stackoverflow.com/questions/23229240/not-able-to-connect-coherence-cluster-from-web-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!