Hadoop Credentials using Password File

Viewed 1943

I was going through the doncumentaion of Hadoop Credentials as provided in https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/CredentialProviderAPI.html

But while using the 3rd option to Provide password for keystone using password file, I am getting a failure everytime. An excerpt of the command used is provided below. Can anyone tell me what is the error and how to rectify this.

hadoop credential -Dhadoop.security.credstore.java-keystore-provider.password-file=/home/dir/test.txt create mssql2.password -value 'SomePassword' -provider localjceks://file/home/dir/aws3.jceks

The Error is provided below:

java.io.IOException: Password file does not exist at org.apache.hadoop.security.ProviderUtils.locatePassword(ProviderUtils.java:135) at org.apache.hadoop.security.alias.AbstractJavaKeyStoreProvider.locateKeystore(AbstractJavaKeyStoreProvider.java:323) at org.apache.hadoop.security.alias.AbstractJavaKeyStoreProvider.(AbstractJavaKeyStoreProvider.java:86) at org.apache.hadoop.security.alias.LocalJavaKeyStoreProvider.(LocalJavaKeyStoreProvider.java:58) at org.apache.hadoop.security.alias.LocalJavaKeyStoreProvider.(LocalJavaKeyStoreProvider.java:50) at org.apache.hadoop.security.alias.LocalJavaKeyStoreProvider$Factory.createProvider(LocalJavaKeyStoreProvider.java:177) at org.apache.hadoop.security.alias.CredentialProviderFactory.getProviders(CredentialProviderFactory.java:58) at org.apache.hadoop.security.alias.CredentialShell$Command.getCredentialProvider(CredentialShell.java:181) at org.apache.hadoop.security.alias.CredentialShell$CreateCommand.validate(CredentialShell.java:345) at org.apache.hadoop.security.alias.CredentialShell.run(CredentialShell.java:81) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) at org.apache.hadoop.security.alias.CredentialShell.main(CredentialShell.java:460)

1 Answers

The problem is, this property expect the file name not the file path and then Hadoop api will search for this name on the Hadoop Classpath. Since this file contains clear text so another way is to just
export HADOOP_CREDSTORE_PASSWORD=${PASSWORD}

Related