forked from apache/hbase
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbackupMasterStatus.jsp
More file actions
72 lines (70 loc) · 2.76 KB
/
Copy pathbackupMasterStatus.jsp
File metadata and controls
72 lines (70 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<%--
/**
* 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.
*/
--%>
<%@ page contentType="text/html;charset=UTF-8"
import="java.util.*"
import="org.apache.hadoop.hbase.ServerName"
import="org.apache.hadoop.hbase.master.HMaster" %>
<%
HMaster master = (HMaster) getServletContext().getAttribute(HMaster.MASTER);
if (!master.isActiveMaster()) {
ServerName active_master = master.getActiveMaster().orElse(null);
int activeInfoPort = master.getActiveMasterInfoPort();
%>
<div class="row inner_header">
<div class="page-header">
<h1>Backup Master <small><%= master.getServerName().getHostname() %></small></h1>
</div>
</div>
<% if (active_master != null) { %>
<h4>Current Active Master: <a href="//<%= active_master.getHostname() %>:<%= activeInfoPort %>/master.jsp"
target="_blank"><%= active_master.getHostname() %></a></h4>
<% } else { %>
<div id="initializing-info">
<h4>Cluster is starting, active master not yet elected</h4>
<p>No active master has been found. This is normal during cluster startup or master failover.
Please refresh manually in a few seconds.</p>
</div>
<% } %>
<% } else { %>
<h2>Backup Masters</h2>
<table class="table table-striped">
<tr>
<th>ServerName</th>
<th>Port</th>
<th>Start Time</th>
</tr>
<%
Collection<ServerName> backup_masters = master.getBackupMasters();
ServerName [] backupServerNames = backup_masters.toArray(new ServerName[backup_masters.size()]);
Arrays.sort(backupServerNames);
for (ServerName serverName : backupServerNames) {
int infoPort = master.getBackupMasterInfoPort(serverName);
%>
<tr>
<td><a href="//<%= serverName.getHostname() %>:<%= infoPort %>/master.jsp"
target="_blank"><%= serverName.getHostname() %></a>
</td>
<td><%= serverName.getPort() %></td>
<td><%= new Date(serverName.getStartCode()) %></td>
</tr>
<% } %>
<tr><td>Total:<%= backupServerNames.length %></td>
</table>
<% } %>