<%@ page contentType="text/html;charset=UTF-8" import="java.util.*" import="org.apache.hadoop.conf.Configuration" import="org.apache.hadoop.util.StringUtils" import="org.apache.hadoop.hbase.util.Bytes" import="org.apache.hadoop.hbase.util.JvmVersion" import="org.apache.hadoop.hbase.util.FSUtils" import="org.apache.hadoop.hbase.master.HMaster" import="org.apache.hadoop.hbase.HConstants" import="org.apache.hadoop.hbase.client.HBaseAdmin" import="org.apache.hadoop.hbase.client.HConnectionManager" import="org.apache.hadoop.hbase.HServerInfo" import="org.apache.hadoop.hbase.HServerAddress" import="org.apache.hadoop.hbase.HTableDescriptor" %><% HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER); Configuration conf = master.getConfiguration(); HServerAddress rootLocation = master.getCatalogTracker().getRootLocation(); boolean metaOnline = master.getCatalogTracker().getMetaLocation() != null; Map serverToServerInfos = master.getServerManager().getOnlineServers(); int interval = conf.getInt("hbase.regionserver.msginterval", 1000)/1000; if (interval == 0) { interval = 1; } boolean showFragmentation = conf.getBoolean("hbase.master.ui.fragmentation.enabled", false); Map frags = null; if (showFragmentation) { frags = FSUtils.getTableFragmentation(master); } %> HBase Master: <%= master.getMasterAddress().getHostname()%>:<%= master.getMasterAddress().getPort() %>

Master: <%=master.getMasterAddress().getHostname()%>:<%=master.getMasterAddress().getPort()%>

<% if (JvmVersion.isBadJvmVersion()) { %>
Your current JVM version <%= System.getProperty("java.version") %> is known to be unstable with HBase. Please see the HBase wiki for details.
<% } %> <% if (!FSUtils.isAppendSupported(conf) && FSUtils.isHDFS(conf)) { %>
You are currently running the HMaster without HDFS append support enabled. This may result in data loss. Please see the HBase wiki for details.
<% } %>

Master Attributes

<% if (showFragmentation) { %> <% } %>
Attribute NameValueDescription
HBase Version<%= org.apache.hadoop.hbase.util.VersionInfo.getVersion() %>, r<%= org.apache.hadoop.hbase.util.VersionInfo.getRevision() %>HBase version and svn revision
HBase Compiled<%= org.apache.hadoop.hbase.util.VersionInfo.getDate() %>, <%= org.apache.hadoop.hbase.util.VersionInfo.getUser() %>When HBase version was compiled and by whom
Hadoop Version<%= org.apache.hadoop.util.VersionInfo.getVersion() %>, r<%= org.apache.hadoop.util.VersionInfo.getRevision() %>Hadoop version and svn revision
Hadoop Compiled<%= org.apache.hadoop.util.VersionInfo.getDate() %>, <%= org.apache.hadoop.util.VersionInfo.getUser() %>When Hadoop version was compiled and by whom
HBase Root Directory<%= FSUtils.getRootDir(master.getConfiguration()).toString() %>Location of HBase home directory
Load average<%= StringUtils.limitDecimalTo2(master.getServerManager().getAverageLoad()) %>Average number of regions per regionserver. Naive computation.
Fragmentation<%= frags.get("-TOTAL-") != null ? frags.get("-TOTAL-").intValue() + "%" : "n/a" %>Overall fragmentation of all tables, including .META. and -ROOT-.
Zookeeper Quorum<%= master.getZooKeeperWatcher().getQuorum() %>Addresses of all registered ZK servers. For more, see zk dump.

Catalog Tables

<% if (rootLocation != null) { %> <% if (showFragmentation) { %> <% } %> <% if (showFragmentation) { %> <% } %> <% if (metaOnline) { %> <% if (showFragmentation) { %> <% } %> <% } %>
TableFrag.Description
<%= Bytes.toString(HConstants.ROOT_TABLE_NAME) %><%= frags.get("-ROOT-") != null ? frags.get("-ROOT-").intValue() + "%" : "n/a" %>The -ROOT- table holds references to all .META. regions.
<%= Bytes.toString(HConstants.META_TABLE_NAME) %><%= frags.get(".META.") != null ? frags.get(".META.").intValue() + "%" : "n/a" %>The .META. table holds references to all User Table regions
<%} %>

User Tables

<% HBaseAdmin hba = new HBaseAdmin(conf); HTableDescriptor[] tables = hba.listTables(); HConnectionManager.deleteConnection(hba.getConfiguration(), false); if(tables != null && tables.length > 0) { %> <% if (showFragmentation) { %> <% } %> <% for(HTableDescriptor htDesc : tables ) { %> <% if (showFragmentation) { %> <% } %> <% } %>

<%= tables.length %> table(s) in set.

TableFrag.Description
><%= htDesc.getNameAsString() %> <%= frags.get(htDesc.getNameAsString()) != null ? frags.get(htDesc.getNameAsString()).intValue() + "%" : "n/a" %><%= htDesc.toString() %>
<% } %>

Region Servers

<% if (serverToServerInfos != null && serverToServerInfos.size() > 0) { %> <% int totalRegions = 0; int totalRequests = 0; %> <% String[] serverNames = serverToServerInfos.keySet().toArray(new String[serverToServerInfos.size()]); Arrays.sort(serverNames); for (String serverName: serverNames) { HServerInfo hsi = serverToServerInfos.get(serverName); String hostname = hsi.getServerAddress().getHostname() + ":" + hsi.getInfoPort(); String url = "http://" + hostname + "/"; totalRegions += hsi.getLoad().getNumberOfRegions(); totalRequests += hsi.getLoad().getNumberOfRequests() / interval; long startCode = hsi.getStartCode(); %> <% } %>
AddressStart CodeLoad
<%= hostname %><%= startCode %><%= hsi.getLoad().toString(interval) %>
Total: servers: <%= serverToServerInfos.size() %> requests=<%= totalRequests %>, regions=<%= totalRegions %>

Load is requests per second and count of regions loaded

<% } %>