2011-06-08 137 views
2

我对oracle的一致性并不熟悉,并尝试使用POC将coherence用作我们应用程序的分布式缓存。这是在我的开发环境中,我正尝试使用两个一致性客户端实例进行集群设置。 我所做的更改是创建tangosol_coherence_override.xmlcoherence-cache-config.xml 下面是详细信息。Coherence集群配置

正如用户指南中所建议的,当我启动默认缓存服务器的一个实例和两个一致性实例时,它们不会群集,在一个连贯性上在控制台上所做的更改不会反映在另一个实例上。

我所做的更改是设置单播地址和端口,配置群集名称和端口。 任何指针或示例配置文件都会有所帮助。 我的机器的IP - 10.209.14.17

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 system-property="tangosol.coherence.cluster">GR</cluster-name> 
     </member-identity> 


     <unicast-listener> 
     <address system-property="tangosol.coherence.localhost">10.209.14.17 
     </address> 
     <port system-property="tangosol.coherence.localport">8090</port> 
     <port-auto-adjust system-property="tangosol.coherence.localport.adjust"> 
      true 
     </port-auto-adjust> 
     </unicast-listener> 
    <multicast-listener> 
     <address>224.3.7.0</address> 
     <port>4280</port> 
     <time-to-live>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> 

一致性缓存-config.xml中

<?xml version="1.0"?> 

<cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config" 
    xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config 
    coherence-cache-config.xsd"> 
    <caching-scheme-mapping> 
     <cache-mapping> 
     <cache-name>voCache</cache-name> 
     <scheme-name>distributed</scheme-name> 
     </cache-mapping> 
    </caching-scheme-mapping> 

    <caching-schemes> 
     <distributed-scheme> 
     <scheme-name>distributed</scheme-name> 
     <service-name>DistributedCache</service-name> 
     <backing-map-scheme> 
      <local-scheme/> 
     </backing-map-scheme> 
     <autostart>true</autostart> 
     </distributed-scheme> 
    </caching-schemes> 
</cache-config> 
+0

经过进一步分析,我可以解决此问题,但我的网络未启用多播。我可以使用作为一致性一部分提供的多播测试脚本来验证它。所以我在单播侦听器中添加了WKA,然后缓存实例开始加入同一个集群。 – 2011-06-09 15:56:55

+0

仅供参考,Stack Overflow允许您为自己的问题提供一个答案,如果您认为这对其他人有帮助。只需在底部的框中​​键入或粘贴答案,然后单击“发布答案”即可。 – 2013-01-14 21:20:30

回答