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">
<replicated-cache name="my-replicated-cache" mode="SYNC"/>
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:
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
// This call also works - same host & different server
// Cache replication does seem to work between two domain servers on the same host
// This call does not return the value from the cache as it is on a different host
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
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.
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.
Can you provide the sources to this test application?
Did you developed this by yourself?