在搭建好hadoop伪分布式环境之后,或者分布式环境之后,运行hadoop命令,下面是一些常用的hadoop命令:
1、hadoop集群管理类命令
hadoop namenode -format 格式化文件系统,但是不要多次格式化,否则会出现问题
start-all.sh 启动hadoop集群,正确启动相应的进程会起来
stop-all.sh 关闭集群,关闭相应进程
hadoop dfsadmin -safemode leave 解除安全模式
2、hadoop 文件管理类命令
(hadoop文件操作相关的命令都是以“hadoop fs + -具体命令”的格式:)
hadoop fs [-ls
hadoop fs [-lsr
hadoop fs [-du
hadoop fs [-dus
hadoop fs [-count[-q]
hadoop fs [-mv
hadoop fs [-cp
hadoop fs p[-rm [-skipTrash]
hadoop fs [-rmr [-skipTrash]
hadoop fs [-expunge] ??
hadoop fs [-put
hadoop fs [-copyFromLocal
hadoop fs [-moveFromLocal
hadoop fs [-get [-ignoreCrc] [-crc]
hadoop fs [-getmerge
hadoop fs [-cat
hadoop fs [-text
hadoop fs [-copyToLocal [-ignoreCrc] [-crc]
hadoop fs [-moveToLocal [-crc]
hadoop fs [-mkdir
hadoop fs [-setrep [-R] [-w]
hadoop fs [-touchz
hadoop fs [-test -[ezd]
hadoop fs [-stat [format]
hadoop fs [-tail [-f]
hadoop fs [-chmod [-R]
hadoop fs [-chown [-R] [OWNER][:[GROUP]] PATH...] 设定指定文件的所有者
hadoop fs [-chgrp [-R] GROUP PATH...] ??
hadoop fs [-help [cmd]] 帮助命令,对于指定cmd的用法进行解释