Is Kerberos Authentication supported in WASB in Azure VM?

为君一笑 提交于 2019-12-25 09:25:16

问题


I have created Linux Azure VM and running Java application on it. Then I created HDInsight Spark Cluster which has hdfs, yarn, spark, etc.

I have connected VM with Spark cluster using the Storage Access Key in core-site.xml on VM.

core-site.xml

<property>
  <name>fs.azure.account.key.YOUR_ACCOUNT.blob.core.windows.net</name>
  <value>Storage_Access_Key</value>
</property>

and I am able to authenticate my application with above. But I want to authenticate for my JAVA application using Kerberos in Azure Blob Storage (WASB) on Azure VM.

Is there any possible options and documentation for it ? Kindly help me


回答1:


First, please make sure that the Kerberos authentication has been configured for HDInsight. If not sure, please refer to the hortonworks offical documents https://docs.hortonworks.com/HDPDocuments/Ambari-2.1.2.1/bk_Ambari_Security_Guide/content/ch_configuring_amb_hdp_for_kerberos.html to do it.

Second, you can try to refer to the Hadoop offical document for Authentication with Kerberos to configure your webapp.

Or you can manually authenticate with Kerberos in programming as below.

import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.conf.Configuration 

Configuration conf = new Configuration();
conf.set("hadoop.security.authentication", "Kerberos");
UserGroupInformation.setConfiguration(conf);
UserGroupInformation.loginUserFromKeytab("<username>", "/path/to/kerberos.keytab"); 

Then

FileSystem fs = FileSystem.get(conf);

As reference, you also can refer to the third party blogs(1, 2) to know more details.



来源:https://stackoverflow.com/questions/41427731/is-kerberos-authentication-supported-in-wasb-in-azure-vm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!