abhilash
abhilash

Reputation: 51

HazelCast Cache Inbound/Outbound Port Configuration

My Config: 4 nodes/machines each with 2 separate JVMs = total 8 apps in the cluster sharing data via HazelCast.

I'm facing some issue with HazelCast TCP/IP based port config wherein ports are not available, seems we have configured less number of ports compared to what is needed at a minimum. Can someone help w.r.t. below points,

  1. what should be the criteria for deciding outbound port range
  2. how many inbound and outbound ports are needed by HazelCast
  3. can a single port be used as inbound and outbound
  4. whether a port remain assigned or gets free once messaging is over

While there are number of pages explaining port configuration aspect, I could not find anything focusing on these aspects.

Thanks, Abhilash

Upvotes: 2

Views: 1859

Answers (2)

abhilash
abhilash

Reputation: 51

Thanks everyone, here are some observations

  1. what should be the criteria for deciding outbound port range

Either use default configuration or assign a range. Deciding range depends upon your deployment config.

In my case there are 8 apps each wanting to connect with each other. Each app will need at least 7 ports to connect with other 7 apps. Since each node has 2 apps, we need at least 14 distinct ports on a particular node.

Assume you have 4 nodes each with 3 apps, so in total there are 12 apps wanting to connect with each other. Each app will need at least 11 ports to connect with other 11 apps. Since each node has 3 apps, we need at least 33 distinct ports on a particular node.

  1. how many inbound and outbound ports are needed by HazelCast

Only 1 inbound port. And N outbound ports depending on the default or range configuration. Assigning an outbound port range may hurt performance in long run if more ports are needed for parallel processing.

  1. can a single port be used as inbound and outbound

nope

  1. whether a port remain assigned or gets free once messaging is over

It remains assigned.

Thanks again!

Note: I came to know about these numbers by multiple start/stop of my nodes/jvms and watching console and port allocation, try this if you want to see Hazel's behavior in detail.

Upvotes: 2

noscreenname
noscreenname

Reputation: 3370

From what I understand, you are running 2 instances or your application per physical machine.

In this case, if both nodes are configured to use the same ports, you are going to run into problems.

  • For the inbound port, you must either use a different configuration for each instance, enable multicast, or use port auto-increment.
  • For the outbound port, you should use default configuration. If security policies of your work environment restrict you from using some ports, then configure hazelcast accordingly, but put as little restrictions as possible.

Upvotes: 1

Related Questions