日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

提交官方MapReduce作业到YARN

發布時間:2024/9/16 编程问答 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 提交官方MapReduce作业到YARN 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

環境

Hadoop使用版本:hadoop-2.6.0-cdh5.15.1

使用官方提供的例子 PI

在hadoop-2.6.0-cdh5.15.1/share/hadoop/mapreduce路徑下有一個hadoop-mapreduce-examples-2.6.0-cdh5.15.1.jar文件
運行命令:hadoop jar hadoop-mapreduce-examples-2.6.0-cdh5.15.1.jar pi 2 3
然后在瀏覽器中輸入yarn的地址:ip:8088,在RUNNING下可以看到運行的作業:

查看控制臺輸出:

iie4bu@swarm-worker1:~/app/hadoop-2.6.0-cdh5.15.1/share/hadoop/mapreduce$ hadoop jar hadoop-mapreduce-examples-2.6.0-cdh5.15.1.jar pi 2 3 Number of Maps = 2 Samples per Map = 3 19/11/07 15:52:37 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Wrote input for Map #0 Wrote input for Map #1 Starting Job 19/11/07 15:52:38 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032 19/11/07 15:52:39 INFO input.FileInputFormat: Total input paths to process : 2 19/11/07 15:52:39 INFO mapreduce.JobSubmitter: number of splits:2 19/11/07 15:52:39 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1573113153178_0001 19/11/07 15:52:40 INFO impl.YarnClientImpl: Submitted application application_1573113153178_0001 19/11/07 15:52:40 INFO mapreduce.Job: The url to track the job: http://swarm-worker1:8088/proxy/application_1573113153178_0001/ 19/11/07 15:52:40 INFO mapreduce.Job: Running job: job_1573113153178_0001 19/11/07 15:52:48 INFO mapreduce.Job: Job job_1573113153178_0001 running in uber mode : false 19/11/07 15:52:48 INFO mapreduce.Job: map 0% reduce 0% 19/11/07 15:52:54 INFO mapreduce.Job: map 50% reduce 0% 19/11/07 15:52:55 INFO mapreduce.Job: map 100% reduce 0% 19/11/07 15:53:00 INFO mapreduce.Job: map 100% reduce 100% 19/11/07 15:53:00 INFO mapreduce.Job: Job job_1573113153178_0001 completed successfully 19/11/07 15:53:00 INFO mapreduce.Job: Counters: 49File System CountersFILE: Number of bytes read=50FILE: Number of bytes written=430365FILE: Number of read operations=0FILE: Number of large read operations=0FILE: Number of write operations=0HDFS: Number of bytes read=540HDFS: Number of bytes written=215HDFS: Number of read operations=11HDFS: Number of large read operations=0HDFS: Number of write operations=3Job Counters Launched map tasks=2Launched reduce tasks=1Data-local map tasks=2Total time spent by all maps in occupied slots (ms)=6933Total time spent by all reduces in occupied slots (ms)=3732Total time spent by all map tasks (ms)=6933Total time spent by all reduce tasks (ms)=3732Total vcore-milliseconds taken by all map tasks=6933Total vcore-milliseconds taken by all reduce tasks=3732Total megabyte-milliseconds taken by all map tasks=7099392Total megabyte-milliseconds taken by all reduce tasks=3821568Map-Reduce FrameworkMap input records=2Map output records=4Map output bytes=36Map output materialized bytes=56Input split bytes=304Combine input records=0Combine output records=0Reduce input groups=2Reduce shuffle bytes=56Reduce input records=4Reduce output records=0Spilled Records=8Shuffled Maps =2Failed Shuffles=0Merged Map outputs=2GC time elapsed (ms)=308CPU time spent (ms)=2610Physical memory (bytes) snapshot=942092288Virtual memory (bytes) snapshot=7986814976Total committed heap usage (bytes)=1810890752Shuffle ErrorsBAD_ID=0CONNECTION=0IO_ERROR=0WRONG_LENGTH=0WRONG_MAP=0WRONG_REDUCE=0File Input Format Counters Bytes Read=236File Output Format Counters Bytes Written=97 Job Finished in 21.985 seconds Estimated value of Pi is 4.00000000000000000000

剛開始會執行Connecting to ResourceManager at /0.0.0.0:8032,首先連接到ResourceManager中。這就是一個最簡單的YARN作業

使用官方提供的例子 wordcount

在與上面同樣的路徑下執行命令:
iie4bu@swarm-worker1:~/app/hadoop-2.6.0-cdh5.15.1/share/hadoop/mapreduce$ hadoop jar hadoop-mapreduce-examples-2.6.0-cdh5.15.1.jar wordcount /wc/input/test.txt /wc/output

在/wc/output/下可以看到輸出結果的文件:

iie4bu@swarm-worker1:~/app/hadoop-2.6.0-cdh5.15.1/share/hadoop/mapreduce$ hadoop fs -text /wc/output/part-r-00000 19/11/07 16:26:34 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Hello 1 haha 2 hello 3 meme 1 welcome 2 world 1 與50位技術專家面對面20年技術見證,附贈技術全景圖

總結

以上是生活随笔為你收集整理的提交官方MapReduce作业到YARN的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。