hadoop hdfs uri详解

网友投稿 358 2022-11-18

hadoop hdfs uri详解

hadoop hdfs uri详解

​​hadoop hdfs uri详解​​

一、hdfs基本命令:hadoop fs -cmd 选项:cmd: 具体的操作,基本上与UNIX的命令行相同args: 参数

二、hdfs资源uri格式:用法:scheme://authority/path选项:scheme–>协议名,file或hdfsauthority–>namenode主机名path–>路径范例:hdfs://localhost:54310/user/hadoop/test.txt假设已经在/home/hadoop/hadoop-1.1.1/conf/core-site.xml里配置了fs.default.name=hdfs://localhost:54310,则仅使用/user/hadoop/test.txt即可。hdfs默认工作目录为/user/$USER,$USER是当前的登录用户名。

三、hdfs命令范例hadoop fs -mkdir /user/hadoophadoop fs -ls /userhadoop fs -lsr /user(递归的)hadoop fs -put test.txt /user/hadoop(复制到hdfs://localhost:54310/user/hadoop目录下,首先要创建当前目录)hadoop fs -get /user/hadoop/test.txt .(复制test.txt文件到本地当前目录下)hadoop fs -cat /user/hadoop/test.txthadoop fs -tail /user/hadoop/test.txt(查看最后1000字节)hadoop fs -rm /user/hadoop/test.txthadoop fs -help ls(查看ls命令的帮助文档)

四、在put时遇到的问题异常信息: org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create file/user/hadoopadmin. Name node is in safe mode.解决办法:hadoop dfsadmin -safemode leave

作者:少帅

您的支持是对博主最大的鼓励,感谢您的认真阅读。

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:dfrobot3 Case树莓派3外壳简介
下一篇:JWT全面解读和详细使用步骤
相关文章

 发表评论

暂时没有评论,来抢沙发吧~