HBASE-19886 Display maintenance mode in shell, web UI
This commit is contained in:
parent
f155da3791
commit
4d24b19822
|
@ -185,6 +185,12 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
|
||||||
re-enabled from the hbase shell by running the command 'catalogjanitor_switch true'
|
re-enabled from the hbase shell by running the command 'catalogjanitor_switch true'
|
||||||
</div>
|
</div>
|
||||||
</%if>
|
</%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() %>
|
<%if !master.isBalancerOn() %>
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
The Load Balancer is not enabled which will eventually cause performance degradation
|
The Load Balancer is not enabled which will eventually cause performance degradation
|
||||||
|
|
|
@ -223,6 +223,13 @@ module Hbase
|
||||||
@admin.isNormalizerEnabled
|
@admin.isNormalizerEnabled
|
||||||
end
|
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)
|
# Request a scan of the catalog table (for garbage collection)
|
||||||
# Returns an int signifying the number of entries cleaned
|
# Returns an int signifying the number of entries cleaned
|
||||||
|
|
|
@ -336,6 +336,7 @@ Shell.load_command_group(
|
||||||
normalize
|
normalize
|
||||||
normalizer_switch
|
normalizer_switch
|
||||||
normalizer_enabled
|
normalizer_enabled
|
||||||
|
is_in_maintenance_mode
|
||||||
close_region
|
close_region
|
||||||
compact
|
compact
|
||||||
flush
|
flush
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue