本篇内容介绍了"执行职位时怎么省略输入关系型数据库保存密码"的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
一、删除Job
sqoop作业\
-删除测试作业
二、创建Job
说明:在创建职位时,我们使用-密码-文件参数,而且非-帕索沃德。主要原因是在执行职位时使用-密码参数将有警告,并且需要输入密码才能执行工作。当我们采用-密码-文件参数时,执行职位无需输入数据库密码。
sqoop作业\
-创建测试作业\
- \
导入\
-连接JDBC : MySQL ://192。168 .13713333336
-用户名根目录\
-密码-文件/输入/sqoop.pwd \
-表abc \
-目标-目录/输入/abc \
-删除-目标-目录\
-m 1
注:import与"--"之间必须要有一个空格三、执行Job
sqoop作业\
-执行测试作业
四、创建--password-file参数需要的密码文件(注:sqoop规定密码文件必须放在HDFS之上,并且权限必须为400)1、操作命令:
echo -n '123456' sqoop.pwd
HDFS DFS-RM sqoop。pwd/input/sqoop。显示当前工作目录
hdfs dfs -put sqoop.pwd /input
HDFS DFS-chmod 400/输入/输出。显示当前工作目录
HDFS输入
-r-1 Hadoop超级组6 2018-01-15 18:38/input/sqoop。显示当前工作目录
2、检查sqoop的配置文件(sqoop-site.xml)是否存在以下配置,并且value值为true
财产
namesqoop.metastore.client.record.password/name
值真/值
描述如果为真,允许在元存储中保存密码。
/描述
/property
注:
password文件的格式不对错误提示如下:
-
arning: /app/sqoop-1.4.6-cdh6.7.0/../hbase does not exist! HBase imports will fail.
-
Please set $HBASE_HOME to the root of your HBase installation.
-
Warning: /app/sqoop-1.4.6-cdh6.7.0/../hcatalog does not exist! HCatalog jobs will fail.
-
Please set $HCAT_HOME to the root of your HCatalog installation.
-
Warning: /app/sqoop-1.4.6-cdh6.7.0/../accumulo does not exist! Accumulo imports will fail.
-
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
-
Warning: /app/sqoop-1.4.6-cdh6.7.0/../zookeeper does not exist! Accumulo imports will fail.
-
Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.
-
18/01/15 18:33:50 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh6.7.0
-
18/01/15 18:33:53 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
-
18/01/15 18:33:53 INFO tool.CodeGenTool: Beginning code generation
-
18/01/15 18:33:54 ERROR manager.SqlManager: Error executing statement: java.sql.SQLException: Access denied for user 'root'@'spark220' (using password: YES)
-
java.sql.SQLException: Access denied for user 'root'@'spark220' (using password: YES)
-
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
-
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
-
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
-
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:873)
-
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1710)
-
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)
-
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2188)
-
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2219)
-
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2014)
-
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:776)
-
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
-
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
-
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
-
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
-
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
-
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
-
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
-
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
-
at java.sql.DriverManager.getConnection(DriverManager.java:664)
-
at java.sql.DriverManager.getConnection(DriverManager.java:247)
-
at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:904)
-
at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
-
at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:763)
-
at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:786)
-
at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:289)
-
at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:260)
-
at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:246)
-
at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:327)
-
at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1846)
-
at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1646)
-
at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)
-
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
-
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
-
at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
-
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
-
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
-
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
-
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
-
at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
-
18/01/15 18:33:54 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: No columns to generate for ClassWriter
-
at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1652)
-
at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)
-
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
-
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
-
at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
-
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
-
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
-
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
-
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
-
at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
“执行Job时怎么省略输入MySQL保存密码”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注网站,小编将为大家输出更多高质量的实用文章!
内容来源网络,如有侵权,联系删除,本文地址:https://www.230890.com/zhan/156542.html