-
1. Re: Help with setting up a replicated Infinispan cache (domain mode)
kumar2 Oct 14, 2016 3:21 PM (in response to kumar2)Update:
Cache replication does work when the domain servers are running on the same host.
Cache replication however does not seem to work when the domain servers are on different hosts.
You can use the attached EAR file to test cache replication on your domain. To do so,
1. Add a cache container called "my-cache-container" with a replicated cache called "my-replicated-cache" to your setup.
domain.xml snippet below:
<cache-container name="my-cache-container" statistics-enabled="false">
<transport lock-timeout="60000"/>
<replicated-cache name="my-replicated-cache" mode="SYNC"/>
</cache-container>
2. Deploy the attached EAR to your cluster.
3. Modify & invoke the URL below to add key "MYKEY" with value "MYVALUE" to the replicated cache:
http://yourHost:serverOnePort/TestCacheReplication/PutIntoCacheServlet?key=MYKEY&value=MYVALUE
4. Modify & invoke the URLs below to retrieve the value for key "MYKEY" from the cache:
// This call works - same host & server as the PutIntoCache call
http://yourHost:serverOnePort/TestCacheReplication/GetFromCacheServlet?key=MYKEY
// This call also works - same host & different server
// Cache replication does seem to work between two domain servers on the same host
http://yourHost:serverTwoPort/TestCacheReplication/GetFromCacheServlet?key=MYKEY
// This call does not return the value from the cache as it is on a different host
http://differentHost:port/TestCacheReplication/GetFromCacheServlet?key=MYKEY
If I understand this correctly, the GetFromCacheServlet call should work from any host that is part of the domain/cluster. It doesn't.
Any help is appreciated.
-
testCacheReplication.ear 5.7 KB
-
-
2. Re: Help with setting up a replicated Infinispan cache (domain mode)
rhusar Oct 18, 2016 2:02 PM (in response to kumar2)What you describe sounds like the servers are not finding each other, make sure to look in the log for a message that shows new cache topology on server boot.
If the members are not finding each other, use a different discovery protocol. By default discovery happens over UDP multicast.
-
3. Re: Help with setting up a replicated Infinispan cache (domain mode)
kumar2 Oct 18, 2016 2:22 PM (in response to kumar2)Yes, the servers were not finding each other.
Setting (as a VM arg) the "jboss.bind.address.private" variable to the IP address of the server fixed the problem.
-
4. Re: Help with setting up a replicated Infinispan cache (domain mode)
h13 Nov 24, 2016 5:04 AM (in response to kumar2)Can you provide the sources to this test application?
Did you developed this by yourself?Thanks!