I configured hadoop using kerberos, everything works fine, I can view hdfs, send jobs, etc. But failed to authenticate online.
I am using hasoop-0.20.2 in cdh3u2 which supports HTTP SPNEGO.
The configurations associated with HTTP authentication in the core-site.xml file are as follows:
<property> <name>hadoop.http.filter.initializers</name> <value>org.apache.hadoop.security.AuthenticationFilterInitializer</value> </property> <property> <name>hadoop.http.authentication.type</name> <value>kerberos</value> </property> <property> <name>hadoop.http.authentication.token.validity</name> <value>36000</value> </property> <property> <name>hadoop.http.authentication.signature.secret.file</name> <value>/home/hadoop/hadoop/conf/http-secret-file</value> </property> <property> <name>hadoop.http.authentication.cookie.domain</name> <value></value> </property> <property> <name>hadoop.http.authentication.simple.anonymous.allowed</name> <value>false</value> </property> <property> <name>hadoop.http.authentication.kerberos.principal</name> <value>HTTP/ hz169-91.i.site.com@I.NETEASE.COM </value> </property> <property> <name>hadoop.http.authentication.kerberos.keytab</name> <value>/home/hadoop/hadoop/conf/http.keytab</value> </property> </configuration>
During startup, http authentication was successful.
2011-11-15 15:43:59,106 INFO org.apache.hadoop.security.authentication.server.KerberosAuthenticationHandler: Initialized, principal [HTTP/ hz169-91.i.site.com@I.NETEASE.COM ] from keytab [/home/hadoop/hadoop/conf/http.keytab]
After studying the code, I found that AuthenticationFilter receives a zero token during doFilter, so authentication starts (the code below), but authorization in httpservletrequest is null, so every time I reload my page, a single log appears.
2011-11-15 15:47:52,190 WARN org.apache.hadoop.security.authentication.server.KerberosAuthenticationHandler: SPNEGO starting
// org.apache.hadoop.security.authentication.server.KerberosAuthenticationHandler public AuthenticationToken authenticate(HttpServletRequest request, final HttpServletResponse response) throws IOException, AuthenticationException { AuthenticationToken token = null; String authorization = request.getHeader(KerberosAuthenticator.AUTHORIZATION); if (authorization == null || !authorization.startsWith(KerberosAuthenticator.NEGOTIATE)) { response.setHeader(KerberosAuthenticator.WWW_AUTHENTICATE, KerberosAuthenticator.NEGOTIATE); response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); if (authorization == null) { LOG.warn("SPNEGO starting"); } else { LOG.warn("'" + KerberosAuthenticator.AUTHORIZATION + "' does not start with '" + KerberosAuthenticator.NEGOTIATE + "' : {}", authorization); }
Are there any errors in the configuration, or only my browser does not support SPNEGO. I am using Chrome v16 in Ubuntu 11.04.
Does anyone have any clues to help me figure it out?
Thanks.