初学Hadoop(三) HDFS 命令

官网:http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/HDFSCommands.html

1. HDFS 命令

用法: hdfs [--config confdir] [COMMAND] [GENERIC_OPTIONS] [COMMAND_OPTIONS]

2. Dfs 文件系统命令 *

用法: hdfs dfs [GENERIC_OPTIONS] [COMMAND_OPTIONS]

appendToFile

hdfs dfs -appendToFile localfile /user/hadoop/hadoopfile

hdfs dfs -appendToFile localfile1 localfile2  /user/hadoop/hadoopfile

hdfs dfs -appendToFile localfile  hdfs://nn.example.com/hadoop/hadoopfile

hdfs dfs -appendToFile - hdfs://nn.example.com/hadoop/hadoopfile Reads the input from stdin.

 

Cat

hdfs dfs -cat hdfs://nn1.example.com/file1 hdfs://nn2.example.com/file2

hdfs dfs -cat file:///file3 /user/hadoop/file4

 

chgrp

chmod

chown

copyFromLocal

text

.....更加详细参见:

http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/FileSystemShell.html

3.fetchdt 从 NameNode获取代理令牌

用法hdfs fetchdt [GENERIC_OPTIONS] [--webservice <namenode_http_addr>] <path>

4.fsck HDFS文件系统检查

这些命令了解一下就可以,最主要的方式还是通过java api来实现。

猜你喜欢

转载自xinyeyouxiang.iteye.com/blog/2192801