我有以下设置用于开发环境:

  • Weblogic 12.1.3(仅限管理服务器,在docker容器中),我在其上配置名为 mycluster 的coherence集群,多播侦听地址 224.12.1.3 和多播侦听端口 12130 . 在服务器级别,我将一致性配置为禁用本地存储 .

  • 独立的一致性服务器(在docker容器中运行),具有与上面相同的配置,但启用了本地存储,并且缓存配置:

<caching-scheme-mapping>

    <cache-mapping>
        <cache-name>MyBusinessObjectCache</cache-name>
        <scheme-name>MyBusinessObjectDistributed</scheme-name>
        <init-params>
            <init-param>
                <param-name>entityname</param-name>
                <param-value>com.mycompany.BusinessObject</param-value>
            </init-param>
        </init-params>
    </cache-mapping>
</caching-scheme-mapping>

<caching-schemes>
    <distributed-scheme>
        <scheme-name>MyBusinessObjectDistributed</scheme-name>
        <service-name>QueryCacheDistributedCache</service-name>
        <serializer>java</serializer>
        <local-storage>true</local-storage>

        <backing-map-scheme>
            <read-write-backing-map-scheme>
                <internal-cache-scheme>
                    <local-scheme> 
                        <high-units>{size-limit 0}</high-units>
                    </local-scheme>
                </internal-cache-scheme>
                <miss-cache-scheme>
                    <local-scheme>
                        <expiry-delay>{expiry-delay 0}</expiry-delay>
                    </local-scheme>
                </miss-cache-scheme>
            </read-write-backing-map-scheme>

        </backing-map-scheme>

        <autostart>true</autostart>
    </distributed-scheme>
</caching-schemes>

我先启动独立的coherence服务器,然后启动weblogic服务器 . 在日志中我可以看到:

java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

2017-02-09 14:54:59.501/1.023 Oracle Coherence 12.1.3.0.0 <Info> (thread=main, member=n/a): Loaded operational configuration from "jar:file:/home/oracle/coherence/lib/coherence.jar!/tangosol-coherence.xml"
2017-02-09 14:54:59.704/1.226 Oracle Coherence 12.1.3.0.0 <Info> (thread=main, member=n/a): Loaded operational overrides from "jar:file:/home/oracle/coherence/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
2017-02-09 14:54:59.704/1.227 Oracle Coherence 12.1.3.0.0 <Info> (thread=main, member=n/a): Loaded operational overrides from "file:/home/oracle/coherence/coherence-config/tangosol-coherence-override.xml"
2017-02-09 14:54:59.716/1.238 Oracle Coherence 12.1.3.0.0 <D5> (thread=main, member=n/a): Optional configuration override "cache-factory-config.xml" is not specified
2017-02-09 14:54:59.716/1.238 Oracle Coherence 12.1.3.0.0 <D5> (thread=main, member=n/a): Optional configuration override "cache-factory-builder-config.xml" is not specified
2017-02-09 14:54:59.718/1.240 Oracle Coherence 12.1.3.0.0 <D5> (thread=main, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified

Oracle Coherence Version 12.1.3.0.0 Build 52031
 Grid Edition: Development mode
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

2017-02-09 14:55:00.142/1.664 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=main, member=n/a): Loaded cache configuration from "file:/home/oracle/coherence/coherence-config/my-cache-config.xml"
2017-02-09 14:55:01.075/2.597 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=main, member=n/a): Created cache factory com.tangosol.net.ExtensibleConfigurableCacheFactory
2017-02-09 14:55:01.574/3.096 Oracle Coherence GE 12.1.3.0.0 <Warning> (thread=main, member=n/a): UnicastUdpSocket failed to set receive buffer size to 16 packets (1MB); actual size is 20%, 3 packets (208KB). Consult your OS documentation regarding increasing the maximum socket buffer size. Proceeding with the actual value may cause sub-optimal performance.
2017-02-09 14:55:01.577/3.099 Oracle Coherence GE 12.1.3.0.0 <Warning> (thread=main, member=n/a): PreferredUnicastUdpSocket failed to set receive buffer size to 1444 packets (2MB); actual size is 10%, 146 packets (208KB). Consult your OS documentation regarding increasing the maximum socket buffer size. Proceeding with the actual value may cause sub-optimal performance.
2017-02-09 14:55:01.578/3.100 Oracle Coherence GE 12.1.3.0.0 <D4> (thread=main, member=n/a): TCMP bound to /172.17.0.2:8088 using SystemDatagramSocketProvider
2017-02-09 14:55:01.578/3.100 Oracle Coherence GE 12.1.3.0.0 <Warning> (thread=main, member=n/a): MulticastUdpSocket failed to set receive buffer size to 16 packets (1MB); actual size is 20%, 3 packets (208KB). Consult your OS documentation regarding increasing the maximum socket buffer size. Proceeding with the actual value may cause sub-optimal performance.
2017-02-09 14:55:04.966/6.489 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=Cluster, member=n/a): Created a new cluster "mycluster" with Member(Id=1, Timestamp=2017-02-09 14:55:01.688, Address=172.17.0.2:8088, MachineId=9891, Location=site:,machine:910563194c6a,process:10, Role=CoherenceServer, Edition=Grid Edition, Mode=Development, CpuCount=1, SocketCount=1)
2017-02-09 14:55:04.968/6.498 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=main, member=n/a): Started cluster Name=mycluster

Group{Address=224.12.1.3, Port=12130, TTL=4}

