hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject hbase git commit: HBASE-19886 Display maintenance mode in shell, web UI
Date Tue, 06 Feb 2018 22:54:58 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.4 a8505993c -> 1eef181a5


HBASE-19886 Display maintenance mode in shell, web UI


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

Branch: refs/heads/branch-1.4
Commit: 1eef181a577dfd120708a8f859cc21546ec8516b
Parents: a850599
Author: Balazs Meszaros <balazs.meszaros@cloudera.com>
Authored: Mon Jan 29 16:43:20 2018 +0100
Committer: Apekshit Sharma <appy@apache.org>
Committed: Tue Feb 6 14:54:46 2018 -0800

----------------------------------------------------------------------
 .../hbase/tmpl/master/MasterStatusTmpl.jamon    |  6 ++++
 hbase-shell/src/main/ruby/hbase/admin.rb        |  7 ++++
 hbase-shell/src/main/ruby/shell.rb              |  1 +
 .../shell/commands/is_in_maintenance_mode.rb    | 38 ++++++++++++++++++++
 4 files changed, 52 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/1eef181a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
index 7467baa..408471a 100644
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
+++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
@@ -162,6 +162,12 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
           re-enabled from the hbase shell by running the command 'catalogjanitor_switch true'
           </div>
         </%if>
+        <%if master.isInMaintenanceMode() %>
+          <div class="alert alert-warning">
+          Your Master is in maintenance mode. This may be because of HBCK aborting while
+          running in repair mode. Please re-run HBCK in repair mode.
+          </div>
+        </%if>
         <%if !master.isBalancerOn() %>
           <div class="alert alert-warning">
             The Load Balancer is not enabled which will eventually cause performance degradation

http://git-wip-us.apache.org/repos/asf/hbase/blob/1eef181a/hbase-shell/src/main/ruby/hbase/admin.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb b/hbase-shell/src/main/ruby/hbase/admin.rb
index 60ae155..41460ce 100644
--- a/hbase-shell/src/main/ruby/hbase/admin.rb
+++ b/hbase-shell/src/main/ruby/hbase/admin.rb
@@ -191,6 +191,13 @@ module Hbase
     end
 
     #----------------------------------------------------------------------------------------------
+    # Query the current state of master in maintenance mode.
+    # Returns the state of maintenance mode (true is on).
+    def in_maintenance_mode?
+      @admin.isMasterInMaintenanceMode
+    end
+
+    #----------------------------------------------------------------------------------------------
     # Request a scan of the catalog table (for garbage collection)
     # Returns an int signifying the number of entries cleaned
     def catalogjanitor_run()

http://git-wip-us.apache.org/repos/asf/hbase/blob/1eef181a/hbase-shell/src/main/ruby/shell.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/shell.rb b/hbase-shell/src/main/ruby/shell.rb
index 7444c3b..2c748e2 100644
--- a/hbase-shell/src/main/ruby/shell.rb
+++ b/hbase-shell/src/main/ruby/shell.rb
@@ -327,6 +327,7 @@ Shell.load_command_group(
     normalize
     normalizer_switch
     normalizer_enabled
+    is_in_maintenance_mode
     close_region
     compact
     flush

http://git-wip-us.apache.org/repos/asf/hbase/blob/1eef181a/hbase-shell/src/main/ruby/shell/commands/is_in_maintenance_mode.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/shell/commands/is_in_maintenance_mode.rb b/hbase-shell/src/main/ruby/shell/commands/is_in_maintenance_mode.rb
new file mode 100644
index 0000000..8ed244c
--- /dev/null
+++ b/hbase-shell/src/main/ruby/shell/commands/is_in_maintenance_mode.rb
@@ -0,0 +1,38 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+module Shell
+  module Commands
+    class IsInMaintenanceMode < Command
+      def help
+        <<-EOF
+Is master in maintenance mode? For example:
+
+  hbase> is_in_maintenance_mode
+EOF
+      end
+
+      def command
+        state = admin.in_maintenance_mode?
+        formatter.row([state.to_s])
+        state
+      end
+    end
+  end
+end


Mime
View raw message