Реплицированный кеш в ehcache и spring-boot - PullRequest
0 голосов
/ 29 августа 2018

ehcache версии 2.8.3 используется в весенней загрузке. Проверяемый сервер - это сервер A и сервер B на основе Linux. Есть три вида кеша Ниже приведена конфигурация ehcache.xml.

<ehcache> 
    <diskStore path="java.io.tmpdir" /> 

    <cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory" 
        properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1, multicastGroupPort=40001, 
        timeToLive=1 ,replicatePuts=true,replicatePutsViaCopy=true ,replicateUpdates=true ,replicateUpdatesViaCopy=false,
        replicateRemovals=true ,replicateAsynchronously=false"/> 

    <cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" 
        properties="socketTimeoutMillis=2000, port=40001"/> 
    <cache name="aCache" 
            maxElementsInMemory="0" 
            eternal="true" 
            timeToIdleSeconds="0" 
            timeToLiveSeconds="0" 
            overflowToDisk="false"> 

        <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/> 

        <bootstrapCacheLoaderFactory
                class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"
                properties="bootstrapAsynchronously=true"
                propertySeparator="," />    
        <!-- <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory" 
                properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, 
                replicateUpdatesViaCopy=false, replicateRemovals=true"/> --> 
    </cache> 

    <cache name="bCache" 
            maxElementsInMemory="0" 
            eternal="true" 
            timeToIdleSeconds="0" 
            timeToLiveSeconds="0" 
            overflowToDisk="false"> 

        <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>

        <bootstrapCacheLoaderFactory
                class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"
                properties="bootstrapAsynchronously=true"
                propertySeparator="," /> 
    </cache> 

    <cache name="cCache" 
            maxElementsInMemory="0" 
            eternal="true" 
            timeToIdleSeconds="0" 
            timeToLiveSeconds="0" 
            overflowToDisk="false"> 

        <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>

        <bootstrapCacheLoaderFactory
                class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"
                properties="bootstrapAsynchronously=true"
                propertySeparator="," />
    </cache> 
</ehcache> 

Ehcache.xml на сервере A и сервере B вводятся с одинаковыми настройками. Когда я добавляю кеш на сервер A, я хочу видеть кеш, добавленный на сервер B

Будут отображены только следующие журналы, но Сервер B не смог проверить добавленный кеш.

[Поток получателя многоадресного пульса] DEBUG n.s.e.d.MulticastKeepaliveHeartbeatReceiver - получено rmiUrls //192.168.10.20:40001/aCache|//192.168.10.20:40001/bCache|//192.168.10.20:4008/cache

Если вы знаете, как, пожалуйста, дайте мне знать.

...