Oracle Coherence缓存集群

时间:2018-01-20 06:41:14

标签: caching weblogic12c

我们有两个使用两个不同版本的Embedded Coherence Cache的网络应用程序:

  • Coherence 3.7.1的应用程序1(使用Weblogic Server 12.1.2在JDK7环境中运行)
  • 使用Coherence 12.2.1的应用程序2(在带有Weblogic Server 12.2.1的JDK8环境中运行)

每个应用程序部署在不同的weblogic服务器中。我们尝试使用tangosol-override.xml以及此应用程序的集群高速缓存的以下配置:

应用程序1配置:

<?xml version='1.0'?>
<coherence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns="http://xmlns.oracle.com/coherence/coherence-operational-config"
   xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-operational-config coherence-operational-config.xsd">
   <cluster-config>
      <unicast-listener>
            <well-known-addresses>
                <socket-address id="1">
                    <address>10.7.17.31</address>
                    <port>8088</port>
                </socket-address>
                <socket-address id="2">
                    <address>10.7.17.31</address>
                    <port>9099</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>    
   </cluster-config>
  <license-config>
    <edition-name system-property="tangosol.coherence.edition">GE</edition-name>
    <license-mode system-property="tangosol.coherence.mode">prod</license-mode>
  </license-config>
</coherence>

应用程序2配置:

<?xml version='1.0'?>
<coherence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns="http://xmlns.oracle.com/coherence/coherence-operational-config"
   xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-operational-config coherence-operational-config.xsd">
   <cluster-config>
      <unicast-listener>
            <well-known-addresses>
                <socket-address id="1">
                    <address>10.7.17.31</address>
                    <port>8088</port>
                </socket-address>
                <socket-address id="2">
                    <address>10.7.17.31</address>
                    <port>9099</port>
                </socket-address>
            </well-known-addresses>
            <address system-property="tangosol.coherence.localhost">localhost</address>
            <port system-property="tangosol.coherence.localport">9099</port>
            <port-auto-adjust system-property="tangosol.coherence.localport.adjust">true</port-auto-adjust>
      </unicast-listener>    
   </cluster-config>
  <license-config>
    <edition-name system-property="tangosol.coherence.edition">GE</edition-name>
    <license-mode system-property="tangosol.coherence.mode">prod</license-mode>
  </license-config>
</coherence>

但是无法从其他应用程序访问所有缓存。 有什么问题?

1 个答案:

答案 0 :(得分:0)

经过一番研究后,以下解决方案对我有用。我在两个Weblogic服务器的启动脚本中设置了tangosol-override.xml,并删除了与coherence cache相关的其他参数(-Dtangosol.coherence.override = C:\ root \ tangosol-coherence-override.xml)。

tangosol-coherence-override.xml配置文件:

<?xml version='1.0'?>
<coherence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns="http://xmlns.oracle.com/coherence/coherence-operational-config"
   xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-operational-config coherence-operational-config.xsd">
   <cluster-config>
      <member-identity>
      <cluster-name>appclustername</cluster-name>
    </member-identity>
    <multicast-listener>
      <address>224.1.1.1</address>
      <port>12345</port>
    </multicast-listener>
   </cluster-config>
  <license-config>
    <edition-name system-property="tangosol.coherence.edition">GE</edition-name>
    <license-mode system-property="tangosol.coherence.mode">prod</license-mode>
  </license-config>
</coherence>