Hadoop运维

简单记录几个hdfs的运维命令

//查看hdfs的状态,是否有missing block,corrupt block等,也可以看datanode的状态
hdfs dfsadmin -report
//查看hdfs根目录下是否有文件处于missing,currupt状态,而且不是under replica的
hadoop fsck / | egrep -v '^\.+$' | grep -v eplica
//查看某个文件中,包含的block
hadoop fsck /path/to/corrupt/file -locations -blocks -files

 

提交一个hadoop wordcount作业,在mapreduce v1中

ssh <gateway_host>
find / -name hadoop-*-examples.jar
touch input
cat a>>input
cat b>>input
hadoop fs -put input /tmp/input
hadoop jar  /<find-dir>/hadoop-mapreduce-examples.jar wordcount /tmp/input /tmp/output 

 

你可能感兴趣的:(hadoop)