Sqoop 作用:
数据从RDBMS和Hadoop之间进行导入导出操作
底层就是使用MapReduce来实现的
Map 只有Map
Reduce 没有Reduce
导入: import
RDBMS --> Hdfs
RDBMS–> Hive
导出: export
Hdfs–>RDBMS
Hive–>RDBMS*
参数帮助查看—》sqoop help
[wzj@hadoop001 conf]$ sqoop help
19/12/24 14:05:55 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.16.2
usage: sqoop COMMAND [ARGS]
Available commands:
codegen Generate code to interact with database records
create-hive-table Import a table definition into Hive
eval Evaluate a SQL statement and display the results
export Export an HDFS directory to a database table
help List available commands
import Import a table from a database to HDFS
import-all-tables Import tables from a database to HDFS
import-mainframe Import datasets from a mainframe server to HDFS
job Work with saved jobs
list-databases List available databases on a server
list-tables List available tables in a database
merge Merge results of incremental imports
metastore Run a standalone Sqoop metastore
version Display version information
See 'sqoop help COMMAND' for information on a specific command.
exoprt : 导出
import : 导入
job : 作业
list-databases : 数据库列表
list-tables : 表列表
[wzj@hadoop001 ~]$ sqoop list-databases \
> --connect jdbc:mysql://hadoop001:3306 \
> --password 123456 \
> --username root
19/12/24 12:56:36 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.16.2
19/12/24 12:56:36 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
19/12/24 12:56:36 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
information_schema
data_hive
mysql
performance_schema
test
[wzj@hadoop001 ~]$ sqoop list-tables \