Hazelcast: Hazelcast Cluster Configuration and TCP-IP Interfaces

Created on 25 Jul 2016  路  6Comments  路  Source: hazelcast/hazelcast

Hello,

currently it's not possible to add an interface to the tcp-ip section.

http://docs.hazelcast.org/docs/3.5/manual/html/networkconfiguration.html

network -> join -> tcp-ip -> interface.

But i cannot found a setter in:

com.hazelcast.config.Config.getNetworkConfig().getJoin().getTcpIpConfig()

Thanks
Marcel

Most helpful comment

Thanks for the heads-up, already part of our plans for config cleanup :)

All 6 comments

@marcelalburg: Hi, what you are trying to achieve?
the <interface> element in XML tcp-ip joiner is just to specify IPs where are additional members listening. It's actually an alias for <members/>

If you are trying to select an interface where a Hazelcast member will bind itself to then have a look at this

I am using hazelcast-3.5.
You can see the IPs inside TcpIpConfig like this:
Loop through your IPs and set it like this:

config.getTcpIpConfig().addMember(member);

Thanks

Thanks jerrinot! That is one thing that the hazelcast team should review.

I was pulling my hair for such a long time only to find your answer that explained the diff between the < interface > inside tcp [which is an alias to member] and the < interface > inside network (which is used to define the network interface]. I had set the network < interface > in the wrong place [under tcp.. arggg]!!! Thanks!!

Yes indeed (I would suggest hazelcast stops using "interface" as an alias to "member" to avoid confusing newbies like me but I understand this is likely for backwards compatibility for an earlier bad decision or something):

Set memberTags = new HashSet(Arrays.asList("interface", "member", "members"));

@pierregangloff that's certainly a good recommendation and something we should fix in the upcoming Hazelcast 4.0. cc @mmedenjak

Thanks for the heads-up, already part of our plans for config cleanup :)

if it doesn't make it (to avoid introducing a breaking change for people who want to get a "drop in jar replacement"), that explanation could make it into the documentation (WARNING: when you define network interfaces, make sure to put it under the < network > element, as opposed to < interface > elements under the < tcp > element where they would simply be considered as "member"). Word-smithing needed but I think we all get the idea. Thank you all for this great project!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tezc picture tezc  路  6Comments

kwart picture kwart  路  7Comments

thekalinga picture thekalinga  路  4Comments

pveentjer picture pveentjer  路  7Comments

timoinstana picture timoinstana  路  5Comments