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

Implement auto-config #48

Merged
merged 5 commits into from
Aug 12, 2020
Merged

Implement auto-config #48

merged 5 commits into from
Aug 12, 2020

Conversation

mtyazici
Copy link
Contributor

No description provided.

@mtyazici mtyazici requested a review from a team as a code owner August 10, 2020 09:32
Copy link

@leszko leszko left a comment

Choose a reason for hiding this comment

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

Added 2 comments. PTAL. Other than that, it looks good.

}

private static boolean azureDnsServerConfigured() {
return readFileContents("/etc/resolv.conf").contains("168.63.129.16");
Copy link

Choose a reason for hiding this comment

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

I tried today creating two random ubuntu instances on Azure and unfortunately, they didn't have 168.63.129.16 in /etc/resolv.conf :( I wonder, maybe we should change 168.63.129.16 to bx.internal.cloudapp.net. What do you think? Could you make some more checks on that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is weird, I always had them even with different linux distros. Can you tell me the specifications of the OS and which region you deployed it? I will try to recreate the same. I will check the VMs with bx.internal.cloudapp.net but right now I am unable to find one that doesn't have it.

Copy link

Choose a reason for hiding this comment

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

hmm, actually I remember checking last week and all my instances had 168.63.129.16. But today I did exactly the same, created a default ubuntu instance, in default region (US East) with all default parameters and 168.63.129.16 was not there. It makes me think that maybe this bx.internal.cloudapp.net can be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I see right now I checked one of the VMs and its content is:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 168.63.129.16
search dhmodtvjlweejkiq3y3w53ku4a.gx.internal.cloudapp.net

Maybe *.internal.cloudapp.net is a better choice.

Copy link

Choose a reason for hiding this comment

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

Yeah, good idea 👍

Copy link

@jerrinot jerrinot Aug 11, 2020

Choose a reason for hiding this comment

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

what if /etc/resolv.conf does not exist at all? think of Windows, etc.

Also I assume we should touch filesystem under the j.s.PrivilegedAction wrapper otherwise it will blow-up when Java Security is enabled? @kwart knows details.

Copy link

Choose a reason for hiding this comment

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

non-existing /etc/resolv.conf is not an issue, because if anything non-expected happens in the auto-detection we just log it in FINE level and this strategy is just not used.

About Java Security, I don't know, I guess it should be similar. But @kwart can comment on that.

Copy link

Choose a reason for hiding this comment

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

As we don't support the Java Security Manager in Hazelcast yet, we don't need to wrap the calls.
Ref: https://hazelcast.atlassian.net/wiki/spaces/PM/pages/398753822/

mtyazici and others added 3 commits August 12, 2020 09:11
We used to check a name server ip "168.63.129.16", but it seems this is not present in every Azure VM.
Copy link

@leszko leszko left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Good work @mtyazici

@mtyazici mtyazici merged commit 234715c into hazelcast:master Aug 12, 2020
@mtyazici mtyazici deleted the auto-config branch August 12, 2020 11:52
@leszko leszko added this to the 2.1 milestone Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants