dfshealth.jsp 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <%
  2. /*
  3. * Licensed to the Apache Software Foundation (ASF) under one
  4. * or more contributor license agreements. See the NOTICE file
  5. * distributed with this work for additional information
  6. * regarding copyright ownership. The ASF licenses this file
  7. * to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance
  9. * with the License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. */
  19. %>
  20. <%@ page
  21. contentType="text/html; charset=UTF-8"
  22. import="org.apache.hadoop.util.ServletUtil"
  23. import="org.apache.hadoop.ha.HAServiceProtocol.HAServiceState"
  24. %>
  25. <%!
  26. //for java.io.Serializable
  27. private static final long serialVersionUID = 1L;
  28. %>
  29. <%
  30. final NamenodeJspHelper.HealthJsp healthjsp = new NamenodeJspHelper.HealthJsp();
  31. NameNode nn = NameNodeHttpServer.getNameNodeFromContext(application);
  32. FSNamesystem fsn = nn.getNamesystem();
  33. HAServiceState nnHAState = nn.getServiceState();
  34. boolean isActive = (nnHAState == HAServiceState.ACTIVE);
  35. String namenodeRole = nn.getRole().toString();
  36. String namenodeState = nnHAState.toString();
  37. String namenodeLabel = nn.getRpcServer() != null ?
  38. nn.getNameNodeAddressHostPortString() : null;
  39. %>
  40. <!DOCTYPE html>
  41. <html>
  42. <head>
  43. <link rel="stylesheet" type="text/css" href="/static/hadoop.css">
  44. <% if (namenodeLabel != null) { %>
  45. <title>Hadoop <%=namenodeRole%>&nbsp;<%=namenodeLabel%></title>
  46. <% } else { %>
  47. <title>Hadoop <%=namenodeRole%></title>
  48. <% } %>
  49. </head>
  50. <body>
  51. <% if (namenodeLabel != null) { %>
  52. <h1><%=namenodeRole%> '<%=namenodeLabel%>' (<%=namenodeState%>)</h1>
  53. <% } else { %>
  54. <h1><%=namenodeRole%> (<%=namenodeState%>)</h1>
  55. <% } %>
  56. <%= NamenodeJspHelper.getVersionTable(fsn) %>
  57. <br />
  58. <% if (isActive) { %>
  59. <b><a href="/nn_browsedfscontent.jsp">Browse the filesystem</a></b><br>
  60. <% } %>
  61. <b><a href="/logs/"><%=namenodeRole%> Logs</a></b>
  62. <hr>
  63. <h3>Cluster Summary</h3>
  64. <b> <%= NamenodeJspHelper.getSecurityModeText()%> </b>
  65. <b> <%= NamenodeJspHelper.getSafeModeText(fsn)%> </b>
  66. <b> <%= NamenodeJspHelper.getInodeLimitText(fsn)%> </b>
  67. <%= NamenodeJspHelper.getCorruptFilesWarning(fsn)%>
  68. <% healthjsp.generateHealthReport(out, nn, request); %>
  69. <% healthjsp.generateJournalReport(out, nn, request); %>
  70. <hr/>
  71. <% healthjsp.generateConfReport(out, nn, request); %>
  72. <hr>
  73. <h3>Startup Progress</h3>
  74. <% healthjsp.generateStartupProgress(out, nn.getStartupProgress()); %>
  75. <%
  76. out.println(ServletUtil.htmlFooter());
  77. %>