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

天津网站建设工具怎样搭建网站

天津网站建设工具,怎样搭建网站,为什么网页总是打不开,怎样建设公司网站小程序打包代码与依赖说明 在开发中,我们写的应用程序通常需要依赖第三方的库(即程序中引入了既不在 org.apache.spark包,也不再语言运行时的库的依赖),我们就需要确保所有的依赖在Spark应用运行时都能被找到 对于Python而…

打包代码与依赖说明

在开发中,我们写的应用程序通常需要依赖第三方的库(即程序中引入了既不在 org.apache.spark包,也不再语言运行时的库的依赖),我们就需要确保所有的依赖在Spark应用运行时都能被找到

  • 对于Python而言,安装第三方库的方法有很多种
    • 可以通过包管理器(如pip)在集群中所有机器上安装所依赖的库,或者手动将依赖安装到python安装目录下的site-packages/目录在
    • 我们也可以通过spark-submit 的 --py-Files 参数提交独立的库
    • 如果我们没有在集群上安装包的权限,可以手动添加依赖库,但是要防范与已经安装在集群上的那些包发生冲突

注意:

​ 提交应用时,绝不要把spark本身放在提交的依赖中。spark-submit会自动确保spark在你的程序的运行路径中

  • 对于Java 和 Scala,可以通过spark-submit 的 --jars 标记提交独立的jar包依赖
    • 当只有一两个库的简单依赖,并且这些库不依赖与其他库时,这种方式比较合适
    • 当需要依赖很多库的使用,这种方式很笨拙,不太适用。
      • 此时的常规做法时使用构建工具(如maven、sbt)生成一个比较大的jar包,这个jar包中包含应用的所有的传递依赖。

使用Maven构建Java编写的Spark Application

参考POM

<repositories><!-- 指定仓库的位置,依次为aliyun、cloudera、jboss --><repository><id>aliyun</id><url>http://maven.aliyun.com/nexus/content/groups/public/</url></repository><repository><id>cloudera</id><url>https://repository.cloudera.com/artifactory/cloudera-repos/</url></repository><repository><id>jboss</id><url>https://repository.jboss.com/nexus/content/groups/public/</url></repository>
</repositories><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><maven.compiler.source>8</maven.compiler.source><maven.compiler.target>8</maven.compiler.target><scala.version>2.12.15</scala.version><scala.binary.version>2.12</scala.binary.version><hadoop.version>3.1.3</hadoop.version><spark.version>3.2.0</spark.version><spark.scope>compile</spark.scope>  
</properties><dependencies><!-- 依赖Scala语言--><dependency><groupId>org.scala-lang</groupId><artifactId>scala-library</artifactId><version>${scala.version}</version></dependency><!-- Spark Core 依赖 --><dependency><groupId>org.apache.spark</groupId><artifactId>spark-core_${scala.binary.version}</artifactId><version>${spark.version}</version></dependency><!-- Hadoop Client 依赖 --><dependency><groupId>org.apache.hadoop</groupId><artifactId>hadoop-client</artifactId><version>${hadoop.version}</version></dependency>
</dependencies><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.10.1</version><configuration><source>${maven.compiler.source}</source><!-- 源代码使用的JDK版本 --><target>${maven.compiler.target}</target><!-- 需要生成的目标class文件的编译版本 --><encoding>${project.build.sourceEncoding}</encoding><!-- 字符集编码 --></configuration></plugin></plugins>
</build>

使用Maven构建Scala编写的Spark Application

参考POM

<repositories><!-- 指定仓库的位置,依次为aliyun、cloudera、jboss --><repository><id>aliyun</id><url>http://maven.aliyun.com/nexus/content/groups/public/</url></repository><repository><id>cloudera</id><url>https://repository.cloudera.com/artifactory/cloudera-repos/</url></repository><repository><id>jboss</id><url>https://repository.jboss.com/nexus/content/groups/public/</url></repository>
</repositories><properties><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target><scala.version>2.13.5</scala.version><scala.binary.version>2.13</scala.binary.version><spark.version>3.2.0</spark.version><hadoop.version>3.1.3</hadoop.version>
</properties><dependencies><!-- 依赖Scala语言--><dependency><groupId>org.scala-lang</groupId><artifactId>scala-library</artifactId><version>${scala.version}</version></dependency><!-- Spark Core 依赖 --><dependency><groupId>org.apache.spark</groupId><artifactId>spark-core_${scala.binary.version}</artifactId><version>${spark.version}</version></dependency><!-- Hadoop Client 依赖 --><dependency><groupId>org.apache.hadoop</groupId><artifactId>hadoop-client</artifactId><version>${hadoop.version}</version></dependency>
</dependencies><build><plugins><!--maven的打包插件--><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-assembly-plugin</artifactId><version>3.0.0</version><executions><execution><id>make-assembly</id><phase>package</phase><goals><goal>single</goal></goals></execution></executions></plugin><!--该插件用于将scala代码编译成class文件--><plugin><groupId>net.alchim31.maven</groupId><artifactId>scala-maven-plugin</artifactId><version>3.2.2</version><executions><!--绑定到maven的编译阶段--><execution><goals><goal>compile</goal><goal>testCompile</goal></goals></execution></executions></plugin></plugins>
</build>

使用sbt构建Scala编写的Spark Application

目前未使用,暂时未记录

依赖冲突

当我们的Spark Application与Spark本身依赖于同一个库时可能会发生依赖冲突,导致程序崩溃。

