1, start Sqoop error: Error sqoop. Sqoop:got exception running Sqoop:java.lang.RuntimeException:Could not load DB driver Class:com.mysql.jdbc.Driver
[Root@slave bin]#./sqoop list-databases--connect jdbc:mysql://192.168.20.128:3306/hive--username Hive--password 123456 Warning:/home/hadoop/sqoop-1.4.6/bin/. /.. /hbase does not exist! HBase imports would fail.
Please set $HBASE _home to the root of your HBASE installation.
Warning:/home/hadoop/sqoop-1.4.6/bin/. /.. /hcatalog does not exist! Hcatalog jobs would fail.
Please set $HCAT _home to the root of your hcatalog installation.
Warning:/home/hadoop/sqoop-1.4.6/bin/. /.. /accumulo does not exist! Accumulo imports would fail.
Please set $ACCUMULO _home to the root of your Accumulo installation.
Warning:/home/hadoop/sqoop-1.4.6/bin/. /.. /zookeeper does not exist! Accumulo imports would fail.
Please set $ZOOKEEPER _home to the root of your zookeeper installation.
17/02/20 18:56:29 INFO Sqoop. Sqoop:running Sqoop version:1.4.6-cdh5.5.2
17/02/20 18:56:29 WARN tool. Basesqooptool:setting your password on the command-line is insecure. Consider Using-p instead.
17/02/20 18:56:30 INFO Manager. Mysqlmanager:preparing to use a MySQL streaming resultset.
17/02/20 18:56:30ERROR Sqoop. Sqoop:got exception running Sqoop:java.lang.RuntimeException:Could not load DB driver Class:com.mysql.jdbc.Driver
Java.lang.RuntimeException:Could not load DB driver Class:com.mysql.jdbc.Driver
At Org.apache.sqoop.manager.SqlManager.makeConnection (sqlmanager.java:856)
At Org.apache.sqoop.manager.GenericJdbcManager.getConnection (genericjdbcmanager.java:52)
At Org.apache.sqoop.manager.CatalogQueryManager.listDatabases (catalogquerymanager.java:57)
At Org.apache.sqoop.tool.ListDatabasesTool.run (listdatabasestool.java:49)
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)
###########################
Solution:
[Root@slave lib]# JPS
4274 Jps
3256 Datanode
3689 NodeManager
3162 Namenode
4043 Quorumpeermain
3596 ResourceManager
3439 Secondarynamenode
[Root@slave lib]#Cd/home/hadoop/hive-1.2.1/lib
[Root@slave lib]# LL
Total 96116
-rw-rw-r--1 Hadoop Hadoop 4368200 APR 2015 Accumulo-core-1.6.0.jar
...
-rw-r--r--1 root root 846263 Feb 19:02 Mysql-connector-java-5.1.24-bin.jar
[Root@slave lib]#CP Mysql-connector-java-5.1.24-bin.jar/home/hadoop/sqoop-1.4.6/lib
Run again:
[Root@slave bin]#./sqoop list-databases--connect jdbc:mysql://192.168.20.128:3306/hive--username Hive--password 123456
Warning:/home/hadoop/sqoop-1.4.6/bin/. /.. /hbase does not exist! HBase imports would fail.
Please set $HBASE _home to the root of your HBASE installation.
Warning:/home/hadoop/sqoop-1.4.6/bin/. /.. /hcatalog does not exist! Hcatalog jobs would fail.
Please set $HCAT _home to the root of your hcatalog installation.
Warning:/home/hadoop/sqoop-1.4.6/bin/. /.. /accumulo does not exist! Accumulo imports would fail.
Please set $ACCUMULO _home to the root of your Accumulo installation.
Warning:/home/hadoop/sqoop-1.4.6/bin/. /.. /zookeeper does not exist! Accumulo imports would fail.
Please set $ZOOKEEPER _home to the root of your zookeeper installation.
17/02/20 19:02:52 INFO Sqoop. Sqoop:running Sqoop version:1.4.6-cdh5.5.2
17/02/20 19:02:52 WARN tool. Basesqooptool:setting your password on the command-line is insecure. Consider Using-p instead.
17/02/20 19:02:53 INFO Manager. Mysqlmanager:preparing to use a MySQL streaming resultset.
Information_schema
Hive
Mysql
Performance_schema
Test
. Detection using
This SQOOP1 installation is complete, more simple than SQOOP2. We can use the following Sqoop command to detect whether the installation is successful:
Bin/sqoop Help
Note that a warning may be reported here:
Warning:/home/hadoop/deploy/sqoop-1.4.6.bin__hadoop-2.0.4-alpha//. /hcatalog does not exist! Hcatal;
Warning:/home/hadoop/deploy/sqoop-1.4.6.bin__hadoop-2.0.4-alpha//. /accumulo does not exist! Accumulo imports would fail.
This is mainly because the hcatal and Accumulo environment variables are not installed in the cluster, but Sqoop detects the two components by default. If you want to remove the two detections, you can modify the Bin/config-sqoop file, and it's easy to find the detection location of both components