问题
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