日期:2014-05-16  浏览次数:20718 次

hadoop 在redhat linux5 上部署成功(三机)
断断续续,折腾了一个礼拜,终于在出差的时候把这个hadoop部署成功了。
我的环境是 VMware + redhat linux5,一台namenode,一台dataqnode,配置的过程中也遇到不少麻烦,一会儿再一一列举。
后来又在slaves里面加了个datanode节点,也成功了。看来这段时间的不断尝试没有白费,接下来就要开始在window+cygwin+eclipse里面写分布式搜索引擎了。
现在将成功的运行结果列出来。
[root@rh0 bin]# hadoop fs -lsr /tmp
drwxr-xr-x   - root supergroup          0 2010-11-07 09:41 /tmp/hadoop-root
drwxr-xr-x   - root supergroup          0 2010-11-07 09:41 /tmp/hadoop-root/tmp
drwxr-xr-x   - root supergroup          0 2010-11-07 09:41 /tmp/hadoop-root/tmp/mapred
drwx-wx-wx   - root supergroup          0 2010-11-07 09:42 /tmp/hadoop-root/tmp/mapred/system
[root@rh0 bin]# hadoop dfsadmin -report
Configured Capacity: 13391486976 (12.47 GB)
Present Capacity: 8943796224 (8.33 GB)
DFS Remaining: 8943742976 (8.33 GB)
DFS Used: 53248 (52 KB)
DFS Used%: 0%
Under replicated blocks: 0
Blocks with corrupt replicas: 0
Missing blocks: 0

-------------------------------------------------
Datanodes available: 1 (1 total, 0 dead)

Name: 192.168.126.101:50010
Decommission Status : Normal
Configured Capacity: 13391486976 (12.47 GB)
DFS Used: 53248 (52 KB)
Non DFS Used: 4447690752 (4.14 GB)
DFS Remaining: 8943742976(8.33 GB)
DFS Used%: 0%
DFS Remaining%: 66.79%
Last contact: Sun Nov 07 09:42:18 CST 2010


[root@rh0 bin]# ./hadoop fs -put /usr/local/cjd/b.txt /tmp/hadoop-root/tmp/cjd/b.txt
[root@rh0 bin]# ./hadoop jar hadoop-0.20.2-examples.jar wordcount /tmp/hadoop-root/tmp/cjd /tmp/hadoop-root/tmp/output-dir
10/11/07 09:43:03 INFO input.FileInputFormat: Total input paths to process : 1
10/11/07 09:43:03 INFO mapred.JobClient: Running job: job_201011070941_0001
10/11/07 09:43:04 INFO mapred.JobClient:  map 0% reduce 0%
10/11/07 09:43:15 INFO mapred.JobClient:  map 100% reduce 0%
10/11/07 09:43:36 INFO mapred.JobClient:  map 100% reduce 100%
10/11/07 09:43:39 INFO mapred.JobClient: Job complete: job_201011070941_0001
10/11/07 09:43:39 INFO mapred.JobClient: Counters: 17
10/11/07 09:43:39 INFO mapred.JobClient:   Job Counters 
10/11/07 09:43:39 INFO mapred.JobClient:     Launched reduce tasks=1
10/11/07 09:43:39 INFO mapred.JobClient:     Launched map tasks=1
10/11/07 09:43:39 INFO mapred.JobClient:     Data-local map tasks=1
10/11/07 09:43:39 INFO mapred.JobClient:   FileSystemCounters
10/11/07 09:43:39 INFO mapred.JobClient:     FILE_BYTES_READ=1836
10/11/07 09:43:39 INFO mapred.JobClient:     HDFS_BYTES_READ=1366
10/11/07 09:43:39 INFO mapred.JobClient:     FILE_BYTES_WRITTEN=3704
10/11/07 09:43:39 INFO mapred.JobClient:     HDFS_BYTES_WRITTEN=1306
10/11/07 09:43:39 INFO mapred.JobClient:   Map-Reduce Framework
10/11/07 09:43:39 INFO mapred.JobClient:     Reduce input groups=131
10/11/07 09:43:39 INFO mapred.JobClient:     Combine output records=131
10/11/07 09:43:39 INFO mapred.JobClient:     Map input records=31
10/11/07 09:43:39 INFO mapred.JobClient:     Reduce shuffle bytes=1836
10/11/07 09:43:39 INFO mapred.JobClient:     Reduce output records=131
10/11/07 09:43:39 INFO mapred.JobClient:     Spilled Records=262
10/11/07 09:43:39 INFO mapred.JobClient:     Map output bytes=2055
10/11/07 09:43:39 INFO mapred.JobClient:     Combine input records=179
10/11/07 09:43:39 INFO mapred.JobClient:     Map output records=179
10/11/07 09:43:39 INFO mapred.JobClient:     Reduce input records=131
[root@rh0 bin]# hadoop dfsadmin -report
Configured Capacity: 13391486976 (12.47 GB)
Present Capacity: 8943679754 (8.33 GB)
DFS Remaining: 8943587328 (8.33 GB)
DFS Used: 92426 (90.26 KB)
DFS Used%: 0%
Under replicated blocks: 0
Blocks with corrupt replicas: 0
Missing blocks: 0

-------------------------------------------------
Datanodes available: 1 (1 total, 0 dead)

Name: 192.168.126.101:50010
Decommission Status : Normal
Configured Capacity: 13391486976 (12.47 GB)
DFS Used: 92426 (90.26 KB)
Non DFS Used: 4447807222 (4.14 GB)
DFS Remaining: 8943587328(8.33 GB)
DFS Used%: 0%
DFS Remaining%: 66.79%
Last contact: Sun Nov 07 09:46:22 CST 2010


[