Reputation: 253
I am using Infinispan in distributed mode with number of owners = 2 and cluster of 8 JBoss servers. For example: I have the key "1" and I put that in Infinispan cache. I want to get details (IP address) of those servers which are holding that key.
Upvotes: 1
Views: 103
Reputation: 1
The TcpTransportFactory class has a log on trace level that says the server used by that key.
So, for instance, if you change your Log4j XML config to something like:
<Logger name="org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory" level="TRACE"/>
You will get:
19:32:32,253 TRACE [HotRod-client-async-pool-34] [TcpTransportFactory] Using consistent hash for determining the server: /10.123.456.1:11222
Upvotes: 0
Reputation: 5888
If you're using Infinispan in remote client-server mode and accessing it via Memcached or REST protocols, you can't - these protocols are key location agnostic.
With HotRod protocol, the client knows this location but it's not publicly exposed. For debugging purposes, you can obtain the TransportFactory from RemoteCacheManager via reflection, then ConsistentHash instance from TransportFactory and run .getServer(byte[]) method. Certainly, such reflection is certainly not recommended for production. Why do you need the key's location?
Upvotes: 1