2014-10-07 11 views
5

Ich versuche, meinen HDP2 Hadoop Cluster mit Kerberos zu sichern.WebHDFS funktioniert nicht auf einem sicheren Hadoop Cluster

Bisher funktionieren Hdfs, Hive, Hbase, Hue Bienenwachs und Hue Job/Task Browser richtig; jedoch Hue Datei-Browser nicht funktioniert, es antwortet:

WebHdfsException at /filebrowser/ 
AccessControlException: SIMPLE authentication is not enabled. Available:[TOKEN, KERBEROS] (error 500) 
Request Method: GET 
Request URL: http://bt1svlmy:8000/filebrowser/ 
Django Version: 1.2.3 
Exception Type: WebHdfsException 
Exception Value:  
AccessControlException: SIMPLE authentication is not enabled. Available:[TOKEN, KERBEROS] (error 500) 
Exception Location: /usr/lib/hue/desktop/libs/hadoop/src/hadoop/fs/webhdfs.py in _stats, line 208 
Python Executable: /usr/bin/python2.6 
Python Version: 2.6.6 
(...) 

Meine hue.ini-Datei mit allen security_enabled=true und anderen damit zusammenhängenden Parametern konfiguriert ist.


Ich glaube, das Problem ist mit WebHDFS.

habe ich versucht, die Locke gegeben Befehle an http://hadoop.apache.org/docs/r1.0.4/webhdfs.html#Authentication

curl -i --negotiate -L -u : "http://172.19.115.50:14000/webhdfs/v1/filetoread?op=OPEN" 

Antworten:

HTTP/1.1 403 Forbidden 
Server: Apache-Coyote/1.1 
Set-Cookie: hadoop.auth=; Path=/; Expires=Thu, 01-Jan-1970 00:00:00 GMT; HttpOnly 
Content-Type: text/html;charset=utf-8 
Content-Length: 1027 
Date: Wed, 08 Oct 2014 06:55:51 GMT 

<html><head><title>Apache Tomcat/6.0.37 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 403 - Anonymous requests are disallowed</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Anonymous requests are disallowed</u></p><p><b>description</b> <u>Access to the specified resource has been forbidden.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.37</h3></body></html> 

Und ich konnte mit dem folgenden curl Anfrage durch Hinzufügen eines Benutzers Hues Fehlermeldung reproduzieren:

curl --negotiate -i -L -u: "http://172.19.115.50:14000/webhdfs/v1/filetoread?op=OPEN&user.name=theuser" 

antwortet es:

HTTP/1.1 500 Internal Server Error 
Server: Apache-Coyote/1.1 
Set-Cookie: hadoop.auth=u=theuser&p=theuser&t=simple&e=1412735529027&s=rQAfgMdExsQjx6N8cQ10JKWb2kM=; Path=/; Expires=Wed, 08-Oct-2014 02:32:09 GMT; HttpOnly 
Content-Type: application/json 
Transfer-Encoding: chunked 
Date: Tue, 07 Oct 2014 16:32:09 GMT 
Connection: close 

{"RemoteException":{"message":"SIMPLE authentication is not enabled. Available:[TOKEN, KERBEROS]","exception":"AccessControlException","javaClassName":"org.apache.hadoop.security.AccessControlException"}} 

Es scheint, dass es zwischen WebHDFS und curl keine Kerberos-Aushandlung gibt.

Ich hatte erwartet, so etwas wie:

HTTP/1.1 401 UnauthorizedContent-Type: text/html; charset=utf-8 
WWW-Authenticate: Negotiate 
Content-Length: 0 
Server: Jetty(6.1.26) 
HTTP/1.1 307 TEMPORARY_REDIRECT 
Content-Type: application/octet-stream 
Expires: Thu, 01-Jan-1970 00:00:00 GMT 
Set-Cookie: hadoop.auth="u=exampleuser&[email protected]&t=kerberos&e=1375144834763&s=iY52iRvjuuoZ5iYG8G5g12O2Vwo=";Path=/ 
Location: http://hadoopnamenode.mycompany.com:1006/webhdfs/v1/user/release/docexample/test.txt?op=OPEN&delegation=JAAHcmVsZWFzZQdyZWxlYXNlAIoBQCrfpdGKAUBO7CnRju3TbBSlID_osB658jfGfRpEt8-u9WHymRJXRUJIREZTIGRlbGVnYXRpb24SMTAuMjAuMTAwLjkxOjUwMDcw&offset=0 
Content-Length: 0 
Server: Jetty(6.1.26) 
HTTP/1.1 200 OK 
Content-Type: application/octet-stream 
Content-Length: 16 
Server: Jetty(6.1.26) 
A|1|2|3 
B|4|5|6 

Jede Idee, was falsch gegangen sein könnte?

habe ich in meinem hdfs-site.xml auf jedem Knoten:

<property> 
    <name>dfs.webhdfs.enabled</name> 
    <value>true</value> 
</property> 

<property> 
    <name>dfs.web.authentication.kerberos.principal</name> 
    <value>HTTP/[email protected]</value> 
</property> 

<property> 
    <name>dfs.web.authentication.kerberos.keytab</name> 
    <value>/etc/hadoop/conf/HTTP.keytab</value> <!-- path to the HTTP keytab --> 
</property> 
+0

Hallo Arnaud, Das ist cool; Ich versuche, eine Hadoop-Umgebung mit Kerberos zu sichern. Können Sie mir bitte den Prozess/die Art und Weise nennen, die Sie im Detail gewählt haben? –

+1

Nun, das wäre eine lange Antwort, zu lang für dieses Forum. Kurz gesagt, Sie müssen irgendwo ein KDC installieren, Superuser und Anmeldeinformationen für Hadoop-Systeme erstellen und über die Verbindung Ihres KDC mit Ihrem alten LDAP-System für die Benutzeridentifikation nachdenken. Ich benutzte Ambari + einige handgemachte Shell-Skripte, um den Hadoop-Cluster tatsächlich zu konfigurieren; http://ambari.apache.org/current/installing-hadoop-using-ambari/content/ambari-kerb.html geben Sie Details. – Arnaud

+0

Ok Arnaud, Lass mich einen Blick darauf werfen; Ich gehe mit einem funktionierenden Hadoop-Cluster in 2 Ubuntu-Maschinen und starte mit der Ambari-Installation. –

Antwort

3

Sieht aus wie Sie WebHDFS nicht zugreifen (Port default = 50070), aber HttpFS (Standard-Port = 14000), die eine "plain" Webapp ist Das ist nicht auf die gleiche Weise gesichert.

Eine WebHDFS-URL ist oft so etwas wie http://namenode:50070/webhdfs/v1; versuche, hue.ini mit diesem Parameter zu modifizieren (WebHDFS wird über HttpFS empfohlen)

+0

Danke, das hat mein Problem gelöst! – Arnaud

+1

Allerdings habe ich eine Active/Standby-Konfiguration, und ich bin nicht in der Lage, sicher zu bestimmen, welches ist der namenode ... Wie geht das? – Arnaud

+1

Von Cloudera doc: "Sowohl WebHDFS als auch HttpFS verwenden die HTTP-REST-API, sodass sie vollständig interoperabel sind, aber Hue muss für die Verwendung des einen oder des anderen konfiguriert sein. Bei HDFS-HA-Bereitstellungen müssen Sie HttpFS verwenden." (http: //www.cloudera.com/content/cloudera/de/documentation/cdh4/v4-2-0/CDH4-Installationsanleitung/cdh4ig_topic_15_4.html) – Arnaud

Verwandte Themen