You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2017/09/11 15:21:43 UTC

[1/2] storm git commit: STORM-1492 With nimbus.seeds set to default, a nimbus for localhost may appear "Offline"

Repository: storm
Updated Branches:
  refs/heads/master ed6dca024 -> a42b10a91


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


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/6fbd3d4e
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/6fbd3d4e
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/6fbd3d4e

Branch: refs/heads/master
Commit: 6fbd3d4e8df0c68472308d81c4c824635355dfcd
Parents: a9f92db
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Fri Feb 5 15:40:16 2016 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Fri Sep 8 07:46:56 2017 +0900

----------------------------------------------------------------------
 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(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/6fbd3d4e/storm-client/src/jvm/org/apache/storm/utils/Utils.java
----------------------------------------------------------------------
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 b38c20f..a8820e6 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.regex.Pattern;
 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<Class> defaultAllowedExceptions = new HashSet<>();
     public static final String FILE_PATH_SEPARATOR = System.getProperty("file.separator");
+    private static final List<String> LOCALHOST_ADDRESSES = Lists.newArrayList("localhost", "127.0.0.1", "0:0:0:0:0:0:0:1");
 
     private static ThreadLocal<TSerializer> threadSer = new ThreadLocal<TSerializer>();
     private static ThreadLocal<TDeserializer> threadDes = new ThreadLocal<TDeserializer>();
@@ -1505,4 +1507,8 @@ public class Utils {
         }
         return defaultsConf;
     }
+
+    public static boolean isLocalhostAddress(String address) {
+        return LOCALHOST_ADDRESSES.contains(address);
+    }
 }

http://git-wip-us.apache.org/repos/asf/storm/blob/6fbd3d4e/storm-core/src/clj/org/apache/storm/ui/core.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/ui/core.clj b/storm-core/src/clj/org/apache/storm/ui/core.clj
index 7cf34ae..ddf688e 100644
--- a/storm-core/src/clj/org/apache/storm/ui/core.clj
+++ b/storm-core/src/clj/org/apache/storm/ui/core.clj
@@ -434,7 +434,7 @@
       (nimbus-summary
         (.get_nimbuses (.getClusterInfo ^Nimbus$Client nimbus)))))
   ([nimbuses]
-    (let [nimbus-seeds (set (map #(str %1 ":" (*STORM-CONF* NIMBUS-THRIFT-PORT)) (set (*STORM-CONF* NIMBUS-SEEDS))))
+    (let [nimbus-seeds (set (map #(str %1 ":" (*STORM-CONF* NIMBUS-THRIFT-PORT)) (remove #(Utils/isLocalhostAddress %) (set (*STORM-CONF* NIMBUS-SEEDS)))))
           alive-nimbuses (set (map #(str (.get_host %1) ":" (.get_port %1)) nimbuses))
           offline-nimbuses (clojure.set/difference nimbus-seeds alive-nimbuses)
           offline-nimbuses-summary (map #(convert-to-nimbus-summary %1) offline-nimbuses)]


[2/2] storm git commit: Merge branch 'STORM-1492' of https://github.com/HeartSaVioR/storm into STORM-1492Q

Posted by bo...@apache.org.
Merge branch 'STORM-1492' of https://github.com/HeartSaVioR/storm into STORM-1492Q

STORM-1492 With nimbus.seeds set to default, a nimbus for localhost may appear "Offline"

This closes #1082


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/a42b10a9
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/a42b10a9
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/a42b10a9

Branch: refs/heads/master
Commit: a42b10a91dad99ef740aa58b2be08a9d157d115b
Parents: ed6dca0 6fbd3d4
Author: Robert Evans <ev...@yahoo-inc.com>
Authored: Mon Sep 11 10:03:39 2017 -0500
Committer: Robert Evans <ev...@yahoo-inc.com>
Committed: Mon Sep 11 10:03:39 2017 -0500

----------------------------------------------------------------------
 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(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/a42b10a9/storm-core/src/clj/org/apache/storm/ui/core.clj
----------------------------------------------------------------------