支持httfs前提,增加配置
<property>
<name>hadoop.proxyuser.yarn.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.yarn.groups</name>
<value>*</value>
</property>
修改httpfs-env.sh 主要修改日志路径
# export HTTPFS_LOG=${HTTPFS_HOME}/logs
export HTTPFS_LOG=/opt/hadoop/log/yarn/logs
# HttpFS temporary directory
#
# export HTTPFS_TEMP=${HTTPFS_HOME}/temp
export HTTPFS_TEMP=/opt/hadoop/log/yarn/temp
修改$HADOOP_HOME//share/hadoop/httpfs下tomcat文件所有者的权限为启动httpfs用户及组
启动httpfs sbin/httpfs.sh start
常用的命令
1、上传文件
curl -i -X PUT -T tmp.sh "http://ip:14000/webhdfs/v1/tmp/tmp.sh?op=CREATE&user.name=hdfs&data=true" -H "Content-Type:application/octet-stream"
2、创建目录
curl -i -X PUT "http://ip:14000/webhdfs/v1/tmp/test2?op=create&user.name=hdfs"
3、删除文件
curl -i -X DELETE "http://ip:14000/webhdfs/v1/tmp/test1?op=delete&recursive=true&user.name=hdfs"
4、列出文件列表
curl "http://ip:14000/webhdfs/v1/tmp?op=liststatus&user.name=hdfs"
未完待续