Home | 简体中文 | 繁体中文 | 杂文 | Search | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 作品与服务 | Email

第 5 章 数据迁移

data migration

目录

5.1. Apache Sqoop

5.1. Apache Sqoop

http://sqoop.apache.org/

export SQOOP_HOME=/srv/sqoop/
export PATH=$SQOOP_HOME/bin:$PATH
		

MYSQL转HDFS-示例

./sqoop import --connect jdbc:mysql://192.168.0.1:3306/mydb --username root --password mypass --table mytable -m 1 --target-dir /mysql/yourtable/$today
		

HDFS转MYSQ-示例

./sqoop export --connect jdbc:mysql://192.168.0.1:3306/mydb --username root --password mypass --table mytable --fields-terminated-by ',' --export-dir /mysql/yourtable/$today
		
comments powered by Disqus