最初のhadoopを走るには、サンプルを持っていたエラーが発生しました.

4500 ワード

hadoopを装着して円周率pi値を計算する例を走るときは、まずhadoopのインストール位置でその伝説の
hadoop-examples-xxxx.jar、xxxxはバージョンによって異なります
インストールされているhadoopは2.7.0であるため、位置はxxx/share/hadoop/mapreduce/にあり、xxxはhadoopインストールルートディレクトリであり、これも本のバージョンとは位置が異なるため、自分で探す必要がある.
4つのjobを開いて円周率を計算する
hadoop jar hadoop-mapreduce-examples-2.7.0.jar pi 4 1000
次のエラーが発生しました.
java.io.IOException: Cannot create input directory QuasiMonteCarlo_1442130301493_820011182/in
	at org.apache.hadoop.examples.QuasiMonteCarlo.estimatePi(QuasiMonteCarlo.java:283)
	at org.apache.hadoop.examples.QuasiMonteCarlo.run(QuasiMonteCarlo.java:354)
	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
	at org.apache.hadoop.examples.QuasiMonteCarlo.main(QuasiMonteCarlo.java:363)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:71)
	at org.apache.hadoop.util.ProgramDriver.run(ProgramDriver.java:144)
	at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:74)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
	at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

彼は何か一時ファイルを作成できないと言って、推測は権限の問題で、mapreduceディレクトリの権限を修正して書くことができて、走っていればいいと思っています.
Number of Maps  = 4
Samples per Map = 1000
Wrote input for Map #0
Wrote input for Map #1
Wrote input for Map #2
Wrote input for Map #3
Starting Job
15/09/13 15:46:12 INFO Configuration.deprecation: session.id is deprecated. Instead, use dfs.metrics.session-id
15/09/13 15:46:12 INFO jvm.JvmMetrics: Initializing JVM Metrics with processName=JobTracker, sessionId=
15/09/13 15:46:12 INFO input.FileInputFormat: Total input paths to process : 4
15/09/13 15:46:12 INFO mapreduce.JobSubmitter: number of splits:4
15/09/13 15:46:13 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_local1667226124_0001
15/09/13 15:46:13 INFO mapreduce.Job: The url to track the job: http://localhost:8080/
15/09/13 15:46:13 INFO mapreduce.Job: Running job: job_local1667226124_0001
15/09/13 15:46:13 INFO mapred.LocalJobRunner: OutputCommitter set in config null
15/09/13 15:46:13 INFO output.FileOutputCommitter: File Output Committer Algorithm version is 1
15/09/13 15:46:13 INFO mapred.LocalJobRunner: OutputCommitter is org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter
15/09/13 15:46:13 INFO mapred.LocalJobRunner: Waiting for map tasks
15/09/13 15:46:13 INFO mapred.LocalJobRunner: Starting task: attempt_local1667226124_0001_m_000000_0
…………
…………
15/09/13 15:46:14 INFO mapred.LocalJobRunner: Finishing task: attempt_local1667226124_0001_r_000000_0
15/09/13 15:46:14 INFO mapred.LocalJobRunner: reduce task executor complete.
15/09/13 15:46:14 INFO mapreduce.Job: Job job_local1667226124_0001 running in uber mode : false
15/09/13 15:46:14 INFO mapreduce.Job:  map 100% reduce 100%
15/09/13 15:46:14 INFO mapreduce.Job: Job job_local1667226124_0001 completed successfully
15/09/13 15:46:14 INFO mapreduce.Job: Counters: 30
	File System Counters
		FILE: Number of bytes read=1379291
		FILE: Number of bytes written=2739253
		FILE: Number of read operations=0
		FILE: Number of large read operations=0
		FILE: Number of write operations=0
	Map-Reduce Framework
		Map input records=4
		Map output records=8
		Map output bytes=72
		Map output materialized bytes=112
		Input split bytes=660
		Combine input records=0
		Combine output records=0
		Reduce input groups=2
		Reduce shuffle bytes=112
		Reduce input records=8
		Reduce output records=0
		Spilled Records=16
		Shuffled Maps =4
		Failed Shuffles=0
		Merged Map outputs=4
		GC time elapsed (ms)=154
		Total committed heap usage (bytes)=1356857344
	Shuffle Errors
		BAD_ID=0
		CONNECTION=0
		IO_ERROR=0
		WRONG_LENGTH=0
		WRONG_MAP=0
		WRONG_REDUCE=0
	File Input Format Counters 
		Bytes Read=520
	File Output Format Counters 
		Bytes Written=109
Job Finished in 2.592 seconds
Estimated value of Pi is 3.14000000000000000000