Skip to content

Commit 0440548

Browse files
authored
HBASE-30286 HTTP ERROR 500 when opening master ui if active master is not yet available during startup (#8471) (#8478)
Signed-off-by: Peter Somogyi <psomogyi@apache.org> Signed-off-by: Xiao Liu <liuxiaocs@apache.org>
1 parent faa409a commit 0440548

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

hbase-server/src/main/resources/hbase-webapps/master/backupMasterStatus.jsp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,29 @@
2020
<%@ page contentType="text/html;charset=UTF-8"
2121
import="java.util.*"
2222
import="org.apache.hadoop.hbase.ServerName"
23-
import="org.apache.hadoop.hbase.master.HMaster"
24-
import="org.apache.hbase.thirdparty.com.google.common.base.Preconditions" %>
23+
import="org.apache.hadoop.hbase.master.HMaster" %>
2524
<%
2625
HMaster master = (HMaster) getServletContext().getAttribute(HMaster.MASTER);
2726
if (!master.isActiveMaster()) {
2827
2928
ServerName active_master = master.getActiveMaster().orElse(null);
30-
Preconditions.checkState(active_master != null, "Failed to retrieve active master's ServerName!");
3129
int activeInfoPort = master.getActiveMasterInfoPort();
3230
%>
3331
<div class="row inner_header">
3432
<div class="page-header">
3533
<h1>Backup Master <small><%= master.getServerName().getHostname() %></small></h1>
3634
</div>
3735
</div>
36+
<% if (active_master != null) { %>
3837
<h4>Current Active Master: <a href="//<%= active_master.getHostname() %>:<%= activeInfoPort %>/master.jsp"
3938
target="_blank"><%= active_master.getHostname() %></a></h4>
39+
<% } else { %>
40+
<div id="initializing-info">
41+
<h4>Cluster is starting, active master not yet elected</h4>
42+
<p>No active master has been found. This is normal during cluster startup or master failover.
43+
Please refresh manually in a few seconds.</p>
44+
</div>
45+
<% } %>
4046
<% } else { %>
4147
<h2>Backup Masters</h2>
4248

0 commit comments

Comments
 (0)