MasterMemberSet(
  ThisMember=Member(Id=1, Timestamp=2017-02-09 14:55:01.688, Address=172.17.0.2:8088, MachineId=9891, Location=site:,machine:910563194c6a,process:10, Role=CoherenceServer)
  OldestMember=Member(Id=1, Timestamp=2017-02-09 14:55:01.688, Address=172.17.0.2:8088, MachineId=9891, Location=site:,machine:910563194c6a,process:10, Role=CoherenceServer)
  ActualMemberSet=MemberSet(Size=1
    Member(Id=1, Timestamp=2017-02-09 14:55:01.688, Address=172.17.0.2:8088, MachineId=9891, Location=site:,machine:910563194c6a,process:10, Role=CoherenceServer)
    )
  MemberId|ServiceVersion|ServiceJoined|MemberState
    1|12.1.3|2017-02-09 14:55:01.688|JOINED
  RecycleMillis=1200000
  RecycleSet=MemberSet(Size=0
    )
  )

TcpRing{Connections=[]}
IpMonitor{Addresses=0, Timeout=15s}

2017-02-09 14:55:05.027/6.550 Oracle Coherence GE 12.1.3.0.0 <D5> (thread=Invocation:Management, member=1): Service Management joined the cluster with senior service member 1
2017-02-09 14:55:05.082/6.605 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=main, member=1): Loaded Reporter configuration from "jar:file:/home/oracle/coherence/lib/coherence.jar!/reports/report-group.xml"
2017-02-09 14:55:05.533/7.055 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=NameService:TcpAcceptor, member=1): TcpAcceptor now listening for connections on 172.17.0.2:8088.3
2017-02-09 14:55:05.933/7.455 Oracle Coherence GE 12.1.3.0.0 <D5> (thread=DistributedCache:QueryCacheDistributedCache, member=1): Service QueryCacheDistributedCache joined the cluster with senior service member 1
2017-02-09 14:55:06.023/7.545 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=main, member=1):
Services
  (
  ClusterService{Name=Cluster, State=(SERVICE_STARTED, STATE_JOINED), Id=0, Version=12.1.3, OldestMemberId=1}
  InvocationService{Name=Management, State=(SERVICE_STARTED), Id=2, Version=12.1.3, OldestMemberId=1}
  PartitionedCache{Name=QueryCacheDistributedCache, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=0, BackupPartitions=0, CoordinatorId=1}
  )

Started DefaultCacheServer...

2017-02-09 14:55:06.056/7.578 Oracle Coherence GE 12.1.3.0.0 <D5> (thread=DistributedCache:QueryCacheDistributedCache, member=1): This member has become the distribution coordinator for MemberSet(Size=1
  Member(Id=1, Timestamp=2017-02-09 14:55:01.688, Address=172.17.0.2:8088, MachineId=9891, Location=site:,machine:910563194c6a,process:10, Role=CoherenceServer)
  )
2017-02-09 15:07:09.148/730.670 Oracle Coherence GE 12.1.3.0.0 <D5> (thread=Cluster, member=1): Member(Id=2, Timestamp=2017-02-09 15:07:08.979, Address=172.17.0.3:7201, MachineId=19872, Location=site:,machine:cd620a81ee0b,process:58,member:AdminServer, Role=WeblogicServer) joined Cluster with senior member 1
2017-02-09 15:07:09.447/730.969 Oracle Coherence GE 12.1.3.0.0 <D5> (thread=Invocation:Management, member=1): Member 2 joined Service Management with senior member 1

所以我假设weblogic和独立的一致性服务器之间的通信是正常的,因为weblogic能够加入集群 .

现在我将EAR部署到包含GAR(myapp-coherence.gar)的weblogic,其配置如下:

相干性的application.xml

<?xml version="1.0"?>
    <coherence-application
       xmlns="http://xmlns.oracle.com/weblogic/coherence-application">
       <cache-configuration-ref>META-INF/my-cache-config.xml</cache-configuration-ref>
    </coherence-application>

我的缓存-config.xml中

<?xml version="1.0"?>
<!DOCTYPE cache-config SYSTEM "cache-config.dtd">
<cache-config>

    <caching-scheme-mapping>
        <cache-mapping>
            <cache-name>MyBusinessObjectCache</cache-name>
            <scheme-name>MyBusinessObjectDistributed</scheme-name>
        </cache-mapping>
    </caching-scheme-mapping>


    <caching-schemes>
        <distributed-scheme>
            <scheme-name>MyBusinessObjectDistributed</scheme-name>
            <service-name>QueryCacheDistributedCache</service-name>
            <serializer>java</serializer>
            <local-storage>false</local-storage>
            <autostart>true</autostart>
        </distributed-scheme>
    </caching-schemes>
</cache-config>

当应用程序尝试访问缓存时,我收到此错误:

com.tangosol.net.RequestPolicyException: No storage-enabled nodes exist for service myapp-coherence:QueryCacheDistributedCache
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap.onMissingStorage(PartitionedCache.CDB:27)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap.ensureRequestTarget(PartitionedCache.CDB:68)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap.sendPartitionedRequest(PartitionedCache.CDB:31)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap.size(PartitionedCache.CDB:13)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap$Values.size(PartitionedCache.CDB:1)
        at com.tangosol.coherence.component.util.Collections.toArray(Collections.CDB:4)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap$Values.toArray(PartitionedCache.CDB:7)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap$Values.toArray(PartitionedCache.CDB:1)

我真的不会错过.2708087 . 我注意到的只是它似乎访问服务或缓存名称 myapp-coherence:QueryCacheDistributedCache 但只有 QueryCacheDistributedCache . 然而,我不重要,或者如果是,我怎么能解决它 . 任何帮助,将不胜感激 .