2014-07-23 61 views
0

我是hadoop文件系統的新手。我沒有在谷歌上找到有關Hadoop FileSystem的有用鏈接。擁有kerberose的Hadoop文件系統

我想在使用Hadoop FileSystem時使用Kerberose進行身份驗證。

示例代碼:

Path src = new Path("C:\\testing\\a\\a.avro"); 
    Path dest = new Path("webhdfs://aaaa:50070/dummy/dummy.avro"); 
    WebHdfsFileSystem web = new WebHdfsFileSystem(); 
    try { 
     Configuration conf = new Configuration(); 
     conf.set("fs.default.name","webhdfs://aaaa:50070"); 
     web.setConf(conf); 
     FileSystem fs = FileSystem.get(web.getConf()); 
     fs.copyFromLocalFile(false,src,dest); 
    } catch (IOException e) { 
     e.printStackTrace(); 
    } 
} 

我如何實現與上面的代碼的Kerberos authication?如何設置原則和keytab值?

+1

好的,問題是什麼? –

回答

0

您的問題的簡短答案是:您的hdfs客戶端代碼知道如何配置一切正確(與您在此發佈的代碼無關)如何進行身份驗證。

我建議您閱讀Hadoop安全教程。

看來你的HDFS客戶端是Windows系統。要訪問Kerberized羣集(包括Kerberized HDFS),您需要啓用TGT會話訪問,請參閱Registry Key to Allow Session Keys to Be Sent in Kerberos Ticket-Granting-Ticket,並且您必須確保您的過程不是受UAC限制的管理員(請參閱Access to Session Keys not possible using a restricted Token)。

您的羣集不能是Windows羣集,Kerberized Windows羣集仍在開發中(YARN-1063,YARN-1972等)。