2016-12-14 46 views
0

我使用的是下面的語法從Teradata的紫苑數據庫表的事務讀取並加載到Hadoop的/蜂房表紫苑數據庫到Hadoop的使用Sqoop

我已經添加了以下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) 

回答

0

在您的sqoop命令中添加--connection-manager <class-name>(如果在sqoop中可用於您的RDBMS)。

否則,請在您的sqoop命令中添加--driver <driver-name>以使用通用連接管理器。

0

您可以嘗試使用Aster的JDBC jar。

這裏有一些步驟,我跟着導入使用Sqoop的紫苑表後創建外部蜂巢表:

  1. 下載JDBC罐子從https://aster-community.teradata.com/docs/DOC-2254

  2. 出口HADOOP_CLASSPATH = $ HADOOP_CLASSPATH:$ PWD /noarch-aster-jdbc-driver.jar

  3. sqoop import -D mapreduce.job.name =「Aster table tableName的Sqoop Hive導入」--connect「jdbc:ncluster:// XXXX/database」 - 司機com.asterdata.ncluster.Driver --username「user1」--password「password」--query「select * from schema.table where \ $ CONDITIONS limit 10」--split-by col1 --as-avrodatafile --target -dir/tmp/aster/tableName

  4. 在目標目錄上創建外部Hive表或使用配置單元表選項替換avrodatafile。

相關問題