在使用命令
curl -i -X PUT -T test_data01.txt "http://ec2-54-241-143-9.us-west-1.compute.amazonaws.com:14000/webhdfs/v1/user/tmp/test_data01.txt?user.name=redpulse&op=CREATE" -H "Content-Type:application/octet-stream"
上传文件到hdfs时,遇到了如下报错:
{"RemoteException":{"message":"User: httpfs is not allowed to impersonate redpulse","exception":"RemoteException","javaClassName":"org.apache.hadoop.ipc.RemoteException"}}
这是因为需要在Hadoop的配置文件core-site.xml中加入下列配置代码:
<property>
<name>hadoop.proxyuser.[用户名].hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.[用户名].groups</name>
<value>*</value>
</property>
“[用户名]”就是重启EMR的当前用户
之后需要重启EMR(参考链接给出的文档):
https://amazonaws-china.com/premiumsupport/knowledge-center/restart-service-emr/