Skip to content

Commit

Permalink
Added check and appropriate error message for clusterHasNodeWithLocal…
Browse files Browse the repository at this point in the history
…hostIp.
  • Loading branch information
tomkraljevic committed Nov 4, 2014
1 parent b09c849 commit 43bc3fa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hadoop/src/main/java/water/hadoop/h2odriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public class h2odriver extends Configured implements Tool {
volatile CtrlCHandler ctrlc = null;
volatile boolean clusterIsUp = false;
volatile boolean clusterFailedToComeUp = false;
volatile boolean clusterHasNodeWithLocalhostIp = false;

public static class H2ORecordReader extends RecordReader<Text, Text> {
H2ORecordReader() {
Expand Down Expand Up @@ -220,6 +221,9 @@ else if (type == MapperToDriverMessage.TYPE_FETCH_FLATFILE) {
// a synthesized flatfile once everyone has arrived.

System.out.println("H2O node " + msg.getEmbeddedWebServerIp() + ":" + msg.getEmbeddedWebServerPort() + " requested flatfile");
if (msg.getEmbeddedWebServerIp().equals("127.0.0.1")) {
clusterHasNodeWithLocalhostIp = true;
}
_cm.registerNode(msg.getEmbeddedWebServerIp(), msg.getEmbeddedWebServerPort(), _s);
}
else if (type == MapperToDriverMessage.TYPE_CLOUD_SIZE) {
Expand Down Expand Up @@ -735,6 +739,12 @@ private int waitForClusterToComeUp() throws Exception {
if (deltaMillis > (cloudFormationTimeoutSeconds * 1000)) {
System.out.println("ERROR: Timed out waiting for H2O cluster to come up (" + cloudFormationTimeoutSeconds + " seconds)");
System.out.println("ERROR: (Try specifying the -timeout option to increase the waiting time limit)");
if (clusterHasNodeWithLocalhostIp) {
System.out.println("");
System.out.println("NOTE: One of the nodes chose 127.0.0.1 as its IP address, which is probably wrong.");
System.out.println("NOTE: You may want to specify the -network option, which lets you specify the network interface the mappers bind to.");
System.out.println("NOTE: Typical usage is: -network a.b.c.d/24");
}
job.killJob();
return 3;
}
Expand Down

0 comments on commit 43bc3fa

Please sign in to comment.