来自本地文件系统的 sqoop 密码文件

sqoop password file from local file system

sqoop import --connect "jdbc:mysql:" --username sqoopuser --password-file HDFS directory  

正在工作

sqoop import --connect "jdbc:mysql:" --username sqoopuser --password-file Local FS Directory  

不工作。它正在抛出一个文件不存在的错误。

Sqoop 文档说:

Secure way of supplying password to the database. You should save the password in a file on the users home directory with 400 permissions and specify the path to that file using the --password-file argument, and is the preferred method of entering credentials. Sqoop will then read the password from the file and pass it to the MapReduce cluster using secure means with out exposing the password in the job configuration. The file containing the password can either be on the Local FS or HDFS.

我真的不知道sqoop是如何决定路径是HDFS还是Local FS的。

假设您的密码存储在/home/${user}/password.file本地文件系统

而不是使用

--password-file /home/${user}/password.file

使用

--password-file file:///home/${user}/password.file