sqoop导入数据到hdfs权限不足

导入数据权限不足,导入hive失败

背景:使用Sqoop从MySQL导入数据到Hive

#导入MySQL数据到hive
sqoop import --connect jdbc:mysql://localhost:3306/sqoop --username sqoop  --password 123456 --table student --target-dir /user/student2 --delete-target-dir --hive-import --fields-terminated-by " " --columns id,name,age --hive-overwrite --hive-table sqoop.student -m 1

报错信息:Hdfs页面操作文件出现 Permission denied: user=dr.who,

原因:对HDFS目录的权限不够,无法操作数据

sqoop导入数据到hdfs权限不足_第1张图片

解决方案-修改权限:

-R代表递归修改

#在xshell
hdfs dfs -chmod -R 755 /

你可能感兴趣的:(大数据开发,hdfs,sqoop,hadoop)