当前位置: 首页 > news >正文

徐州企业网站建设公司响应式购物网站设计

徐州企业网站建设公司,响应式购物网站设计,雄安做网站的公司,wordpress活动报名一、原理 spark-submit --files通常用来加载外部资源文件#xff0c;在driver和executor进程中进行访问 –files和–jars基本相同 二、使用步骤 2.1 添加文件 spark-submit --files file_paths 其中file_paths可为多种方式#xff1a;file: | hdfs:// | http:// | ftp:// |…一、原理 spark-submit --files通常用来加载外部资源文件在driver和executor进程中进行访问 –files和–jars基本相同 二、使用步骤 2.1 添加文件 spark-submit --files file_paths 其中file_paths可为多种方式file: | hdfs:// | http:// | ftp:// | local:多个路径用逗号隔开 spark-submit \ --master yarn \ --deploy-mode cluster \ --principal xxx.com \ --keytab /xxx/keytabs/xxx.keytab \ --driver-java-options -Dspring.profiles.activeprod -Dorg.springframework.boot.logging.LoggingSystemnone -Djava.ext.dirs/xxx/CDH-x.x.x-1.cdhx.x.x.p0.xxx/lib/spark/jars/gson-2.8.1.jar,/xxx/CDH-x.x.x-1.cdhx.1.1.p0.xxx/lib/hive/lib/* -Dspark.yarn.dist.files/xxx/CDH-x.1.1-1.cdhx.1.1.p0.xxx/etc/hadoop/conf.dist/yarn-site.xml \ --driver-class-path /xxx/CDH-x.x.x-x.cdhx.x.x.p1000.xxx/jars/gson-2.8.1.jar:$JAVA_HOME/jre/lib/ext/*:/xxx/CDH-x.x.x-1.cdhx.x.x.p1000.xxx/jars/commons-cli-1.4.jar \ --driver-cores $dc \ --driver-memory $dm \ --num-executors $ne \ --executor-cores $ec \ --executor-memory $em \ --conf spark.sql.crossJoin.enabledtrue \ --conf spark.dynamicAllocation.enabledfalse \ --conf spark.yarn.maxAppAttempts1 \ --conf spark.driver.maxResultSize20G \ --conf spark.sql.shuffle.partitions$partitions \ --conf spark.default.parallelism$partitions \ --conf spark.sql.adaptive.enabledtrue \ --conf spark.sql.adaptive.shuffle.targetPostShuffleInputSize128000000 \ --conf spark.yarn.queuexxx \ --conf spark.shuffle.io.maxRetries200 \ --conf spark.shuffle.io.retryWait30 \ --conf spark.port.maxRetries120 \ --conf spark.core.connection.ack.wait.timeout6000 \ --conf spark.shuffle.sort.bypassMergeThreshold300 \ --conf spark.hadoop.hive.exec.dynamic.partition$dp \ --conf spark.hadoop.hive.exec.dynamic.partition.modenonstrict \ --conf spark.hadoop.hive.exec.max.dynamic.partitions2000 \ --name $name \ --files $files \ #/path/服务器本地文件 --class xxxApplication /xxx/xxx-1.0-SNAPSHOT.jar -jn $obj -sq $sql -ptby $ptby2.2 获取文件 2.2.1 方案一 //If you add your external files using spark-submit --files your files will be uploaded to this HDFS folder: hdfs://your-cluster/user/your-user/.sparkStaging/application_1449220589084_0508//application_1449220589084_0508 is an example of yarn application ID!//1. find the spark staging directory by below code: (but you need to have the hdfs uri and your username)System.getenv(SPARK_YARN_STAGING_DIR); -- .sparkStaging/application_1449220589084_0508//2. find the complete comma separated file paths by using:System.getenv(SPARK_YARN_CACHE_FILES); -- hdfs://yourcluster/user/hdfs/.sparkStaging/application_1449220589084_0508/spark-assembly-1.4.1.2.3.2.0-2950-hadoop2.7.1.2.3.2.0-2950.jar#__spark__.jar, hdfs://yourcluster/user/hdfs/.sparkStaging/application_1449220589084_0508/your-spark-job.jar#__app__.jar, hdfs://yourcluster/user/hdfs/.sparkStaging/application_1449220589084_0508/test_file.txt#test_file.txt--files会把文件上传到hdfs的.sparkStagin/applicationId目录下。 spark.read().textFile(System.getenv(SPARK_YARN_STAGING_DIR) /xxx.xxx) textFile不指定hdfs、file或者其他前缀的话默认是hdfs://yourcluster/user/your_username下的相对路径。 2.2.2 方案二 SparkFiles.get(fileName) SparkFiles.get(fileName)    适用于local模式 JavaRDDString stringJavaRDD sparkcontext.textFile(SparkFiles.get(fileName));ListString collect stringJavaRDD.collect();[注意事项] 在cluster模式下(-- deploy-mode cluster )-- files必须使用全局可视的地址比如hdfs否则driver将无法找到文件出现FileNotFoundException。这是因为driver会在集群中任意一台worker节点上运行使用本地地址无法找到文件。FileNotFoundException异常出现在SparkSession的getOrCreate()初始化方法中因为此方法会调用addFile()但是确找不到文件导致SparkSession初始化失败。注意–jars原理相同但是getOrCreate()中调用addJars出现异常但是并不会导SparkSession初始化失败程序会继续运行。 值得一提的是在cluster模式下spark-submit   --deploy-mode cluster   path-to-jar其中path-to-jar也必须是全局可视路径否则会发生找不到jar的异常。 2.2.3 方案三 new FileInputStream(fileName) FileInputStream sqlstream new FileInputStream(fileName);StringBuilder sqlContent new StringBuilder();Scanner scanner new Scanner(sqlstream, UTF-8);while (scanner.hasNextLine()) {String line scanner.nextLine();sqlContent.append(line).append(\n); }适用于local、yarn client、yarn cluster模式, 2.2.4 方案四 Properties properties new Properties(); properties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(test.properties));适应于yarn、cluster模式
http://www.hkea.cn/news/14464621/

