-
Notifications
You must be signed in to change notification settings - Fork 8
Installing custom sqoop database drivers for Import Data Scheduler
Initially, the Data Import Job Scheduler is configured with PostgreSQL drivers only.
Installing additional supported drivers, including MySQL, Oracle, and Teradata, requires some manual steps, as described below:
- Check for enabled databases (optional step), using the following commands (as appropriate).
$ cf target -o trustedanalytics -s platform
$ cf env workflow-scheduler|grep SQOOP_DATABASE
SQOOP_DATABASE_MYSQL: false
SQOOP_DATABASE_ORACLE: false
SQOOP_DATABASE_POSTGRESQL: true
SQOOP_DATABASE_TERADATA: false
- Download drivers refer to following list of databases with required files:
- Oracle: ojdbc6.jar Oracle website
- Teradata: terajdbc4.jar, tdgssconfig.jar Teradata website
- Mysql: mysql-connector-java-5.1.6.jar Mysql website
- (Kerberos environment only) Get the HDFS superuser keytab (can be obtained from env of auth-gateway or hdfs-broker - it's base64 encoded), as follows:
$ cf target -o trustedanalytics -s platform$ cf env auth-gateway|grep HDFS_KEYTAB| awk '{print $2}' |base64 --decode > authgateway.keytab
-
Upload your driver and keytab files to cdh-master-2, as follows:
$scp *.jar cdh-jumpbox:$ssh cdh-jumpbox$sudo scp *.jar ec2-user@cdh-master-2: -
Ssh into cdh-master-2, as follows:
$sudo ssh ec2-user@cdh-master-2 -
(No-kerberos environment only) Move the driver files to /tmp/sqoop_drivers directory, as follows:
$mkdir /tmp/sqoop_drivers$mv *.jar /tmp/sqoop_drivers -
Obtain the HDFS superuser identity, executing the following commands:
-
Environments with Kerberos:
$ kinit -kt authgateway.keytab authgateway/sys -
Environments without Kerberos:
$sudo bash$su hdfs$cd /tmp/sqoop_drivers
- Put the drivers in the HDFS directory /user/oozie/share/lib/, as follows:
$ hadoop fs -put *.jar /user/oozie/share/lib
-
Restart Oozie in Cloudera Manager.
-
Enable the database in the TAP workflow-scheduler app, using the following commands:
$ cf set-env workflow-scheduler SQOOP_DATABASE_MYSQL true
Setting env variable 'SQOOP_DATABASE_MYSQL' to 'true' for the workflow-scheduler in org trustedanalytics / space platform as system admin...
**Tip:** Use 'cf restage' to ensure your env variable changes take effect, as follows:
`$ cf restage workflow-scheduler`
Once the workflow-scheduler has been restaged, you can import data using the TAP Import Job Scheduler using the newly installed drivers.