[Clustering/JBoss] - Re: Cluster setup
by bstansberry@jboss.com
"krishnan366" wrote :
| i) but in the jboss cache displays the message
|
| anonymous wrote : WARN [TxInterceptor] Commit failed. Clearing stale locks.
|
| And the cache data is not available in the database.Is this error because of the loop back adapter?
If the two nodes are properly forming a cluster, then your loopback adaptor setup looks to be working. Which reduces the likelihood that it's the cause of your problem.
Beyond that, you'd need to give a lot more information on the problem than the above to expect any kind of diagnosis.
anonymous wrote :
| 2) how is setting up a loop back adaptor different from using 2 ip address of the localhost(one LAN IP and the otherone for the wireless) . Without the loop hole adaptor , cluster does not get formed.
|
If you use two different IPs associated with different NICs you need to add a mulitcast route to your routing table.
Also, as an FYI to anyone reading this, using localhost as one node's address and an IP on another adapter for the other address will not work on Windows.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215734#4215734
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215734
15 years, 10 months
[JBoss Cache: Core Edition] - Re: ExpirationPolicy & ClusteredCacheLoader
by lovelyliatroim
Sorry for the delay only getting back to this now.
Here is the a test case that i wrote
| @Test public void testFileLoader() throws InterruptedException{
| String persistentCache = CMDSJUnitUtil.getPersistentCache();
| CacheFactory factory = new DefaultCacheFactory();
| Cache cache = factory.createCache(persistentCache);
| cache.create();
| cache.start();
|
| Map<String, String> testData = new HashMap<String,String>();
| testData.put("FirstName", "James");
| testData.put("Surname", "Bond");
| long expirationTime = 15000;
| Fqn path = Fqn.fromString("/testData/bond/james");
| cache.put(path, testData);
| long future = System.currentTimeMillis() + expirationTime;
| cache.put(path,ExpirationConfiguration.EXPIRATION_KEY, future);
|
| Thread.sleep(expirationTime + 5000);
| Map data = cache.getData(path);
| assertNull("Node should have been evicted "+data,data);
|
| //Re-add the node to test for restart case
| cache.put(path, testData);
| future = System.currentTimeMillis() + expirationTime;
| cache.put(path,ExpirationConfiguration.EXPIRATION_KEY, future);
|
|
| System.out.println("About to stop cache");
| cache.stop();
| cache.destroy();
|
| System.out.println("About to start cache");
| cache.create();
| cache.start();
|
| data = cache.getData(path);
| System.out.println("Data = "+data);
|
| Thread.sleep(expirationTime + 5000);
|
| data = cache.getData(path);
| assertNull("Node should have been evicted",data);
| }
|
|
This interesting enough actually fails at the very first assert. The cache is configured to use the berkeley DB cache loader. Config is like so
| <server>
|
| <!-- ==================================================================== -->
| <!-- PERSISTENT CACHE CONFIG -->
| <!-- ==================================================================== -->
|
| <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
| name="jboss.cache:service=CMDSPersistentCache">
|
| <depends>jboss:service=Naming</depends>
| <depends>jboss:service=TransactionManager</depends>
|
| <!--
| Configure the TransactionManager
|
| <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
| </attribute>
| -->
|
|
|
| <!--
| Node locking level : SERIALIZABLE
| REPEATABLE_READ (default)
| READ_COMMITTED
| READ_UNCOMMITTED
| NONE
| -->
| <attribute name="IsolationLevel">NONE</attribute>
|
| <!--
| Valid modes are LOCAL
| REPL_ASYNC
| REPL_SYNC
| INVALIDATION_ASYNC
| INVALIDATION_SYNC
| -->
| <attribute name="CacheMode">LOCAL</attribute>
|
| <!-- Name of cluster. Needs to be the same for all clusters, in order
| to find each other
| -->
| <attribute name="ClusterName">Cluster</attribute>
|
| <!-- JGroups protocol stack properties NOT NEEDED since CacheMode is LOCAL -->
|
| <!--
| The max amount of time (in milliseconds) we wait until the
| state (ie. the contents of the cache) are retrieved from
| existing members in a clustered environment
| -->
| <attribute name="StateRetrievalTimeout">20000</attribute>
|
| <!--
| Number of milliseconds to wait until all responses for a
| synchronous call have been received.
| -->
| <attribute name="SyncReplTimeout">20000</attribute>
|
| <attribute name="FetchInMemoryState">false</attribute>
|
|
|
| <!-- Max number of milliseconds to wait for a lock acquisition -->
| <attribute name="LockAcquisitionTimeout">15000</attribute>
|
| <!-- Specific eviction policy configurations. -->
| <attribute name="EvictionPolicyConfig">
| <config>
| <attribute name="wakeUpIntervalSeconds">2</attribute>
| <attribute name="eventQueueSize">200000</attribute>
| <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
| <region name="/_default_">
| <attribute name="maxNodes">100</attribute>
| <attribute name="maxAgeSeconds">1</attribute>
| <attribute name="timeToLiveSeconds">1</attribute>
| </region>
|
| <region name="/testData" policyClass="org.jboss.cache.eviction.ExpirationPolicy" >
| <attribute name="maxNodes">10</attribute>
| </region>
|
| </config>
| </attribute>
|
|
| <attribute name="CacheLoaderConfig" replace="false">
| <config>
| <shared>false</shared>
| <async>true</async>
|
| <cacheloader>
| <class>org.jboss.cache.loader.bdbje.BdbjeCacheLoader</class>
| <properties>
| location=C:/flatfileDB/node8080
| </properties>
| </cacheloader>
|
| </config>
| </attribute>
|
| </mbean>
| </server>
|
|
Remove the cacheloader config from the cache configuration and everything runs as you would expect. Using the 2.2.x version of JBC.
Cheers,
LL
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215730#4215730
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215730
15 years, 10 months