我使用下面的语法从teradataster数据库表事务中读取数据并加载到hadoop/hive表中
我在中添加了以下jar文件 /usr/iop/4.1.0.0/sqoop/lib
文件夹
terajdbc4.jar
tdgssconfig.jar
noarch-aster-jdbc-driver.jar
语法:
sqoop import --connect jdbc:ncluster://hostname.gm.com:2406/Database=test --username abcde --password test33 --table aqa.transaction
错误:
Warning: /usr/iop/4.1.0.0/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
16/12/14 15:38:49 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6_IBM_20
16/12/14 15:38:49 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
16/12/14 15:38:49 ERROR tool.BaseSqoopTool: Got error creating database manager: java.io.IOException: No manager for connect string: jdbc:ncluster://hostname.gm.com:2406/Database=test
at org.apache.sqoop.ConnFactory.getManager(ConnFactory.java:191)
at org.apache.sqoop.tool.BaseSqoopTool.init(BaseSqoopTool.java:256)
at org.apache.sqoop.tool.ImportTool.init(ImportTool.java:89)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:593)
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)
2条答案
按热度按时间yc0p9oo01#
添加
--connection-manager <class-name>
在sqoop命令中,如果在sqoop中rdbms可用。否则,添加
--driver <driver-name>
在sqoop命令中使用通用连接管理器。oaxa6hgo2#
您可以尝试使用aster的jdbcjar。
以下是我在使用sqoop导入aster表之后创建外部配置单元表所遵循的一些步骤:
从下载jdbcjarhttps://aster-community.teradata.com/docs/doc-2254
export hadoop\u classpath=$hadoop\u classpath:$pwd/noarch-aster-jdbc-driver.jar
sqoop import-d mapreduce.job.name=“aster表tablename的sqoop配置单元导入”--连接”jdbc:ncluster://x.x.x.x/database”--driver com.asterdata.ncluster.driver--用户名“user1”--密码“password”--查询“select*from schema.table where$conditions limit 10”--按col1拆分--作为avrodatafile--target dir/tmp/aster/tablename
在目标目录上创建外部配置单元表或用配置单元表选项替换avrodatafile。