Sqoop从mysql导入数据HDFS出错

$ sqoop import --connect jdbc:mysql://localhost:3306/mydb --username root --P --table students -m 1 --delete-target-dir
Warning: /usr/local/sqoop/../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /usr/local/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
Warning: /usr/local/sqoop/../zookeeper does not exist! Accumulo imports will fail.
Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.
2020-07-16 19:00:37,703 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
Enter password: 
2020-07-16 19:00:39,154 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
2020-07-16 19:00:39,160 INFO tool.CodeGenTool: Beginning code generation
2020-07-16 19:00:39,885 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `students` AS t LIMIT 1
2020-07-16 19:00:39,963 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `students` AS t LIMIT 1
2020-07-16 19:00:39,972 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /usr/local/hadoop
注: /tmp/sqoop-hadoop/compile/b06c6acad69cdd89c91ddf66368c2df7/students.java使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
2020-07-16 19:00:42,793 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-hadoop/compile/b06c6acad69cdd89c91ddf66368c2df7/students.jar
2020-07-16 19:00:44,457 INFO tool.ImportTool: Destination directory students deleted.
2020-07-16 19:00:44,457 WARN manager.MySQLManager: It looks like you are importing from mysql.
2020-07-16 19:00:44,457 WARN manager.MySQLManager: This transfer can be faster! Use the --direct
2020-07-16 19:00:44,457 WARN manager.MySQLManager: option to exercise a MySQL-specific fast path.
2020-07-16 19:00:44,458 INFO manager.MySQLManager: Setting zero DATETIME behavior to convertToNull (mysql)
2020-07-16 19:00:44,467 INFO mapreduce.ImportJobBase: Beginning import of students
2020-07-16 19:00:44,473 INFO Configuration.deprecation: mapred.job.tracker is deprecated. Instead, use mapreduce.jobtracker.address
2020-07-16 19:00:44,500 INFO Configuration.deprecation: mapred.jar is deprecated. Instead, use mapreduce.job.jar
2020-07-16 19:00:44,545 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps
2020-07-16 19:00:44,865 INFO impl.MetricsConfig: loaded properties from hadoop-metrics2.properties
2020-07-16 19:00:45,033 INFO impl.MetricsSystemImpl: Scheduled Metric snapshot period at 10 second(s).
2020-07-16 19:00:45,033 INFO impl.MetricsSystemImpl: JobTracker metrics system started
2020-07-16 19:00:45,738 INFO db.DBInputFormat: Using read commited transaction isolation
2020-07-16 19:00:45,789 INFO mapreduce.JobSubmitter: number of splits:1
2020-07-16 19:00:46,050 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_local1258409818_0001
2020-07-16 19:00:46,056 INFO mapreduce.JobSubmitter: Executing with tokens: []
2020-07-16 19:00:46,460 INFO mapred.LocalDistributedCacheManager: Creating symlink: /usr/local/hadoop/tmp/mapred/local/1594897246242/libjars <- /home/hadoop/libjars/*
2020-07-16 19:00:46,465 WARN fs.FileUtil: Command 'ln -s /usr/local/hadoop/tmp/mapred/local/1594897246242/libjars /home/hadoop/libjars/*' failed 1 with: ln: 无法创建符号链接'/home/hadoop/libjars/*': 没有那个文件或目录
 
2020-07-16 19:00:46,467 WARN mapred.LocalDistributedCacheManager: Failed to create symlink: /usr/local/hadoop/tmp/mapred/local/1594897246242/libjars <- /home/hadoop/libjars/*
2020-07-16 19:00:46,468 INFO mapred.LocalDistributedCacheManager: Localized file:/tmp/hadoop/mapred/staging/hadoop1258409818/.staging/job_local1258409818_0001/libjars as file:/usr/local/hadoop/tmp/mapred/local/1594897246242/libjars
2020-07-16 19:00:46,628 INFO mapreduce.Job: The url to track the job: http://localhost:8080/
2020-07-16 19:00:46,629 INFO mapreduce.Job: Running job: job_local1258409818_0001
2020-07-16 19:00:46,638 INFO mapred.LocalJobRunner: OutputCommitter set in config null
2020-07-16 19:00:46,678 INFO output.FileOutputCommitter: File Output Committer Algorithm version is 2
2020-07-16 19:00:46,683 INFO output.FileOutputCommitter: FileOutputCommitter skip cleanup _temporary folders under output directory:false, ignore cleanup failures: false
2020-07-16 19:00:46,687 INFO mapred.LocalJobRunner: OutputCommitter is org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter
2020-07-16 19:00:46,795 INFO mapred.LocalJobRunner: Waiting for map tasks
2020-07-16 19:00:46,796 INFO mapred.LocalJobRunner: Starting task: attempt_local1258409818_0001_m_000000_0
2020-07-16 19:00:46,865 INFO output.FileOutputCommitter: File Output Committer Algorithm version is 2
2020-07-16 19:00:46,867 INFO output.FileOutputCommitter: FileOutputCommitter skip cleanup _temporary folders under output directory:false, ignore cleanup failures: false
2020-07-16 19:00:46,937 INFO mapred.Task:  Using ResourceCalculatorProcessTree : [ ]
2020-07-16 19:00:46,972 INFO db.DBInputFormat: Using read commited transaction isolation
2020-07-16 19:00:46,987 INFO mapred.MapTask: Processing split: 1=1 AND 1=1
2020-07-16 19:00:47,016 INFO mapred.LocalJobRunner: map task executor complete.
2020-07-16 19:00:47,025 WARN mapred.LocalJobRunner: job_local1258409818_0001
java.lang.Exception: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class students not found
at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:492)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:552)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class students not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2638)
at org.apache.sqoop.mapreduce.db.DBConfiguration.getInputClass(DBConfiguration.java:403)
at org.apache.sqoop.mapreduce.db.DataDrivenDBInputFormat.createDBRecordReader(DataDrivenDBInputFormat.java:270)
at org.apache.sqoop.mapreduce.db.DBInputFormat.createRecordReader(DBInputFormat.java:266)
at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.<init>(MapTask.java:527)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:770)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:347)
at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:271)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: Class students not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2542)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2636)
... 12 more
2020-07-16 19:00:47,634 INFO mapreduce.Job: Job job_local1258409818_0001 running in uber mode : false
2020-07-16 19:00:47,636 INFO mapreduce.Job:  map 0% reduce 0%
2020-07-16 19:00:47,640 INFO mapreduce.Job: Job job_local1258409818_0001 failed with state FAILED due to: NA
2020-07-16 19:00:47,657 INFO mapreduce.Job: Counters: 0
2020-07-16 19:00:47,683 WARN mapreduce.Counters: Group FileSystemCounters is deprecated. Use org.apache.hadoop.mapreduce.FileSystemCounter instead
2020-07-16 19:00:47,687 INFO mapreduce.ImportJobBase: Transferred 0 bytes in 3.0888 seconds (0 bytes/sec)
2020-07-16 19:00:47,688 WARN mapreduce.Counters: Group org.apache.hadoop.mapred.Task$Counter is deprecated. Use org.apache.hadoop.mapreduce.TaskCounter instead
2020-07-16 19:00:47,688 INFO mapreduce.ImportJobBase: Retrieved 0 records.
2020-07-16 19:00:47,688 ERROR tool.ImportTool: Import failed: Import job failed!
 
 
请问这是因为什么?一直搜不到原因

要回复问题请先登录注册