HDFS文件权限不足导致Sqoop执行失败

故障信息

在使用sqoop从Mysql向HDFS导入文件时报错:

Caused by: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): Permission denied: user=root, access=WRITE, inode="/user/root/.staging":hdfs:hdfs:drwxr-xr-x

解决方法

1、查看hdfs上目录权限,可以看出/usrer/root目录的属主为hdfs,因此可以以hdfs用户的身份修改该目录权限:

[root@hdp1 ~]# hadoop dfs -ls /user/
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

Found 12 items
drwx------   - accumulo  hdfs            0 2018-04-24 14:55 /user/accumulo
drwxrwx---   - ambari-qa hdfs            0 2018-04-24 15:00 /user/ambari-qa
drwxr-xr-x   - druid     hadoop          0 2018-04-24 14:56 /user/druid
drwxr-xr-x   - hbase     hdfs            0 2018-04-24 14:53 /user/hbase
drwxr-xr-x   - hcat      hdfs            0 2018-04-24 14:56 /user/hcat
drwxr-xr-x   - hdfs      hdfs            0 2018-04-25 18:19 /user/hdfs
drwxrwxrwx   - hive      hdfs            0 2018-05-29 21:26 /user/hive
drwxrwxr-x   - livy      hdfs            0 2018-04-24 14:54 /user/livy
drwxrwxr-x   - oozie     hdfs            0 2018-04-24 14:58 /user/oozie
drwxrwxrwx   - hdfs      hdfs            0 2018-05-29 20:41 /user/root
drwxrwxr-x   - spark     hdfs            0 2018-04-24 14:53 /user/spark
drwxr-xr-x   - zeppelin  hdfs            0 2018-04-24 14:54 /user/zeppelin

2、修改相应目录的权限:

sudo -u hdfs hadoop fs -chmod  -R 777 /user/root/

3、再次执行sqoop命令

参考:https://www.cnblogs.com/hapjin/p/4846853.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

汀桦坞

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值