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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

第一个Spark实例:求PI值

發布時間:2025/3/11 编程问答 16 豆豆
生活随笔 收集整理的這篇文章主要介紹了 第一个Spark实例:求PI值 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

向spark提交jar,需要使用 bin下的spark-submit

[hadoop@nbdo1 bin]$ ./spark-submit --help Usage: spark-submit [options] <app jar | python file> [app arguments] Usage: spark-submit --kill [submission ID] --master [spark://...] Usage: spark-submit --status [submission ID] --master [spark://...] Usage: spark-submit run-example [options] example-class [example args]Options:--master MASTER_URL spark://host:port, mesos://host:port, yarn, or local.--deploy-mode DEPLOY_MODE Whether to launch the driver program locally ("client") oron one of the worker machines inside the cluster ("cluster")(Default: client).--class CLASS_NAME Your application's main class (for Java / Scala apps).--name NAME A name of your application.--jars JARS Comma-separated list of local jars to include on the driverand executor classpaths.--packages Comma-separated list of maven coordinates of jars to includeon the driver and executor classpaths. Will search the localmaven repo, then maven central and any additional remoterepositories given by --repositories. The format for thecoordinates should be groupId:artifactId:version.--exclude-packages Comma-separated list of groupId:artifactId, to exclude whileresolving the dependencies provided in --packages to avoiddependency conflicts.--repositories Comma-separated list of additional remote repositories tosearch for the maven coordinates given with --packages.--py-files PY_FILES Comma-separated list of .zip, .egg, or .py files to placeon the PYTHONPATH for Python apps.--files FILES Comma-separated list of files to be placed in the workingdirectory of each executor.--conf PROP=VALUE Arbitrary Spark configuration property.--properties-file FILE Path to a file from which to load extra properties. If notspecified, this will look for conf/spark-defaults.conf.--driver-memory MEM Memory for driver (e.g. 1000M, 2G) (Default: 1024M).--driver-java-options Extra Java options to pass to the driver.--driver-library-path Extra library path entries to pass to the driver.--driver-class-path Extra class path entries to pass to the driver. Note thatjars added with --jars are automatically included in theclasspath.--executor-memory MEM Memory per executor (e.g. 1000M, 2G) (Default: 1G).--proxy-user NAME User to impersonate when submitting the application.This argument does not work with --principal / --keytab.--help, -h Show this help message and exit.--verbose, -v Print additional debug output.--version, Print the version of current Spark.Spark standalone with cluster deploy mode only:--driver-cores NUM Cores for driver (Default: 1).Spark standalone or Mesos with cluster deploy mode only:--supervise If given, restarts the driver on failure.--kill SUBMISSION_ID If given, kills the driver specified.--status SUBMISSION_ID If given, requests the status of the driver specified.Spark standalone and Mesos only:--total-executor-cores NUM Total cores for all executors.Spark standalone and YARN only:--executor-cores NUM Number of cores per executor. (Default: 1 in YARN mode,or all available cores on the worker in standalone mode)YARN-only:--driver-cores NUM Number of cores used by the driver, only in cluster mode(Default: 1).--queue QUEUE_NAME The YARN queue to submit to (Default: "default").--num-executors NUM Number of executors to launch (Default: 2).If dynamic allocation is enabled, the initial number ofexecutors will be at least NUM.--archives ARCHIVES Comma separated list of archives to be extracted into theworking directory of each executor.--principal PRINCIPAL Principal to be used to login to KDC, while running onsecure HDFS.--keytab KEYTAB The full path to the file that contains the keytab for theprincipal specified above. This keytab will be copied tothe node running the Application Master via the SecureDistributed Cache, for renewing the login tickets and thedelegation tokens periodically.


求PI值

spark內置了一些實例,在/home/hadoop/spark/examples/jars/spark-examples_2.11-2.1.1.jar 里
(不同版本位置有所區別)

該算法是利用蒙特·卡羅算法求PI

http://blog.csdn.net/xmmxjycqupt/article/details/9320627

https://www.zhihu.com/question/20254139


命令:

./spark-submit --master spark://nbdo1:7077 --class org.apache.spark.examples.SparkPi /home/hadoop/spark/examples/jars/spark-examples_2.11-2.1.1.jar 100




運行結果

.........

17/05/15 16:46:31 INFO TaskSchedulerImpl: Removed TaskSet 0.0, whose tasks have all completed, from pool?
17/05/15 16:46:31 INFO DAGScheduler: ResultStage 0 (reduce at SparkPi.scala:38) finished in 5.875 s
17/05/15 16:46:31 INFO DAGScheduler: Job 0 finished: reduce at SparkPi.scala:38, took 6.407038 s
Pi is roughly 3.1420331142033113
17/05/15 16:46:31 INFO SparkUI: Stopped Spark web UI at http://192.168.18.146:4040
17/05/15 16:46:31 INFO StandaloneSchedulerBackend: Shutting down all executors
17/05/15 16:46:31 INFO CoarseGrainedSchedulerBackend$DriverEndpoint: Asking each executor to shut down

........



-------------

更多的Java,Android,大數據,J2EE,Python,數據庫,Linux,Java架構師,教程,視頻請訪問:

http://www.cnblogs.com/zengmiaogen/p/7083694.html



總結

以上是生活随笔為你收集整理的第一个Spark实例:求PI值的全部內容,希望文章能夠幫你解決所遇到的問題。

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

主站蜘蛛池模板: 欧美精品亚洲精品日韩精品 | 在线视频二区 | 日韩在线精品视频 | 国产精品扒开腿做爽爽爽视频 | 亚洲性色视频 | 成人黄色网址在线观看 | 久久精品爱 | 欧美午夜一区二区三区 | 天天干天天摸 | 综合在线视频 | 日本一区二区免费电影 | 青青青国产在线 | 国产精品美女久久久久久 | 免费毛片观看 | 日本视频免费 | 国产欧美亚洲精品 | 激情久久av一区av二区av三区 | 让人下面流水的视频 | 国产成人无码av | 午夜福利视频 | 奇米影视盒 | 国内自拍av | 欧美日韩国产色 | 欧美国产视频 | 男人的天堂av片 | 阿v天堂网 | 国产高清免费观看 | 99热99re6国产在线播放 | 免费看黄色三级三级 | 黄色一级在线观看 | 91福利网站 | 秋霞午夜鲁丝一区二区 | 久久久久久一区 | 色视频网 | 国产最爽的乱淫视频国语对白 | 波多野一区二区 | 男人天堂网在线视频 | 一区二区三区亚洲视频 | 捆绑凌虐一区二区三区 | 中文字幕一区二区三区门四区五区 | 欧美人xxx| 亚洲男女在线观看 | www.av日韩 | 精品三级在线观看 | www.成人网| 久久成年视频 | 中文字幕超清在线观看 | 一路向西在线看 | 日韩av电影在线播放 | 一区二区免费在线视频 | 精国产人伦一区二区三区 | 美女国产视频 | 麻豆视频成人 | 啪啪啪一区二区 | 色妻影院 | 最近最新最好看的2019 | 91美女视频 | 国产麻豆剧传媒精品国产 | 最近中文字幕免费mv视频7 | 毛片毛片毛片毛片 | 奇米色婷婷 | 在线免费观看一区 | 影音先锋波多野结衣 | 国产欧美日韩专区 | 五月天国产精品 | 婷婷伊人久久 | 伊人网免费视频 | 777精品伊人久久久久大香线蕉 | 中文字幕日日 | 一二三av| 婷婷午夜精品久久久久久性色av | 五月激情婷婷网 | 日本免费一区二区三区最新 | 国产一区二区三区在线视频 | 日韩精品久久久久久久的张开腿让 | 天天曰夜夜操 | 东北少妇露脸无套对白 | 欧美精品亚洲 | 涩涩涩在线视频 | www.欧美成人| 欧美日韩在线精品 | 9色在线视频 | 国产夫妻视频 | 欧美日韩在线视频一区二区 | 亚洲在线视频网站 | 久久久青青 | 亚洲精品在线观看免费 | 91精品国产一区二区三区香蕉 | 久草视频在线资源站 | 欧美老熟妇又粗又大 | 一本大道综合伊人精品热热 | 草草久久久 | 水果派解说av | 国产精品51| 在线观看h视频 | 成人福利视频在线 | 欧美狠狠 | 视频一区二区国产 | 欧美性猛交xxxx乱大交 |