Home | 簡體中文 | 繁體中文 | 雜文 | 打賞(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎專欄 | Search | 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