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
Assignees
Labels
[OLD]Team: Integration Source: Community PR or issue was opened by a community user Type: Defect
Milestone

Comments

@Fabryprog
Copy link

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?

@Fabryprog
Copy link
Author

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

I have the same problem.

@bitsofinfo
Copy link

bitsofinfo commented Jul 7, 2017

Try: https://github.com/bitsofinfo/hazelcast-docker-swarm-discovery-spi

and see the SwarmAddressPicker

#10801

@mesutcelik mesutcelik assigned ghost Aug 24, 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 ghost Oct 10, 2017
@tombujok
Copy link
Contributor

@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 pushed 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 pushed 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 pushed 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 pushed 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 pushed 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 pushed 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 pushed 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 pushed 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

@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.

@bitsofinfo
Copy link

related: #10801

@mmedenjak mmedenjak added the Source: Community PR or issue was opened by a community user label Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[OLD]Team: Integration Source: Community PR or issue was opened by a community user Type: Defect
Projects
None yet
Development

No branches or pull requests

6 participants