As you mentioned that "backup of each key is decided at runtime", is there any way to find out that which server will be the backup of other server.
I think, Backup server means till the primay server runs backup server will not handle any request, all the request would be handled by the primary server.
if not configure primary and secondary server then how we can find out the backup or secondary server of the particular server, so that in case of the maintence we are sure that backup server is up.
Thanks in advance
Vishnu, the backup is "per key" and not "per server". All servers are active all the time. Therefore when I request a key it will always go to the primary node as computed by the consistent hash algorithm. If that node fails, the cluster recomputes the consistent hash for the keys it was holding, using the backups that are available on the other nodes and ensuring that keys will be on "numOwners" servers again. Here's an example:
- 3 servers (X Y Z) with a cache in distributed mode with numOwners=2
- cache.put("a", "a"); // the consistent hash algorithm decides to place key "a" on X and Y
- cache.put("b", "b"); // the consistent hash algorithm decides to place key "b" on Y and Z
- cache.put("c", "c"); // the consistent hash algorithm decides to place key "c" on X and Z
As you can see both keys "a" and "c" are on server X as primary but have different backups.
The AdvancedCache API has a method called "locate" which allows you to find the owners of a specific key.
Thanks for reply.
I have downloaded the inifinispan-all.jar.
i am running the server using the >startServer.bat -r memcached -c ../etc/config-samples/config.xml -l 22.214.171.124 -p 8180
The config file having all the configuration and transport tag having a configuration file,tcp.xml file which having all the server information as follow.
and another server running on same machine but port Num 8280. Now,i want to check the put value from one Server replicate to other.
Could you please share your experience on it.
Thanks in advance.