Installing the Teradata Connector with CDH5

5 篇文章 0 订阅

1. Install the Sqoop connector by opening the distribution archive in a convenient location such as /usr/lib.
   Opening the distribution creates a directory that contains the jar file of the compiled version of the connector.
   Note path to this jar file. The directory that is created when the file is expanded varies according to which
   connector you are using. Examples of typeical resulting paths include:
   Cloudera Connector Powered by Teradata 1.2cX: /user/lib/sqoop-connector-teradata-1.2cX/sqoop-connector-teradata-1.2cX.jar


2. Copy the Teradata JDBC drivers(terajdbc4.jar) and (tdgssconfig.jar) to the lib directory of the Sqoop installation.
   You can obtain these drivers by extracting them from the Teradata Connector JAR that you downloaded from https://www.cloudera.com/downloads/connectors/sqoop/teradata/1-2c5.html.
   Without there drivers, the connector will not function correctly.
   
3. Comfirm that the managers.d directory exists in the Sqoop configuration directory.
   Note: Depending on how Sqoop is installed, its configuration directory can be in /etc/sqoop/conf, /usr/lib/sqoop/conf,
   or elsewhere if Sqoop was installed using the tarball distribution.
   
   if the managers.d directory does not exist, create it and ensure that the directory permissions are set to 755.
   
4. Create a text file in the managers.d directory with a descriptive name such as cldra_td_connector.
   Ensure the file permissions are set to 644
   
5. The cldra_td_connector file must have the connector class name followed by the complete path to the directory where the jar is located.
   For example, for the Cloudera Connector powered by Teradata 1.2cX:
   
   com.cloudera.connector.teradata.TeradataManagerFactory = /usr/lib/sqoop-connector-teradata-1.2cX/sqoop-connector-teradata-1.2cX.jar
   
   TeradataManagerFactory acts as a single point of delegation for invoking the connector bundled with this distribution.Alternatively,
   you can specify TeradataManagerFactory inside a sqoop-site.xml file, which must be inside a classpath directory.
   
   If you are using Cloudera Connector powered by Teradata, use the following:
   
   <configuration>
     <property>
        <name>sqoop.connection.factories</name>
        <value>com.cloudera.connector.teradata.TeradataManagerFactory</value>
     </property>
   </configuration>
   
 https://docs.cloudera.com/documentation/other/connectors/teradata/1-x/topics/cctd_topic_3.html#concept_kv1_cj2_4n

 

sqoop import script:

sqoop import --connect jdbc:teradata://xx.xx.xx.xx/CLIENT_CHARSET=EUC_CN,TMODE=TERA,CHARSET=ASCII,LOB_SUPPORT=off, DATABASE=xxxx --username $2 --password $3 \

--query "select $5 from $4 where $6 and \$CONDITIONS" --target-dir ${10} --verbose --num-mappers 1\

--hive-import --hive-database $7 --hive-table $8 --hive-overwrite \

--hive-drop-import-delims --null-string '\\N' --null-non-string '\\N' \

--hive-partition-key partition_name --hive-partition-value $9 \

--driver com.teradata.jdbc.TeraDriver

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值