Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker] hazelcast into docker swarm, Virtual IP problem #9963

Closed
Fabryprog opened this issue Feb 22, 2017 · 6 comments
Closed

[docker] hazelcast into docker swarm, Virtual IP problem #9963

Fabryprog opened this issue Feb 22, 2017 · 6 comments

Comments

@Fabryprog
Copy link

@Fabryprog Fabryprog commented Feb 22, 2017

Hello,
i using hazelcast (tcp discovery) into a docker swarm cluster.

According to official documentation (https://docs.docker.com/engine/swarm/networking/) swarm assign a VIP and a "fisical" IP for every service.

When a hazelcast member try to connect to another i have a conflict IP because hazelcast match any service with 2 different IP (VIP and IP)

How to resolve it?

@jerrinot jerrinot added this to the 3.9 milestone Feb 23, 2017
@Fabryprog
Copy link
Author

@Fabryprog Fabryprog commented Feb 24, 2017

I temporary fix with custom discovery strategy using swarm API and SimpleDiscoveryNode with only virtual IP (without host name)

Address address = new Address(null, InetAddress.getByName(ip), NetworkConfig.DEFAULT_PORT); servers.add(new SimpleDiscoveryNode(address));

It is working perfectly!!!!

@lokinell
Copy link

@lokinell lokinell commented Mar 15, 2017

I have the same problem.

@bitsofinfo
Copy link

@bitsofinfo bitsofinfo commented Jul 7, 2017

@mmedenjak mmedenjak changed the title hazelcast into docker swarm, Virtual IP problem [docker] hazelcast into docker swarm, Virtual IP problem Sep 22, 2017
@tombujok tombujok assigned jerrinot and unassigned lazerion Oct 10, 2017
@tombujok
Copy link
Contributor

@tombujok tombujok commented Oct 10, 2017

@jerrinot Matko pushed his final changes to this PR since he didn't have access to your branch. He wanted you to push the final state of the PR since he didn't know the details of the whole scope of the work you did here. Here's his PR:
#11548

mmedenjak added a commit to mmedenjak/hazelcast that referenced this issue Oct 11, 2017
Adds a new SPI for defining the addresses that the hazelcast instance
will bind to and the address which will be advertised to other members
on which they can bind to.
This SPI will allow for implementations for different environments in
which the default address picker does not pick suitable addresses and
manually configuring the public address provides additional complexity
for deploying hazelcast.

The SPI does not necessarily fix all current issues when deploying
hazelcast but provides the user with a way to avoid these issues by
either providing their own implementation or using some implementation
that hazelcast will provide in the future.

Related to:
hazelcast#10477
hazelcast#9963
hazelcast#11118
mmedenjak added a commit to mmedenjak/hazelcast that referenced this issue Oct 11, 2017
Adds a new SPI for defining the addresses that the hazelcast instance
will bind to and the address which will be advertised to other members
on which they can bind to.
This SPI will allow for implementations for different environments in
which the default address picker does not pick suitable addresses and
manually configuring the public address provides additional complexity
for deploying hazelcast.

The SPI does not necessarily fix all current issues when deploying
hazelcast but provides the user with a way to avoid these issues by
either providing their own implementation or using some implementation
that hazelcast will provide in the future.

Related to:
hazelcast#10477
hazelcast#9963
hazelcast#11118
mmedenjak added a commit to mmedenjak/hazelcast that referenced this issue Oct 11, 2017
Adds a new SPI for defining the addresses that the hazelcast instance
will bind to and the address which will be advertised to other members
on which they can bind to.
This SPI will allow for implementations for different environments in
which the default address picker does not pick suitable addresses and
manually configuring the public address provides additional complexity
for deploying hazelcast.

The SPI does not necessarily fix all current issues when deploying
hazelcast but provides the user with a way to avoid these issues by
either providing their own implementation or using some implementation
that hazelcast will provide in the future.

Related to:
hazelcast#10477
hazelcast#9963
hazelcast#11118
mmedenjak added a commit to mmedenjak/hazelcast that referenced this issue Oct 11, 2017
Adds a new SPI for defining the addresses that the hazelcast instance
will bind to and the address which will be advertised to other members
on which they can bind to.
This SPI will allow for implementations for different environments in
which the default address picker does not pick suitable addresses and
manually configuring the public address provides additional complexity
for deploying hazelcast.

The SPI does not necessarily fix all current issues when deploying
hazelcast but provides the user with a way to avoid these issues by
either providing their own implementation or using some implementation
that hazelcast will provide in the future.

Related to:
hazelcast#10477
hazelcast#9963
hazelcast#11118
mmedenjak added a commit to mmedenjak/hazelcast that referenced this issue Oct 11, 2017
Adds a new SPI for defining the addresses that the hazelcast instance
will bind to and the address which will be advertised to other members
on which they can bind to.
This SPI will allow for implementations for different environments in
which the default address picker does not pick suitable addresses and
manually configuring the public address provides additional complexity
for deploying hazelcast.

The SPI does not necessarily fix all current issues when deploying
hazelcast but provides the user with a way to avoid these issues by
either providing their own implementation or using some implementation
that hazelcast will provide in the future.

Related to:
hazelcast#10477
hazelcast#9963
hazelcast#11118
mmedenjak added a commit to mmedenjak/hazelcast that referenced this issue Oct 12, 2017
Adds a new SPI for defining the addresses that the hazelcast instance
will bind to and the address which will be advertised to other members
on which they can bind to.
This SPI will allow for implementations for different environments in
which the default address picker does not pick suitable addresses and
manually configuring the public address provides additional complexity
for deploying hazelcast.

The SPI does not necessarily fix all current issues when deploying
hazelcast but provides the user with a way to avoid these issues by
either providing their own implementation or using some implementation
that hazelcast will provide in the future.

Related to:
hazelcast#10477
hazelcast#9963
hazelcast#11118
@mmedenjak mmedenjak self-assigned this Oct 12, 2017
mmedenjak added a commit to mmedenjak/hazelcast that referenced this issue Oct 12, 2017
Adds a new SPI for defining the addresses that the hazelcast instance
will bind to and the address which will be advertised to other members
on which they can bind to.
This SPI will allow for implementations for different environments in
which the default address picker does not pick suitable addresses and
manually configuring the public address provides additional complexity
for deploying hazelcast.

The SPI does not necessarily fix all current issues when deploying
hazelcast but provides the user with a way to avoid these issues by
either providing their own implementation or using some implementation
that hazelcast will provide in the future.

Related to:
hazelcast#10477
hazelcast#9963
hazelcast#11118
mmedenjak added a commit to mmedenjak/hazelcast that referenced this issue Oct 12, 2017
Adds a new SPI for defining the addresses that the hazelcast instance
will bind to and the address which will be advertised to other members
on which they can bind to.
This SPI will allow for implementations for different environments in
which the default address picker does not pick suitable addresses and
manually configuring the public address provides additional complexity
for deploying hazelcast.

The SPI does not necessarily fix all current issues when deploying
hazelcast but provides the user with a way to avoid these issues by
either providing their own implementation or using some implementation
that hazelcast will provide in the future.

Related to:
hazelcast#10477
hazelcast#9963
hazelcast#11118
@mmedenjak
Copy link
Contributor

@mmedenjak mmedenjak commented Oct 12, 2017

@Fabryprog @lokinell @bitsofinfo
there is a new SPI that has just been merged and which will be released in the 3.9 version. It will allow you to define the bind and public address when starting the hazelcast instance and if used correctly it can be used to avoid issues when forming a cluster.
For now you will have to use the SPI yourself and write an implementation which will fix your issue but we are planning on releasing implementations of our own which will be bundled into plugins such as the docker or AWS plugin for easier deployment.
Please check out the new SPI:
https://github.com/hazelcast/hazelcast/blob/3cede71cad1fe87312f0901ff77f903ed2d4383d/hazelcast/src/main/java/com/hazelcast/spi/MemberAddressProvider.java
Please create a new issue or reopen this one if this does not suit your use case.

@mmedenjak mmedenjak closed this Oct 12, 2017
@bitsofinfo
Copy link

@bitsofinfo bitsofinfo commented Oct 12, 2017

related: #10801

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.