Package org.apache.hadoop.hbase.http
Class InfoServer
java.lang.Object
org.apache.hadoop.hbase.http.InfoServer
Create a Jetty embedded server to answer http requests. The primary goal is to serve up status
information for the server. There are three contexts: "/stacks/" -> points to stack trace
"/static/" -> points to common static files (src/hbase-webapps/static) "/" -> the jsp
server code from (src/hbase-webapps/<name>)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final String(package private) static final StringConfig key controlling whether the UI's TLS connector requests or requires a client certificate.private static final Stringprivate static final Stringprivate final HttpServerprivate static final String -
Constructor Summary
ConstructorsConstructorDescriptionInfoServer(String name, String bindAddress, int port, boolean findPort, org.apache.hadoop.conf.Configuration c) Create a status server on the given port. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPrivilegedServlet(String name, String pathSpec, Class<? extends javax.servlet.http.HttpServlet> clazz) Adds a servlet in the server that any user can access.voidaddServlet(String name, String pathSpec, Class<? extends javax.servlet.http.HttpServlet> clazz) Deprecated.voidaddUnprivilegedServlet(String name, String pathSpec, Class<? extends javax.servlet.http.HttpServlet> clazz) Adds a servlet in the server that any user can access.voidaddUnprivilegedServlet(String name, String pathSpec, org.apache.hbase.thirdparty.org.eclipse.jetty.ee8.servlet.ServletHolder holder) Adds a servlet in the server that any user can access.(package private) static org.apache.hadoop.security.authorize.AccessControlListbuildAdminAcl(org.apache.hadoop.conf.Configuration conf) Builds an ACL that will restrict the users who can issue commands to endpoints on the UI which are meant only for administrators.static booleancanUserModifyUI(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletContext ctx, org.apache.hadoop.conf.Configuration conf) Returns true if and only if UI authentication (spnego) is enabled, UI authorization is enabled, and the requesting user is defined as an administrator.private static StringgetAdminUsers(org.apache.hadoop.conf.Configuration conf, String httpAuthType) intgetPort()Deprecated.Since 0.99.0(package private) static StringgetTLSPassword(org.apache.hadoop.conf.Configuration c, String postfix) Resolves a TLS-related password with a 3-tier fallback: the role-scopedhbase.ui.ssl.server.<postfix>key is checked first, then the unscopedhbase.ui.ssl.<postfix>key, and finally Hadoop'sssl.server.<postfix>.(package private) static StringgetTLSProperty(org.apache.hadoop.conf.Configuration c, String postfix) (package private) static StringgetTLSProperty(org.apache.hadoop.conf.Configuration c, String postfix, String defaultValue) Resolves a TLS-related property with a 3-tier fallback: role-scopedhbase.ui.ssl.server.<postfix>→hbase.ui.ssl.<postfix>→ssl.server.<postfix>→defaultValue.voidsetAttribute(String name, Object value) voidstart()voidstop()
-
Field Details
-
HBASE_APP_DIR
- See Also:
-
httpServer
-
HADOOP_WEB_TLS_CONFIG_PREFIX
- See Also:
-
HBASE_WEB_TLS_CONFIG_PREFIX
- See Also:
-
HBASE_WEB_TLS_SERVER_CONFIG_PREFIX
- See Also:
-
TRUSTSTORE_LOCATION
- See Also:
-
HBASE_UI_SSL_CLIENT_AUTH_MODE
Config key controlling whether the UI's TLS connector requests or requires a client certificate. Valid values:NONE(default),WANT,NEED.- See Also:
-
-
Constructor Details
-
InfoServer
public InfoServer(String name, String bindAddress, int port, boolean findPort, org.apache.hadoop.conf.Configuration c) throws IOException Create a status server on the given port. The jsp scripts are taken from src/hbase-webapps/name.- Parameters:
name- The name of the serverbindAddress- address to bind toport- The port to use on the serverfindPort- whether the server should start at the given port and increment by 1 until it finds a free port.c- theConfigurationto build the server- Throws:
IOException- if getting one of the password fails or the server cannot be created
-
-
Method Details
-
getTLSPassword
static String getTLSPassword(org.apache.hadoop.conf.Configuration c, String postfix) throws IOException Resolves a TLS-related password with a 3-tier fallback: the role-scopedhbase.ui.ssl.server.<postfix>key is checked first, then the unscopedhbase.ui.ssl.<postfix>key, and finally Hadoop'sssl.server.<postfix>. Package-private for direct testing.- Throws:
IOException
-
getTLSProperty
-
getTLSProperty
static String getTLSProperty(org.apache.hadoop.conf.Configuration c, String postfix, String defaultValue) Resolves a TLS-related property with a 3-tier fallback: role-scopedhbase.ui.ssl.server.<postfix>→hbase.ui.ssl.<postfix>→ssl.server.<postfix>→defaultValue. Package-private for direct testing. -
buildAdminAcl
static org.apache.hadoop.security.authorize.AccessControlList buildAdminAcl(org.apache.hadoop.conf.Configuration conf) Builds an ACL that will restrict the users who can issue commands to endpoints on the UI which are meant only for administrators. -
getAdminUsers
-
addServlet
@Deprecated public void addServlet(String name, String pathSpec, Class<? extends javax.servlet.http.HttpServlet> clazz) Deprecated.UseaddUnprivilegedServlet(String, String, Class)oraddPrivilegedServlet(String, String, Class)instead of this method which does not state outwardly what kind of authz rules will be applied to this servlet.Explicitly invokeaddPrivilegedServlet(String, String, Class)oraddUnprivilegedServlet(String, String, Class)instead of this method. This method will add a servlet which any authenticated user can access. -
addUnprivilegedServlet
public void addUnprivilegedServlet(String name, String pathSpec, Class<? extends javax.servlet.http.HttpServlet> clazz) Adds a servlet in the server that any user can access. -
addUnprivilegedServlet
public void addUnprivilegedServlet(String name, String pathSpec, org.apache.hbase.thirdparty.org.eclipse.jetty.ee8.servlet.ServletHolder holder) Adds a servlet in the server that any user can access. -
addPrivilegedServlet
public void addPrivilegedServlet(String name, String pathSpec, Class<? extends javax.servlet.http.HttpServlet> clazz) Adds a servlet in the server that any user can access. -
setAttribute
-
start
- Throws:
IOException
-
getPort
Deprecated.Since 0.99.0- Returns:
- the port of the info server
-
stop
- Throws:
Exception
-
canUserModifyUI
public static boolean canUserModifyUI(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletContext ctx, org.apache.hadoop.conf.Configuration conf) Returns true if and only if UI authentication (spnego) is enabled, UI authorization is enabled, and the requesting user is defined as an administrator. If the UI is set to readonly, this method always returns false.
-
addUnprivilegedServlet(String, String, Class)oraddPrivilegedServlet(String, String, Class)instead of this method which does not state outwardly what kind of authz rules will be applied to this servlet.