相关文章:

  • 腾讯网网站网址wordpress取消作者
  • 国外做农产品有名的网站wordpress下载管理员
  • php网站后台地址建筑材料网站建设
  • 怎么做网站策划上海市建设工程咨询行业协会官网
  • 云南网站建设哪家便宜做网站文字居中代码
  • 怎么用支付宝做发卡网站在百度怎么开店卖货
  • 荆州网站建设费用宠物网站建设内容
  • 湖州网站设计汽车网站模版
  • dw8 php做购物网站教程前端网站优化
  • 公司如何做网站建设wordpress网页
  • 除了wordpress还有什么可以建站邢台提供网站建设公司哪家好
  • 网站建设报价模版网站模板小偷
  • 武威 网站建设论坛推广怎么做
  • 建设网站最简单的软件是我找客户做网站怎么说
  • 建筑资料免费下载网站北京网站定制流程
  • 士兵突击网站怎么做国内网站备案
  • 成都装修建材网站建设企业服饰网站模板
  • 网站个人和公司有什么区别是什么上海建设工程交易服务中心
  • 新建网站怎么想谷歌和百度提交西宁做网站的公司旭云网络
  • 服装公司网站源码私募基金网站怎么做seo
  • wordpress 做大型网站搜索引擎营销ppt
  • wordpress新建页面有什么作用百度快速优化软件
  • 营销网站建设案例正定网站建设
  • 网站备案转服务器wordpress iis 分页 404
  • WordPress网站接入公众号飞扬世纪网站建设
  • 寿光专业做网站广东新闻联播
  • wordpress做网站手机修水县城乡建设局官方网站
  • 如何做盗版视频网站揭阳建网站
  • 主流网站开发医疗营销的网站怎么做
  • 深圳做网站公司有哪些大型网站开发周期