当前位置: 首页 > 工具软件 > Coherence > 使用案例 >

java coherence_coherence配置说明

万英武
2023-12-01

tangosol-coherence.xml---提供了operational 和run-time设置,用来创建和配置cluster,通讯和数据管理服务。这个文件通常被称为operational deployment descriptor。

。。。。

tangosol-coherence-override-dev.xml---当Coherence启动在dev模式时,这个文件覆盖了tangosol-coherence.xml文件的operational 设置。Coherence启动默认是dev 模式,这个文件中的设置会被使用。

。。。。

tangosol-coherence-override-eval.xml---当Coherence启动在eval模式时,这个文件覆盖了在tangosol-coherence.xml文件的operational 设置。

。。。。

tangosol-coherence-override-prod.xml---当Coherence启动在prod模式时,这个文件覆盖了在tangosol-coherence.xml文件的operational 设置。

。。。。

默认,使用tangosol-coherence-override.xml这个文件覆盖jar包中的配置,我们可以在自己的项目中加一个tangosol-coherence-override.xml,然后将它加入到classpath中,也可以设置tangosol.coherence.override系统参数指定xml文件,使用coherence不可避免要用集群,以上就是集群的相关配置文件

coherence-cache-config.xml---定义在cluster中使用的缓存名称、策略等,我们可以在classpath中添加coherence-cache-config.xml,或者在tangosol-coherence-override.xml中配置

com.tangosol.net.DefaultConfigurableCacheFactory

java.lang.String

coherence-cache-my.xml

或者,设置tangosol.coherence.cacheconfig系统参数指定配置

coherence-pof-config.xml---我们可以在classpath中添加coherence-pof-config.xml,或者设置tangosol.pof.config系统参数指定配置

Management configuration files 一个用来配置coherence management reports的文件集合。这些文件在coherence.jar库的/reports目录里。文件包含了一组配置文件的报 告(report-group.xml。默认的),参考了许多的报告定义文件。 每个报告定义文件的结果是创建一个报告文件,该文件显示管理信息基于特定的一组度量。

2. 配置集群

在tangosol-coherence-override.xml中简单配置集群名称,成员名称,组播/单播地址,缓存配置等:

ProductClusterV3

ctas-node

10.6.53.83

23401

10.6.53.83

23403

10.6.53.84

23401

10.6.53.84

23403

224.3.3.1

35301

4

10000

com.tangosol.net.DefaultConfigurableCacheFactory

java.lang.String

coherence-cache-config.xml

单播要比组播的优先级高,一个集群应该保证名称,组播ip和端口一样,成员节点名称(member-name)可以一样,因为要确定一个节点还有好多其他信息(site-name、machine-name、process-name、role-name等)会默认设置的

实践证明:要想使用自定义配置文件,配置文件的classpath要优先于jar包,否则不会生效,千万注意

 类似资料: