Sqoop导数据 S3 to Mysql

使用Sqoop导数据,步骤:

1. 在mysql中建表

2.s3数据copyhdfshadoop distcp s3n://dir-path hdfs://dir-path

3.sqoophdfs中的数据导入mysqlsqoop export \

--connect 'jdbc:mysql://mysqlHost:3306/dbName' \

--username 'xxx' \

--password 'xxx' \

--table testTable \

--export-dir 'hdfs://dir-path' \

--input-fields-terminated-by '\001' \

--lines-terminated-by '\n' \

--input-null-string '\\N' \

--input-null-non-string '\\N' \

--update-mode allowinsert \

--update-key id \ 

-m 3

相关参数参考官方文档:https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html

4.完成


猜你喜欢

转载自blog.csdn.net/feng12345zi/article/details/80159172