0

Hope all are doing good. I am new to Infinispan and I need help. Say I have a cluster of 3 nodes running in Distributed Mode. Consider the following scenario:

Infinispan Version : 7.1.1

No. of Nodes = 3 (NodeA, NodeB, NodeC)

Mode = Distributed

numOwners = 2

No. of Key/Values in the cluster = 3 [(k1,v1),(k2,v2),(k3,v3)]

Distribution of keys in each of the nodes :

NodeA --> k1,k2

NodeB --> k2,k3

NodeC --> k3,k1

Now, say Node B is down.

Q1. Would the following scenario be like this?

NodeA --> k1,k2, k3

NodeC --> k3,k1, k2

Q2. If Node B becomes alive again, I want my cluster to regain its original state like:

NodeA --> k1,k2

NodeB --> k2,k3

NodeC --> k3,k1

Is there any mechanism by which I can achieve the above 2 states (after node failure and after node recovery).

Can anyone help me out? Any help would be highly appreciated.

arnabkaycee
  • 1,634
  • 13
  • 26

1 Answers1

4

Q1: Yes, with numOwners = 2 and 2 nodes all data will be on both nodes

Q2: It won't get to the original state, but it will spread the entries ~evenly across cluster. Therefore, it is possible that it will end up e.g. like

A -> k1, k3
B -> k3, k2
C -> k2, k1

However, the keys don't have to be spread exactly evenly. Infinispan defines the distribution by the concept of segments; you can define the number of segments in configuration, too. Each segment contains a portion of keys according to the hashCode() of those keys, and these segments are spread as evenly as possible.

Radim Vansa
  • 5,686
  • 2
  • 25
  • 40
  • +1, Thanks for your answer. When a node is down, would it hash according to **org.infinispan.distribution.ch.DefaultConsistentHashFactory** to rebalance amongst the remaining nodes? – arnabkaycee Jun 29 '15 at 15:35
  • Yes, this is the class that defines how segments are distributed across nodes. – Radim Vansa Jun 30 '15 at 11:09
  • I cannot locate the physical location of a key in the cluster. **'locate'** command is not recognized in Infinispan 7.1.1. I am using ispn-cli.sh tool in bin folder. Steps : connect --> container --> cache – arnabkaycee Jun 30 '15 at 13:36
  • Then file a bug in JIRA https://issues.jboss.org/ or ask another question, specifying exactly what you are doing and what's the error. – Radim Vansa Jul 01 '15 at 07:24