加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Scala对Spark安装的依赖性

发布时间:2020-12-16 09:49:33 所属栏目:安全 来源:网络整理
导读:我刚开始使用Spark,所以从 here下载了Hadoop 1(HDP1,CDH3)二进制文件,并在Ubuntu VM上提取它.在没有安装Scala的情况下,我能够从Spark交互式shell执行 Quick Start指南中的示例. Spark包含Scala吗?如果是,库/二进制文件在哪里? 为了在其他模式(分布式)中运
我刚开始使用Spark,所以从 here下载了Hadoop 1(HDP1,CDH3)二进制文件,并在Ubuntu VM上提取它.在没有安装Scala的情况下,我能够从Spark交互式shell执行 Quick Start指南中的示例.

> Spark包含Scala吗?如果是,库/二进制文件在哪里?
>为了在其他模式(分布式)中运行Spark,我是否需要在所有节点上安装Scala?

作为旁注,我观察到Spark拥有围绕开源项目的最佳文档之一.

解决方法

Spark包含Scala吗?如果是,库/二进制文件在哪里?

项目配置放在项目/文件夹中.我的情况是:

$ls project/
build.properties  plugins.sbt  project  SparkBuild.scala  target

当您执行sbt / sbt程序集时,它会下载适当版本的Scala以及其他项目依赖项.签出文件夹目标/例如:

$ls target/
scala-2.9.2  streams

请注意,Scala版本对我来说是2.9.2.

为了在其他模式(分布式)中运行Spark,我是否需要在所有节点上安装Scala?

是.您可以按照Spark documentation中的说明创建单个装配罐

If your code depends on other projects,you will need to ensure they are also present on the slave nodes. A popular approach is to create an assembly jar (or “uber” jar) containing your code and its dependencies. Both sbt and Maven have assembly plugins. When creating assembly jars,list Spark itself as a provided dependency; it need not be bundled since it is already present on the slaves. Once you have an assembled jar,add it to the SparkContext as shown here. It is also possible to submit your dependent jars one-by-one when creating a SparkContext.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读