首页 > 其他分享 >hadoop初体验1——官方案例pi值计算

hadoop初体验1——官方案例pi值计算

时间:2023-10-30 23:25:05浏览次数:54  
标签:INFO 10 初体验 05 30 bytes hadoop 2023 pi

1.执行命令
[hadoop@namenode mapreduce]$ hadoop jar hadoop-mapreduce-examples-3.3.6.jar pi 2 2

  • hadoop jarHadoop jar命令
  • hadoop-mapreduce-examples-3.3.6.jar程序所在jar包
  • pi
  • 2 2——参数

2.执行信息

Number of Maps  = 2
Samples per Map = 2
Wrote input for Map #0
Wrote input for Map #1
Starting Job
2023-10-30 05:05:05,746 INFO client.DefaultNoHARMFailoverProxyProvider: Connecting to ResourceManager at namenode/192.168.42.134:8032
2023-10-30 05:05:06,669 INFO mapreduce.JobResourceUploader: Disabling Erasure Coding for path: /tmp/hadoop-yarn/staging/hadoop/.staging/job_1698655691785_0001                                                  #hadoop job的id为job_1698655691785_0001
2023-10-30 05:05:06,957 INFO input.FileInputFormat: Total input files to process : 2                 #参数
2023-10-30 05:05:07,130 INFO mapreduce.JobSubmitter: number of splits:2                              #分片为2
2023-10-30 05:05:07,613 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1698655691785_0001
2023-10-30 05:05:07,613 INFO mapreduce.JobSubmitter: Executing with tokens: []
2023-10-30 05:05:07,948 INFO conf.Configuration: resource-types.xml not found                        #暂不影响
2023-10-30 05:05:07,948 INFO resource.ResourceUtils: Unable to find 'resource-types.xml'.
2023-10-30 05:05:09,318 INFO impl.YarnClientImpl: Submitted application application_1698655691785_0001
2023-10-30 05:05:09,529 INFO mapreduce.Job: The url to track the job: http://namenode:8088/proxy/application_1698655691785_0001/
2023-10-30 05:05:09,530 INFO mapreduce.Job: Running job: job_1698655691785_0001
2023-10-30 05:05:22,935 INFO mapreduce.Job: Job job_1698655691785_0001 running in uber mode : false
2023-10-30 05:05:22,941 INFO mapreduce.Job:  map 0% reduce 0%
2023-10-30 05:05:36,300 INFO mapreduce.Job:  map 100% reduce 0%
2023-10-30 05:05:46,544 INFO mapreduce.Job:  map 100% reduce 100%
2023-10-30 05:05:47,561 INFO mapreduce.Job: Job job_1698655691785_0001 completed successfully
2023-10-30 05:05:47,714 INFO mapreduce.Job: Counters: 54
        File System Counters
                FILE: Number of bytes read=50
                FILE: Number of bytes written=831506
                FILE: Number of read operations=0
                FILE: Number of large read operations=0
                FILE: Number of write operations=0
                HDFS: Number of bytes read=528
                HDFS: Number of bytes written=215
                HDFS: Number of read operations=13
                HDFS: Number of large read operations=0
                HDFS: Number of write operations=3
                HDFS: Number of bytes read erasure-coded=0
        Job Counters 
                Launched map tasks=2                                                                   #map task个数,因为splits为2
                Launched reduce tasks=1                                                                #reduce task个数,默认为1
                Data-local map tasks=2
                Total time spent by all maps in occupied slots (ms)=20629
                Total time spent by all reduces in occupied slots (ms)=5938
                Total time spent by all map tasks (ms)=20629
                Total time spent by all reduce tasks (ms)=5938
                Total vcore-milliseconds taken by all map tasks=20629
                Total vcore-milliseconds taken by all reduce tasks=5938
                Total megabyte-milliseconds taken by all map tasks=21124096
                Total megabyte-milliseconds taken by all reduce tasks=6080512
        Map-Reduce Framework
                Map input records=2
                Map output records=4
                Map output bytes=36
                Map output materialized bytes=56
                Input split bytes=292
                Combine input records=0
                Combine output records=0
                Reduce input groups=2
                Reduce shuffle bytes=56
                Reduce input records=4
                Reduce output records=0
                Spilled Records=8
                Shuffled Maps =2
                Failed Shuffles=0
                Merged Map outputs=2
                GC time elapsed (ms)=393
                CPU time spent (ms)=2200
                Physical memory (bytes) snapshot=499138560
                Virtual memory (bytes) snapshot=8220651520
                Total committed heap usage (bytes)=269922304
                Peak Map Physical memory (bytes)=191692800
                Peak Map Virtual memory (bytes)=2737623040
                Peak Reduce Physical memory (bytes)=115863552
                Peak Reduce Virtual memory (bytes)=2745405440
        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=236
        File Output Format Counters 
                Bytes Written=97