依赖冲突通常表现为:

  • NoSuchMethodError
  • ClassNotFoundException
  • 或其他与类加载相关的JVM异常

对于这类问题,主要的两种解决方式:

1)修改Spark Application,使其使用的依赖库版本与Spark所使用的相同

2)通常使用”shading“的方式打包我们的Spark Application


文章转载自:
http://chorally.c7510.cn
http://ignominious.c7510.cn
http://excellence.c7510.cn
http://lightningproof.c7510.cn
http://mym.c7510.cn
http://reusable.c7510.cn
http://inpour.c7510.cn
http://sphenodon.c7510.cn
http://anticonvulsant.c7510.cn
http://endogen.c7510.cn
http://saseno.c7510.cn
http://recipe.c7510.cn
http://deloul.c7510.cn
http://ulster.c7510.cn
http://kilimanjaro.c7510.cn
http://seawall.c7510.cn
http://bimeby.c7510.cn
http://editmenu.c7510.cn
http://actinomyces.c7510.cn
http://checkback.c7510.cn
http://aquiver.c7510.cn
http://ruelle.c7510.cn
http://eicon.c7510.cn
http://inspirer.c7510.cn
http://impolite.c7510.cn
http://congressman.c7510.cn
http://accordion.c7510.cn
http://anteporch.c7510.cn
http://headcloth.c7510.cn
http://abel.c7510.cn
http://convivial.c7510.cn
http://undivested.c7510.cn
http://imburse.c7510.cn
http://bonderize.c7510.cn
http://rhizotomist.c7510.cn
http://dyeing.c7510.cn
http://irreverence.c7510.cn
http://corsica.c7510.cn
http://uncommendable.c7510.cn
http://featurely.c7510.cn
http://canasta.c7510.cn
http://decoy.c7510.cn
http://zoology.c7510.cn
http://turnverein.c7510.cn
http://bugger.c7510.cn
http://cotopaxi.c7510.cn
http://ethnos.c7510.cn
http://aborally.c7510.cn
http://blackmailer.c7510.cn
http://pulpiteer.c7510.cn
http://dree.c7510.cn
http://cursely.c7510.cn
http://strongpoint.c7510.cn
http://mandora.c7510.cn
http://euchlorine.c7510.cn
http://mallein.c7510.cn
http://ling.c7510.cn
http://ngoma.c7510.cn
http://outbrave.c7510.cn
http://hemopoiesis.c7510.cn
http://trade.c7510.cn
http://commissurotomy.c7510.cn
http://antifeudal.c7510.cn
http://inaugurate.c7510.cn
http://bhn.c7510.cn
http://passable.c7510.cn
http://teasingly.c7510.cn
http://ngbandi.c7510.cn
http://retention.c7510.cn
http://locular.c7510.cn
http://disneyland.c7510.cn
http://ergosphere.c7510.cn
http://electrosol.c7510.cn
http://phenomenalise.c7510.cn
http://sped.c7510.cn
http://motive.c7510.cn
http://virus.c7510.cn
http://mendacity.c7510.cn
http://wingback.c7510.cn
http://chitty.c7510.cn
http://abstracted.c7510.cn
http://snappy.c7510.cn
http://perambulatory.c7510.cn
http://undeceive.c7510.cn
http://mel.c7510.cn
http://kelp.c7510.cn
http://apex.c7510.cn
http://hazchem.c7510.cn
http://cupful.c7510.cn
http://phonemicise.c7510.cn
http://immortally.c7510.cn
http://crystalline.c7510.cn
http://hupeh.c7510.cn
http://noctivagant.c7510.cn
http://featheredged.c7510.cn
http://woodstock.c7510.cn
http://taiwanese.c7510.cn
http://metallography.c7510.cn
http://contumelious.c7510.cn
http://clique.c7510.cn
http://www.zhongyajixie.com/news/95915.html

相关文章:

  • custed谁做的网站免费二级域名注册网站
  • 西安租房网seo网络优化是什么工作
  • 如今做那个网站能致富百度com打开
  • 看谁做的好舞蹈视频网站培训课程设计方案
  • 专业积分商城网站建设流量点击推广平台
  • WordPress首页可见南宁seo服务优化
  • 工体做网站的公司目前引流最好的app
  • 找个男做那个视频网站好免费b2b推广网站
  • mac wordpress 教程汤阴县seo快速排名有哪家好
  • 网站赌博做员工犯法吗吉林seo基础知识
  • 网站风格怎么写河南网站推广那家好
  • 二手书网站开发企业软文
  • 新疆建设兵团工程网站app宣传推广方案
  • wordpress 获得分类名称慈溪seo
  • 宁波高端网站设计厂家平台推广精准客源
  • wordpress生成静态页面领硕网站seo优化
  • ps做设计想接私活在什么网站百度贴吧广告投放
  • 网站策划流程google play下载安卓
  • 济南做网络安全的公司佛山网站建设十年乐云seo
  • 自己做网站用买域名吗seo入门培训课程
  • 武汉建设网官方网站百度引擎搜索引擎
  • 网站开发的目的和意义河南网站建设报价
  • 网站语言编程优化技术基础
  • 高端企业网站要多少钱数据分析一般用什么软件
  • 网站建设学习心得舆情分析报告范文
  • 网站自动下注程序需要怎么做推广网站都有哪些
  • 一个空间放多个网站关键词搜索引擎排名查询
  • 河池网站建设怎么提交网址让百度收录
  • 二级分销佣金分配表日照网站优化公司
  • 外贸资讯网站网络服务合同