2016-09-13 8 views
0

hadoopとkerberosをインストールしました。ですが、i exec hadoop fs -ls /にエラーが発生しました。Kerberosを使用したHadoopへのアクセスに失敗しました

[[email protected] logs]$ hadoop fs -ls/
16/09/13 11:34:39 WARN ipc.Client: Exception encountered while connecting to the server : javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)] 
ls: Failed on local exception: java.io.IOException: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)]; Host Details : local host is: "localhost/127.0.0.1"; destination host is: "192.168.168.46":9000; 

私はデータノードを見ることができますし、名前ノードは、私は、私はその後、hdfs.keytab

kadmin.local: listprincs 
HTTP/[email protected] 
K/[email protected] 
dannil/[email protected] 
hdfs/[email protected] 
kadmin/[email protected] 
kadmin/[email protected] 
kadmin/[email protected] 
kiprop/[email protected] 
krbtgt/[email protected] 

を生成するためにxst -norandkey -k hdfs.keytab hdfs/[email protected] HTTP/[email protected]を使用し、主要hdfs/[email protected]HTTP/[email protected]追加jps

20963 DataNode 
    21413 SecondaryNameNode 
    20474 NameNode 
    22906 Jps 

で起動しています私はエグゼクティブkinit -kt /home/dannil/hadoop-2.7.1/hdfs.keytab hdfs/oz.flex

私は私のチケットのステータスを確認することができます。

[[email protected] ~]$ klist 
Ticket cache: KEYRING:persistent:1000:krb_ccache_4h73plA 
Default principal: hdfs/[email protected] 

Valid starting  Expires    Service principal 
2016-09-13T10:47:06 2016-09-14T10:47:06 krbtgt/[email protected] 

これが私のHadoopの設定値である:

コア-site.xmlの:

fs.defaultFS=hdfs://192.168.168.46:9000 
hadoop.security.authentication=kerberos 
hadoop.security.authorization=true 

HDFS-site.xmlを:

dfs.replication=1 
dfs.permissions=false 
dfs.block.access.token.enable=true 
dfs.namenode.keytab.file=/home/dannil/hadoop-2.7.1/hdfs.keytab 
dfs.namenode.kerberos.principal=hdfs/[email protected] 
dfs.namenode.kerberos.internal.spnego.principal=HTTP/[email protected] 
dfs.secondary.namenode.keytab.file=/home/dannil/hadoop-2.7.1/hdfs.keytab 
dfs.secondary.namenode.kerberos.principal=hdfs/[email protected] 
dfs.secondary.namenode.kerberos.internal.spnego.principal=HTTP/[email protected] 
dfs.datanode.data.dir.perm=700 
dfs.datanode.address=0.0.0.0:61004 
dfs.datanode.http.address=0.0.0.0:61006 
dfs.datanode.keytab.file=/home/dannil/hadoop-2.7.1/hdfs.keytab 
dfs.datanode.kerberos.principal=hdfs/[email protected] 
dfs.https.port=50470 
dfs.https.address=0.0.0.0:50470 
dfs.webhdfs.enabled=true 
dfs.web.authentication.kerberos.principal=HTTP/[email protected] 
dfs.web.authentication.kerberos.keytab=/home/dannil/hadoop-2.7.1/hdfs.keytab 
dfs.http.policy=HTTPS_ONLY 
dfs.data.transfer.protection=integrity 

どのようにエラーが発生しましたか?問題を解決するために何をすべきか?


+0

'KEYRING:'については忘れて、チケットキャッシュのデフォルトの 'FILE:'実装を試してください。これは、KerberosクライアントのJava実装のHadoop「ハック」で動作します。 –

+0

Kerberosトレースログを有効にするには、環境では 'export HADOOP_JAAS_DEBUG = true'、カスタムJavaオプションでは' -Dsun.security.krb5.debug = true'を参照してください。 https://steveloughran.gitbooks.io/kerberos_and_hadoop/content/sections/secrets.html(本当にKerberosとHadoopを混乱させたい場合はGitBook全体を読む必要があります) –

答えて

0
  1. それはその後、動作していないなら「HDFS」ユーザとしてコマンドを実行し、
  2. をチェックしてみてください、あなたは、Kerberosは、/ etc/sshを/」、SSHの設定ファイルで有効になっているかどうか、確認してくださいすることができますsshd_config 'で、' KerberosAuthentication Yes 'と' GSSAPIAuthentication Yes 'の行を確認します。デフォルトではコメントアウトされるので、コメントを外してyesに変更します。

ここで、問題が解決したかどうかをお知らせください。それが他の人にとって有益なものになるように。

関連する問題