사용 버전입니다.
사용가능한 DB 확인 → 잘 동작 합니다.
sqoop list-databases --connect jdbc:mysql://j7e204.p.ssafy.io:3306 --username e204 --P

SSEN DB의 tables 확인 → 잘 동작 합니다.
sqoop list-tables --connect jdbc:mysql://j7e204.p.ssafy.io/SSEN --username e204 -P

⇒ 스키마와 테이블은 잘 동작하는 것으로 보아 연결은 된 것 같습니다..(?) 아마도….
import 실행 전

import 실행 코드
# (예제 코드)
$ sqoop import --connect jdbc:mysql://hadoop02:3307/test --table dept --target-dir /user/hadoop01/mysql_table --username hive --P -m 1
# --tabel은 어떤 테이블을 가져올 건지 명시하는 곳입니다.
# --target-dir은 어디에 저장시킬 지를 명시합니다. 이미 존재하는 디렉토리를 쓰면 에러납니다.
# -m 1은 맵리듀스의 매퍼를 몇 개 실행시킬 지 적는 것입니다.
# (실행 코드)
sqoop import --connect jdbc:mysql://j7e204.p.ssafy.io:3306/SSEN --table users --target-dir /home/hadoop/sqoop/mysql_table15 --username e204 --P -m 1
import 실행 중 오류 코드
Warning: /home/hadoop/sqoop//../hbase does not exist! HBase imports will fail.
Please set $HBASE_HOME to the root of your HBase installation.
Warning: /home/hadoop/sqoop//../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /home/hadoop/sqoop//../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
Warning: /home/hadoop/sqoop//../zookeeper does not exist! Accumulo imports will fail.
Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.
/usr/local/hadoop/libexec/hadoop-functions.sh: line 2366: HADOOP_ORG.APACHE.SQOOP.SQOOP_USER: invalid variable name
/usr/local/hadoop/libexec/hadoop-functions.sh: line 2461: HADOOP_ORG.APACHE.SQOOP.SQOOP_OPTS: invalid variable name
2022-09-28 17:26:48,947 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
Enter password:
2022-09-28 17:26:54,722 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
2022-09-28 17:26:54,723 INFO tool.CodeGenTool: Beginning code generation
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2022-09-28 17:26:55,438 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `users` AS t LIMIT 1
2022-09-28 17:26:55,552 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `users` AS t LIMIT 1
2022-09-28 17:26:55,610 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /usr/local/hadoop
Note: /tmp/sqoop-hadoop/compile/66dbf667161d080f65d8c59f8db31f1b/users.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2022-09-28 17:26:57,168 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-hadoop/compile/66dbf667161d080f65d8c59f8db31f1b/users.jar
2022-09-28 17:26:57,204 WARN manager.MySQLManager: It looks like you are importing from mysql.
2022-09-28 17:26:57,204 WARN manager.MySQLManager: This transfer can be faster! Use the --direct
2022-09-28 17:26:57,204 WARN manager.MySQLManager: option to exercise a MySQL-specific fast path.
2022-09-28 17:26:57,204 INFO manager.MySQLManager: Setting zero DATETIME behavior to convertToNull (mysql)
2022-09-28 17:26:57,259 INFO mapreduce.ImportJobBase: Beginning import of users
2022-09-28 17:26:57,260 INFO Configuration.deprecation: mapred.job.tracker is deprecated. Instead, use mapreduce.jobtracker.address
2022-09-28 17:26:57,458 INFO Configuration.deprecation: mapred.jar is deprecated. Instead, use mapreduce.job.jar
2022-09-28 17:26:58,303 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps
2022-09-28 17:26:58,412 INFO impl.MetricsConfig: Loaded properties from hadoop-metrics2.properties
2022-09-28 17:26:58,537 INFO impl.MetricsSystemImpl: Scheduled Metric snapshot period at 10 second(s).
2022-09-28 17:26:58,537 INFO impl.MetricsSystemImpl: JobTracker metrics system started
2022-09-28 17:26:58,957 INFO db.DBInputFormat: Using read commited transaction isolation
2022-09-28 17:26:58,994 INFO mapreduce.JobSubmitter: number of splits:1
2022-09-28 17:26:59,132 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_local668476090_0001
2022-09-28 17:26:59,132 INFO mapreduce.JobSubmitter: Executing with tokens: []
2022-09-28 17:26:59,391 INFO mapred.LocalDistributedCacheManager: Creating symlink: /home/hadoop/hadoop_tmp/mapred/local/job_local668476090_0001_e6368c51-ec28-42fc-966f-769170925bb2/libjars <- /home/hadoop/libjars/*
2022-09-28 17:26:59,399 WARN fs.FileUtil: Command 'ln -s /home/hadoop/hadoop_tmp/mapred/local/job_local668476090_0001_e6368c51-ec28-42fc-966f-769170925bb2/libjars /home/hadoop/libjars/*' failed 1 with: ln: failed to create symbolic link '/home/hadoop/libjars/*': No such file or directory
2022-09-28 17:26:59,399 WARN mapred.LocalDistributedCacheManager: Failed to create symlink: /home/hadoop/hadoop_tmp/mapred/local/job_local668476090_0001_e6368c51-ec28-42fc-966f-769170925bb2/libjars <- /home/hadoop/libjars/*
2022-09-28 17:26:59,399 INFO mapred.LocalDistributedCacheManager: Localized file:/tmp/hadoop/mapred/staging/hadoop668476090/.staging/job_local668476090_0001/libjars as file:/home/hadoop/hadoop_tmp/mapred/local/job_local668476090_0001_e6368c51-ec28-42fc-966f-769170925bb2/libjars
2022-09-28 17:26:59,461 INFO mapreduce.Job: The url to track the job: http://localhost:8080/
2022-09-28 17:26:59,462 INFO mapreduce.Job: Running job: job_local668476090_0001
2022-09-28 17:26:59,471 INFO mapred.LocalJobRunner: OutputCommitter set in config null
2022-09-28 17:26:59,483 INFO output.FileOutputCommitter: File Output Committer Algorithm version is 2
2022-09-28 17:26:59,483 INFO output.FileOutputCommitter: FileOutputCommitter skip cleanup _temporary folders under output directory:false, ignore cleanup failures: false
2022-09-28 17:26:59,485 INFO mapred.LocalJobRunner: OutputCommitter is org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter
2022-09-28 17:26:59,549 INFO mapred.LocalJobRunner: Waiting for map tasks
2022-09-28 17:26:59,552 INFO mapred.LocalJobRunner: Starting task: attempt_local668476090_0001_m_000000_0
2022-09-28 17:26:59,598 INFO output.FileOutputCommitter: File Output Committer Algorithm version is 2
2022-09-28 17:26:59,598 INFO output.FileOutputCommitter: FileOutputCommitter skip cleanup _temporary folders under output directory:false, ignore cleanup failures: false
2022-09-28 17:26:59,635 INFO mapred.Task: Using ResourceCalculatorProcessTree : [ ]
2022-09-28 17:26:59,899 INFO db.DBInputFormat: Using read commited transaction isolation
2022-09-28 17:26:59,914 INFO mapred.MapTask: Processing split: 1=1 AND 1=1
2022-09-28 17:26:59,919 INFO mapred.LocalJobRunner: map task executor complete.
2022-09-28 17:26:59,929 WARN mapred.LocalJobRunner: job_local668476090_0001
java.lang.Exception: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class users 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 users 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:750)
Caused by: java.lang.ClassNotFoundException: Class users not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2542)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2636)
... 12 more
2022-09-28 17:27:00,476 INFO mapreduce.Job: Job job_local668476090_0001 running in uber mode : false
2022-09-28 17:27:00,478 INFO mapreduce.Job: map 0% reduce 0%
2022-09-28 17:27:00,480 INFO mapreduce.Job: Job job_local668476090_0001 failed with state FAILED due to: NA
2022-09-28 17:27:00,485 INFO mapreduce.Job: Counters: 0
2022-09-28 17:27:00,488 WARN mapreduce.Counters: Group FileSystemCounters is deprecated. Use org.apache.hadoop.mapreduce.FileSystemCounter instead
2022-09-28 17:27:00,489 INFO mapreduce.ImportJobBase: Transferred 0 bytes in 2.1669 seconds (0 bytes/sec)
2022-09-28 17:27:00,490 WARN mapreduce.Counters: Group org.apache.hadoop.mapred.Task$Counter is deprecated. Use org.apache.hadoop.mapreduce.TaskCounter instead
2022-09-28 17:27:00,490 INFO mapreduce.ImportJobBase: Retrieved 0 records.
2022-09-28 17:27:00,490 ERROR tool.ImportTool: Import failed: Import job failed!
import 실행 후

/home/hadoop 에 users.java가 생깁니다……..