Job Finished in 42.136 seconds
Estimated value of Pi is 4.00000000000000000000                                                         #执行结果,受参数影响,精度并不高。

标签:INFO,10,初体验,05,30,bytes,hadoop,2023,pi
From: https://www.cnblogs.com/ghoodoo/p/17798329.html

相关文章

  • 求pi值
    fromrandomimportrandomfrommathimportsqrtfromtimeimportprocess_timeastimerDARTS=1000hits=0.0timer()foriinrange(1,DARTS+1):x,y=random(),random()dist=sqrt(x**2+y**2)ifdist<=1.0:hits=hits+1pi=4*(hits/DARTS)print("P......
  • pi的计算
    求pi时可以采用蒙特卡罗的方法:随机向单位圆中和正方形中抛洒大量点,计算每个点到圆心的距离从而判断该点在圆内或圆外,用圆内的点数除以总点数。输入:随机抛出的点数处理:计算每个点到圆心的距离,统计在圆内的点的数量输出:pi值求pi的python程序为:fromrandomimportrandomfromm......
  • 使用Raspberry Pi和OpenPLC项目进行PLC编程1简介
    0前言0.1书籍介绍本书旨在向读者介绍如何将RaspberryPi计算机作为PLC(可编程逻辑控制)用于他们的项目。该项目要感谢程序员EdouardTisserant和MariodeSousa。他们在2003年IEC61131-3标准出台后启动了"Matiec项目"。这使得将标准中引入的编程语言翻译成C语言程序成为......
  • 好用的API调试工具推荐:Apipost
    随着数字化转型的加速,API(应用程序接口)已经成为企业间沟通和数据交换的关键。而在API开发和管理过程中,API文档、调试、Mock和测试的协作显得尤为重要。Apipost正是这样一款一体化协作平台,旨在解决这些问题,提高API开发效率和质量。Apipost提供API文档管理功能,让后端开发人员可以在开......
  • 记录--这个前端Api管理方案会更好?
    这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助简介大家好,前端小白一枚,目前接触后台管理系统比较多,经常遇到不同对象的增删改查的接口,如何对Api进行一个有比较好的管理是个问题。在学习偏函数的时候有了灵感,想到一个不错的API管理方案,并应用在项目一个模块当中......
  • 好用的API调试工具推荐:Apipost
    随着数字化转型的加速,API(应用程序接口)已经成为企业间沟通和数据交换的关键。而在API开发和管理过程中,API文档、调试、Mock和测试的协作显得尤为重要。Apipost正是这样一款一体化协作平台,旨在解决这些问题,提高API开发效率和质量。 Apipost提供API文档管理功能,让后端开发人员可......
  • Java基于API接口爬取淘宝商品数据
    随着互联网的普及和电子商务的快速发展,越来越多的商家选择在淘宝等电商平台上销售商品。对于开发者来说,通过API接口获取淘宝商品数据,可以更加便捷地进行数据分析和商业决策。本文将介绍如何使用Java基于淘宝API接口爬取商品数据,包括请求API、解析JSON数据、存储数据等步骤,并提供相......
  • centos7:安装python3.6.8:安装uvicorn、fastapi、pymysql:指定国内的pypi镜像源
    yuminstallpython3python3-develgccmakelibaio-develpip3install-ihttp://mirrors.aliyun.com/pypi/simple--trusted-hostmirrors.aliyun.com"uvicorn[standard]"==0.16.0pymysqlfastapi 关键点:因为centos7的软件仓库中,python3的版本比较低:python3-3.6.8-1......
  • API VS SDK!
    APIVSSDK!API(应用程序编程接口)和SDK(软件开发工具包)是软件开发领域的重要工具,但它们具有不同的用途:1.应用程序编程接口API是一组规则和协议,允许不同的软件应用程序和服务相互通信。它定义了软件组件如何交互。促进软件组件之间的数据交换和功能访问。通常由端点、请......
  • Hadoop三大组件(HDFS,MapReduce,Yarn)
    1、HDFSHDFS是Hadoop分布式文件系统。一个HDFS集群是由一个NameNode和若干个DataNode组成的。其中NameNode作为主服务器,管理文件系统的命名空间和客户端对文件的访问操作;集群中的DataNode管理存储的数据。2、MapReduceMapReduce是一个软件框架,基于该框架能够容易地编写......