一致性集群配置

发布于 2024-11-14 14:01:15 字数 3130 浏览 7 评论 0原文

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

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

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

coherence-cache-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>

I am new to oracle coherence and trying out a POC to use coherence as a distributed cache for our application. This is in my dev environment, I am trying to have a clustered setup with two coherence client instances.
The changes I did was to create tangosol_coherence_override.xml and coherence-cache-config.xml
Below are the details present.

As suggested in the user guide when i start one instance of default cache server and two instances of coherence, they are not clustered, changes made on console on one coherence does not reflect on the other.

The changes I did was to set a unicast address and port, configure the cluster name and port.
Any pointers or sample configuration files would help.
My machine 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>

coherence-cache-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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文