From 6fbd3d4e8df0c68472308d81c4c824635355dfcd Mon Sep 17 00:00:00 2001 From: Jungtaek Lim Date: Fri, 5 Feb 2016 15:40:16 +0900 Subject: [PATCH] STORM-1492 With nimbus.seeds set to default, a nimbus for localhost may appear "Offline" * when determining nimbus addresses from nimbus.seeds, filter out localhost addresses * localhost address: 127.0.0.1, localhost, 0:0:0:0:0:0:0:1 * there may be a chance that nimbus (localhost) is not reachable so we can't get info from alive-nimbuses * but it means ui process itself can't reach nimbus so we can ignore this case * there may be another change that user writes nimbus.seeds both unreachable localhost address and other reachable nimbuses fqdn * ui process can reach other nimbus and localhost itself is lost * but I think we can treat it as configuration error --- storm-client/src/jvm/org/apache/storm/utils/Utils.java | 6 ++++++ storm-core/src/clj/org/apache/storm/ui/core.clj | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/storm-client/src/jvm/org/apache/storm/utils/Utils.java b/storm-client/src/jvm/org/apache/storm/utils/Utils.java index b38c20fb6f7..a8820e6e998 100644 --- a/storm-client/src/jvm/org/apache/storm/utils/Utils.java +++ b/storm-client/src/jvm/org/apache/storm/utils/Utils.java @@ -63,6 +63,7 @@ import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; +import com.google.common.collect.Lists; import org.apache.commons.io.FileUtils; import org.apache.commons.io.input.ClassLoaderObjectInputStream; import org.apache.storm.Config; @@ -106,6 +107,7 @@ public class Utils { public static final String DEFAULT_STREAM_ID = "default"; private static final Set defaultAllowedExceptions = new HashSet<>(); public static final String FILE_PATH_SEPARATOR = System.getProperty("file.separator"); + private static final List LOCALHOST_ADDRESSES = Lists.newArrayList("localhost", "127.0.0.1", "0:0:0:0:0:0:0:1"); private static ThreadLocal threadSer = new ThreadLocal(); private static ThreadLocal threadDes = new ThreadLocal(); @@ -1505,4 +1507,8 @@ public static Map getConfigFromClasspath(List cp, Map