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

Default to binding to loopback address #11483

Merged
merged 1 commit into from Jun 4, 2015

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Jun 3, 2015

Binds to the address returned by InetAddress.getLoopbackAddress().

Closes #11300
Closes #7077

@s1monw
Copy link
Contributor

s1monw commented Jun 3, 2015

cool +1


The `network.publish_host` setting allows to control the host the node will
publish itself within the cluster so other nodes will be able to connect to it.
Of course, this can't be the `anyLocalAddress`, and by default, it will be the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They can't connect to it anyway if its only bound to a loopback, right?

@nik9000
Copy link
Member

nik9000 commented Jun 3, 2015

+1

@drewr
Copy link
Contributor

drewr commented Jun 3, 2015

Tested 👍

@dakrone
Copy link
Member Author

dakrone commented Jun 3, 2015

Tested this on Linux, OSX, and Windows. All were able to form a cluster with the default settings using multicast.

@clintongormley clintongormley added the :Distributed/Network Http and internode communication implementations label Jun 4, 2015
// 'null' here tells the socket to deter to the interface set
// with .setInterface
multicastSocket.joinGroup(addr, null);
multicastSocket.setInterface(config.multicastInterface);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the negative side of applying this workaround on all platforms?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multicast doesn't work on Linux or Windows with this workaround.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I see. I wonder if instead of having this hardcoded we can handle it with a setting that will default to the right value on Mac OS X (just in case this bug is fixed sometime in the future). Basically, can we do something similar to what we do with shared socket here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I will add that.

@imotov
Copy link
Contributor

imotov commented Jun 4, 2015

LGTM

@dakrone dakrone force-pushed the bind-to-localhost branch 2 times, most recently from 7c89152 to 65f4397 Compare June 4, 2015 16:25
Binds to the address returned by `InetAddress.getLoopbackAddress()`.

Closes elastic#11300
@dakrone dakrone merged commit 65f4397 into elastic:master Jun 4, 2015
@kevinkluge kevinkluge removed the review label Jun 4, 2015
@dakrone dakrone deleted the bind-to-localhost branch June 4, 2015 20:20
im-denisenko added a commit to im-denisenko/Elastica that referenced this pull request Sep 3, 2015
im-denisenko added a commit to im-denisenko/Elastica that referenced this pull request Sep 3, 2015
im-denisenko added a commit to im-denisenko/Elastica that referenced this pull request Sep 17, 2015
im-denisenko added a commit to im-denisenko/Elastica that referenced this pull request Sep 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking :Distributed/Network Http and internode communication implementations v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants