MAPREDUCE服务 MRS-配置Sqoop通过IAM委托访问OBS:Sqoop使用样例

时间:2024-11-25 19:35:30

Sqoop使用样例

  • 通过sqoop import导入MySQL数据到HDFS

    sqoop import --connect jdbc:mysql://10.100.231.134:3306/test --username root --password xxx --query 'SELECT * FROM component where $CONDITIONS and component_id =" MRS 1.0_002"' --target-dir /tmp/component_test --delete-target-dir --fields-terminated-by "," -m 1 --as-textfile

  • 通过sqoop export 导出OBS数据到MySQL

    sqoop export --connect jdbc:mysql://10.100.231.134:3306/test --username root --password xxx --table component14 -export-dir obs://obs-file-bucket/xx/part-m-00000 --fields-terminated-by ',' -m 1

  • 通过sqoop import导入MySQL数据到OBS

    sqoop import --connect jdbc:mysql://10.100.231.134:3306/test --username root --password xxx --table component --target-dir obs://obs-file-bucket/xx --delete-target-dir --fields-terminated-by "," -m 1 --as-textfile

  • 通过sqoop import导入MySQL数据到Hive OBS外表

    sqoop import --connect jdbc:mysql://10.100.231.134:3306/test --username root --password xxx --table component --hive-import --hive-table component_test01 --fields-terminated-by "," -m 1 --as-textfile

support.huaweicloud.com/usermanual-mrs/mrs_01_24294.html