用hadoop自带的任务模型测试hadoop可用性:
[hduser@localhost ~]$ hadoop jar /usr/local/hadoop/hadoop-examples-0.20.2-cdh3u6.jar 读取jar文件
[hduser@localhost ~]$ hadoop jar /usr/local/hadoop/hadoop-examples-0.20.2-cdh3u6.jar wordcount 查看wordcount的语法格式
Usage: wordcount <in> <out>
in读取文件位置 out保存结果位置(HDFS上,目录不能事先存在)
[hduser@localhost ~]$ hadoop jar /usr/local/hadoop/hadoop-examples-0.20.2-cdh3u6.jar wordcount test wordcount-out
[hduser@localhost ~]$ hadoop job -list all 查看执行过的作业
[hduser@localhost ~]$ hadoop fs -ls wordcount-out 查看任务输出结果
[hduser@localhost ~]$ hadoop fs -cat wordcount-out/part-r-00000
hadoop提供的web任务进程查看界面:(访问需关闭防火墙)
JobTracker的HTTP服务器地址和端口,默认为0.0.0.0:50030;
TaskTracker的HTTP服务器地址和端口,默认为0.0.0.0:50060;
NameNode的HTTP服务器地址和端口,默认为0.0.0.0:50070;
DataNode的HTTP服务器地址和端口,默认为0.0.0.0:50075;
SecondaryNameNode的HTTP服务器地址和端口,默认为0.0.0.0:50090;