首页 >数据库 >mysql教程 >将记录从mysql导出到hdfs中_MySQL

将记录从mysql导出到hdfs中_MySQL

WBOY
WBOY原创
2016-06-01 13:32:18954浏览

bitsCN.com

将记录从mysql导出到hdfs中

 

01ConnectURL=jdbc:mysql://localhost:3306/user_action0203UserName=root0405PassWord=1234560607OutputPath=/hdfs/recommend/user_action/watch_record0809TableName= watch_record1011Columns=id,uid,mid,timestamp121314IfJobCreated =`sqoop job list | grep import_ watch_record`1516#检查import_ watch_record这个job是否已经创建 如果未创建则创建1718if [ $IfJobCreated = ’’ ] then1920sqoop  job  import_ watch_record /2122  --create  --import /2324  --connect  $ConnectURL/2526  --username  $UserName/2728  --password  $PassWord/2930  --target-dir  $OutputPath/3132  --m  1/3334  --table  $TableName/3536  –columns  $Columns/3738  --incremental  append/3940  --check-column  id/4142  --last-value  04344fi4546  4748sqoop  job --exec import_ watch_record

 

 

bitsCN.com
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn