hadoop-hdfs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brahma Reddy Battula <brahmareddy.batt...@huawei.com>
Subject FW: [Hadoop-SecureMode-Webconsole]Mismatch in documentation and Code
Date Tue, 25 Sep 2012 06:36:25 GMT

________________________________
From: Brahma Reddy Battula
Sent: Monday, September 24, 2012 11:12 PM
To: user@hadoop.apache.org
Subject: [Hadoop-SecureMode-Webconsole]Mismatch in documentation and Code


Dear All,

I started cluster in secure-mode by going through following document.

http://hadoop.apache.org/docs/r1.0.3/HttpAuthentication.html


Got following exception from Name-node.

throw new RuntimeException("Could not read HTTP signature secret file: " + signatureSecretFile);


Then I debugged the code and checked,,Problem with "hadoop.http.authentication.signature.secret"
configuration.

Code(AuthenticationFilter.java):

static final String SIGNATURE_SECRET_FILE = AuthenticationFilter.SIGNATURE_SECRET + ".file";


While Putting into map(" hadoop.http.authentication.signature.secret" is putting)

 for (Map.Entry<String, String> entry : conf) {
      String name = entry.getKey();
      if (name.startsWith(PREFIX)) {
        String value = conf.get(name);
        name = name.substring(PREFIX.length());
        filterConfig.put(name, value);
      }
    }

Getting from Map:(" hadoop.http.authentication.signature.secret.file" is getting)

    String signatureSecretFile = filterConfig.get(SIGNATURE_SECRET_FILE);
    if (signatureSecretFile == null) {
      throw new RuntimeException("Undefined property: " + SIGNATURE_SECRET_FILE);
    }

    try {
      StringBuilder secret = new StringBuilder();
      Reader reader = new FileReader(signatureSecretFile);
      int c = reader.read();
      while (c > -1) {
        secret.append((char)c);
        c = reader.read();
      }
      reader.close();
      filterConfig.put(AuthenticationFilter.SIGNATURE_SECRET, secret.toString());
    } catch (IOException ex) {
      throw new RuntimeException("Could not read HTTP signature secret file: " + signatureSecretFile);

}



Here I have two questions:

i) why we are puting hadoop.http.authentication.signature.secret and getting hadoop.http.authentication.signature.secret.file..I
mean purpose of this..?(I did not gone thru fully).

ii)If we configure "hadoop.http.authentication.signature.secret.file",we wn't get any exception..

If this is the expectation then better to change documentation.


Please let me know if this needs file..I'll file jira.



Thanks And Regards
Brahma Reddy


Mime
View raw message