sygwin:Get that Linux feeling - on Windows,a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows.
首字母为d代表其为文件夹,可以看到输入文件在目录/user/cyg_server/in下,所以在 run configuration里输入文件路径写为 hdfs://localhost:9000/user/cyg_server/in,输出则随意指定。 然后从hadoop示例中将Wordcount.java代码复制过来,运行run->run on hadoop,这时不出意外将会出现一些状况,下面介绍一下我碰到的状况:
namenode 安全模式异常
1 2 3 4 5 6
<span style="font-size: medium;">org.apache.hadoop.ipc.RemoteException: org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create file/usr/yujing/wordcount. Name node is in safe mode. The ratio of reported blocks 0.0000 has not reached the threshold 0.9990. Safe mode will be turned off <span style="font-size:14px; font-family: Arial, Helvetica, sans-serif;"> </span>
libpath=/home/hadoop-1.2.1/lib/native/linux-i386-32 14/08/25 16:20:25 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 14/08/25 16:20:25 WARN mapred.JobClient: No job jar file set. User classes may not be found. See JobConf(Class) or JobConf#setJar(String). 14/08/25 16:20:25 INFO input.FileInputFormat: Total input paths to process : 2 14/08/25 16:20:25 WARN snappy.LoadSnappy: Snappy native library not loaded 14/08/25 16:20:26 INFO mapred.JobClient: Running job: job_local1708565066_0001 14/08/25 16:20:26 INFO mapred.LocalJobRunner: Waiting for map tasks 14/08/25 16:20:26 INFO mapred.LocalJobRunner: Starting task: attempt_local1708565066_0001_m_000000_0 14/08/25 16:20:26 INFO mapred.Task: Using ResourceCalculatorPlugin : null 14/08/25 16:20:26 INFO mapred.MapTask: Processing split: hdfs://localhost:9000/user/cyg_server/in/test2.txt:0+13 14/08/25 16:20:26 INFO mapred.MapTask: io.sort.mb = 100 14/08/25 16:20:26 INFO mapred.MapTask: data buffer = 79691776/99614720 14/08/25 16:20:26 INFO mapred.MapTask: record buffer = 262144/327680 14/08/25 16:20:26 INFO mapred.MapTask: Starting flush of map output 14/08/25 16:20:26 INFO mapred.MapTask: Finished spill 0 14/08/25 16:20:26 INFO mapred.Task: Task:attempt_local1708565066_0001_m_000000_0 is done. And is in the process of commiting 14/08/25 16:20:26 INFO mapred.LocalJobRunner: 14/08/25 16:20:26 INFO mapred.Task: Task 'attempt_local1708565066_0001_m_000000_0' done. 14/08/25 16:20:26 INFO mapred.LocalJobRunner: Finishing task: attempt_local1708565066_0001_m_000000_0 14/08/25 16:20:26 INFO mapred.LocalJobRunner: Starting task: attempt_local1708565066_0001_m_000001_0 14/08/25 16:20:26 INFO mapred.Task: Using ResourceCalculatorPlugin : null 14/08/25 16:20:26 INFO mapred.MapTask: Processing split: hdfs://localhost:9000/user/cyg_server/in/test1.txt:0+12 14/08/25 16:20:26 INFO mapred.MapTask: io.sort.mb = 100 14/08/25 16:20:26 INFO mapred.MapTask: data buffer = 79691776/99614720 14/08/25 16:20:26 INFO mapred.MapTask: record buffer = 262144/327680 14/08/25 16:20:26 INFO mapred.MapTask: Starting flush of map output 14/08/25 16:20:26 INFO mapred.MapTask: Finished spill 0 14/08/25 16:20:26 INFO mapred.Task: Task:attempt_local1708565066_0001_m_000001_0 is done. And is in the process of commiting 14/08/25 16:20:26 INFO mapred.LocalJobRunner: 14/08/25 16:20:26 INFO mapred.Task: Task 'attempt_local1708565066_0001_m_000001_0' done. 14/08/25 16:20:26 INFO mapred.LocalJobRunner: Finishing task: attempt_local1708565066_0001_m_000001_0 14/08/25 16:20:26 INFO mapred.LocalJobRunner: Map task executor complete. 14/08/25 16:20:27 INFO mapred.JobClient: map 100% reduce 0% 14/08/25 16:20:27 INFO mapred.Task: Using ResourceCalculatorPlugin : null 14/08/25 16:20:27 INFO mapred.LocalJobRunner: 14/08/25 16:20:27 INFO mapred.Merger: Merging 2 sorted segments 14/08/25 16:20:27 INFO mapred.Merger: Down to the last merge-pass, with 2 segments left of total size: 53 bytes 14/08/25 16:20:27 INFO mapred.LocalJobRunner: 14/08/25 16:20:29 INFO mapred.Task: Task:attempt_local1708565066_0001_r_000000_0 is done. And is in the process of commiting 14/08/25 16:20:29 INFO mapred.LocalJobRunner: 14/08/25 16:20:29 INFO mapred.Task: Task attempt_local1708565066_0001_r_000000_0 is allowed to commit now 14/08/25 16:20:29 INFO output.FileOutputCommitter: Saved output of task 'attempt_local1708565066_0001_r_000000_0' to hdfs://localhost:9000/user/cyg_server/out 14/08/25 16:20:29 INFO mapred.LocalJobRunner: reduce > reduce 14/08/25 16:20:29 INFO mapred.Task: Task 'attempt_local1708565066_0001_r_000000_0' done. 14/08/25 16:20:29 INFO mapred.JobClient: map 100% reduce 100% 14/08/25 16:20:30 INFO mapred.JobClient: Job complete: job_local1708565066_0001 14/08/25 16:20:30 INFO mapred.JobClient: Counters: 19 14/08/25 16:20:30 INFO mapred.JobClient: File Output Format Counters 14/08/25 16:20:30 INFO mapred.JobClient: Bytes Written=25 14/08/25 16:20:30 INFO mapred.JobClient: FileSystemCounters 14/08/25 16:20:30 INFO mapred.JobClient: FILE_BYTES_READ=1432 14/08/25 16:20:30 INFO mapred.JobClient: HDFS_BYTES_READ=63 14/08/25 16:20:30 INFO mapred.JobClient: FILE_BYTES_WRITTEN=206413 14/08/25 16:20:30 INFO mapred.JobClient: HDFS_BYTES_WRITTEN=25 14/08/25 16:20:30 INFO mapred.JobClient: File Input Format Counters 14/08/25 16:20:30 INFO mapred.JobClient: Bytes Read=25 14/08/25 16:20:30 INFO mapred.JobClient: Map-Reduce Framework 14/08/25 16:20:30 INFO mapred.JobClient: Reduce input groups=3 14/08/25 16:20:30 INFO mapred.JobClient: Map output materialized bytes=61 14/08/25 16:20:30 INFO mapred.JobClient: Combine output records=4 14/08/25 16:20:30 INFO mapred.JobClient: Map input records=2 14/08/25 16:20:30 INFO mapred.JobClient: Reduce shuffle bytes=0 14/08/25 16:20:30 INFO mapred.JobClient: Reduce output records=3 14/08/25 16:20:30 INFO mapred.JobClient: Spilled Records=8 14/08/25 16:20:30 INFO mapred.JobClient: Map output bytes=41 14/08/25 16:20:30 INFO mapred.JobClient: Total committed heap usage (bytes)=482291712 14/08/25 16:20:30 INFO mapred.JobClient: Combine input records=4 14/08/25 16:20:30 INFO mapred.JobClient: Map output records=4 14/08/25 16:20:30 INFO mapred.JobClient: SPLIT_RAW_BYTES=230 14/08/25 16:20:30 INFO mapred.JobClient: Reduce input records=4