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

Use NM_HOST to determine hostname #97

Merged
merged 1 commit into from Oct 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 3 additions & 10 deletions java/src/main/java/com/anaconda/skein/ApplicationMaster.java
Expand Up @@ -46,8 +46,6 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.security.PrivilegedAction;
import java.util.ArrayList;
Expand Down Expand Up @@ -151,7 +149,7 @@ public void run() {
}
});

LOG.info("gRPC server started, listening on {}", grpcServer.getPort());
LOG.info("gRPC server started at {}:{}", hostname, grpcServer.getPort());
}

private void stopServer() {
Expand Down Expand Up @@ -208,7 +206,7 @@ public void run() {
}
});

LOG.info("WebUI server started, listening on {}", ui.getURI().getPort());
LOG.info("WebUI server started at {}:{}", hostname, ui.getURI().getPort());
}

private void stopUI() {
Expand Down Expand Up @@ -435,12 +433,6 @@ public void run() throws Exception {

loadApplicationSpec();

try {
hostname = InetAddress.getLocalHost().getHostAddress();
} catch (UnknownHostException exc) {
fatal("Couldn't determine hostname for appmaster", exc);
}

// Create ugi and add original tokens to it
String userName = System.getenv(Environment.USER.name());
LOG.info("Running as user {}", userName);
Expand Down Expand Up @@ -476,6 +468,7 @@ public void run() throws Exception {
MAX_EXECUTOR_THREADS,
true);

hostname = System.getenv(Environment.NM_HOST.name());
startServer();
startUI();

Expand Down