5

In mutinode lets say N1, N2 and N3. I have been directly hitting to the node N1 but what happens is hazelcast communicates to N2 and N3 for some reason. Its not an Heart beat check since its configured for 1 min, But I observed using the wireshark, it clearly shows that the call goes to another node (i.e) from N1 to N2.

It clearly shows that when I hit a query to N1, that query is transmitted to N2. I saw the query and data received in wireshark.

Am pretty confused why its happening, All the data's has to be there in Node 1, But why its going to another node for fetching the data?

Thanks, Harry

Harry
  • 3,072
  • 6
  • 43
  • 100

1 Answers1

6

Data in Hazelcast is partitioned, therefore it doesn't matter to what node you add the data, there is no guarantee that the record will be stored on this node. That means there is communication going on to store / read data in a partitioned fashion. You probably want to read on data partitioning: http://docs.hazelcast.org/docs/3.6/manual/html-single/index.html#data-partitioning

noctarius
  • 5,979
  • 19
  • 20
  • Is there a way to do the tweak like data will be retrieved from one node when I hit on that node using the partition 'CUSTOM' parameter like below, – Harry May 02 '16 at 15:34
  • PartitionGroupConfig partitionGroupConfig = config.getPartitionGroupConfig(); partitionGroupConfig.setEnabled( true ) .setGroupType( MemberGroupType.CUSTOM ); MemberGroupConfig memberGroupConfig = new MemberGroupConfig(); memberGroupConfig.addInterface( "192.168.12.59" ); MemberGroupConfig memberGroupConfig2 = new MemberGroupConfig(); memberGroupConfig2.addInterface( "192.168.12.77" ); partitionGroupConfig.addMemberGroupConfig( memberGroupConfig ); partitionGroupConfig.addMemberGroupConfig( memberGroupConfig2 ); return partitionGroupConfig; – Harry May 02 '16 at 15:34
  • Partition groups are meant for backups, not partitioning. It is just not possible what you want to achieve. If you explain your use case I bet you don't even need to do what you want to do. – noctarius May 03 '16 at 04:46
  • We are using Hazelcast in our project. We have a multi-node setup in which Hazelcast is running in all the three nodes (Hazelcast cluster). There is a latency delay in multi-node setup due to WAN latency(i.e.30ms) (i.e) three nodes are in different locations. If I ping from one node (say n1) to the other node (say n2), there is a consistent delay say N ms. But I am directly hitting to the one of the node (say like n1) from our web application, what we see is that there is a delay in the Hazelcast cast processing. – Harry May 04 '16 at 15:36
  • We tried partition using a key format in all the maps like test1@partitionId, test2@partitonId, test3@partitionId but what happens is still the delay persists when I hit on any one node, Is there a way to avoid the delay? Am almost down, Please help me out. – Harry May 04 '16 at 15:39
  • We tried Wan Replication using commercial verison, still the delay persists what to do? Please help me out. – Harry May 04 '16 at 15:43
  • pls help me out @Noctarius – Harry May 04 '16 at 18:49
  • It is just not a Hazelcast use case. Hazelcast is not designed to run over WAN connections due to latency reasons, just as you figured out. There is no help as this won't work. You can apply data affinity (as you tried) but this will only affect where data inside the cluster (which of the 3 nodes) will hold this very record. If you access it from another node you'll hit the network one way or the other. Again: Hazelcast DOES NOT replicate records. Maybe, and only maybe, ReplicatedMap can help but this is best effort replication only which means it's fire and forget. – noctarius May 05 '16 at 07:21
  • Thanks, Is it possible to give me an example for data affinity, I saw customer and order example which I didn't get completely. So give me an example like storing 3 to 4 tables in the same partition in the same node and replicate to other nodes. so that when i hit on one node it always fetch the data from the same node – Harry May 05 '16 at 09:08
  • NO REPLICATION AVAILABLE ... Data affinity does not give you replication, it only offers the possibility to store independent objects together (side-by-side) in the same partition. Hazelcast does not offer replication beside the very specific ReplicatedMap (the name should give the hint), anyhow data affinity does not apply to the ReplicatedMap at all since there is no partitioning. Not sure how I can make this more obvious. – noctarius May 05 '16 at 10:31
  • Ya! gt your point, Is it possible for you to give the examples for data affinity... example with 4 tables... I also studied about partition '@' concept. How to use that! Am almost stuck for a week. Give me some examples. This is my email Id : haritheinnovator@gmail.com, It would be great if you could help me out. – Harry May 05 '16 at 11:27