1
我有一個Jboss Wildfly 8.0.0集羣,主站和一個從站。 Ehcache配置爲使用手動選項進行RMI複製。Ehcache RMI複製只能以一種方式運行
問題是複製只發生在一個方向上。從主機到從機Jboss的複製工作正常。 從屬Jboss沒有複製到主JBoss。
我使用Jconsole驗證緩存的詳細信息,我可以看到單向複製。我可以看到主服務器和從服務器都創建了緩存,問題是單向複製。
我的主Jboss位於VM Windows服務器2012,從屬JBoss位於Windows 8.0桌面 我在JBoss控制檯中看不到任何錯誤。
在萬事達ehcache.xml中:
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual,
rmiUrls=//myslave:40002/userAddress"/>
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="port=40001,
socketTimeoutMillis=30000"/>
<cache name="userAddress" eternal="true" overflowToDisk="true" maxEntriesLocalHeap="1" memoryStoreEvictionPolicy="LRU" >
<cacheEventListenerFactory
class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true,
replicateUpdatesViaCopy=false, replicateRemovals=true "/>
</cache>
在從屬ehcache.xml中:
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual,
rmiUrls=//mymaster:40001/userAddress"/>
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="port=40002,
socketTimeoutMillis=30000"/>
<cache name="userAddress" eternal="true" overflowToDisk="true" maxEntriesLocalHeap="1" memoryStoreEvictionPolicy="LRU" >
<cacheEventListenerFactory
class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true,
replicateUpdatesViaCopy=false, replicateRemovals=true "/>
</cache>