2016-05-04 7 views
3

Kerberosを有効にしてSparkアプリケーションをHBaseに接続しようとしています。スパークのバージョンは1.5.0、CDH 5.5.2は糸クラスターモードで実行されます。KerberosでHBaseを保護するためのsparkアプリケーションの接続方法

HbaseContextが初期化されると、それはこのエラーがスローされます。

ERROR ipc.AbstractRpcClient: SASL authentication failed. The most likely cause is missing or invalid credentials. Consider 'kinit'. javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)]

私は追加して、コード内で認証を行うことを試みた:

UserGroupInformation.setConfiguration(config) 
UserGroupInformation.loginUserFromKeytab(principalName, keytabFilename) 

私は--filesとkeytabファイルを配布しますspark-submitのオプション。 は今、エラーは次のようになります。これは、SparkアプリからKerberos対応のHBaseに接続する方法

java.io.IOException: Login failure for [email protected] from keytab krb5.usercomp.keytab: javax.security.auth.login.LoginException: Unable to obtain password from user ...

Caused by: javax.security.auth.login.LoginException: Unable to obtain password from user at com.sun.security.auth.module.Krb5LoginModule.promptForPass(Krb5LoginModule.java:856)

ですか?

+0

conf.set( "hadoop.security.authentication"、 "Kerberos")が見つかりませんでした。 ? –

答えて

1

べき(あなたがhadoop.security.authentication

val conf= HBaseConfiguration.create() 
conf.set("hbase.zookeeper.quorum", "list of ip's") 
conf.set("hbase.zookeeper"+ ".property.clientPort","2181"); 
conf.set("hbase.master", "masterIP:60000"); 
conf.set("hadoop.security.authentication", "kerberos"); 
+0

私のアプリケーションのクラスパスにあるhbase-site.xmlにこの設定をしています – artemisa

+0

ここにあなたのspark-submitコマンドを貼り付けることはできますか? –

+0

こんにちはあなたplsチェックすることができますhttp://www.cloudera.com/documentation/enterprise/5-5-x/topics/cm_sg_sec_troubleshooting.html#topic_17_1_10 –

0

のようなものが欠落している場合は実際にあなたのエッジノードのSPARK_CONFディレクトリに直接あなたのHBase-site.xmlのを入れてみてください以下のような構成例を参照してください。/etc/spark/confや/ etc/spark2/confのようなものでなければなりません)。

0

あなたはloginUserFromKeytabAndReturnUGI、およびuig.doAs

を使用するか、SPARK_DIST_CLASSPATHにあなたのHBaseのクラスパスを入れることができます。

関連する問題