简体   繁体   English

如何在HDP中安装scala库(Hortonworks数据平台)

[英]How to install scala libraries in HDP (Hortonworks Data Platform)

thanks in advance for the time you according reading this and sorry for my bad english. 感谢您提前阅读此内容并抱歉我的英语不好。

I am trying to use Spark streaming for real time data processing. 我正在尝试使用Spark流进行实时数据处理。 I have Spark installed in HDP (Hortonworks Data Platform) and for my process I need to install a scala library for JSONparsing. 我在HDP(Hortonworks数据平台)中安装了Spark,对于我的进程,我需要为JSONparsing安装一个scala库。 I read a lot of things on internet about that but it just was for a simple Spark Cluster not for solution like HDP and CDH, I tried to adapt the solution but I couldn't, I don't find any scala files to install it. 我在互联网上阅读了很多相关内容,但它只是针对一个简单的Spark Cluster而不是像HDP和CDH这样的解决方案,我试图调整解决方案,但我不能,我找不到任何scala文件来安装它。 Does anybody know a solution or a tips to help me ? 有人知道帮助我的解决方案或提示吗? Thank you 谢谢

To load dependencies for Spark in Zeppelin you need to create a new cell and use the following: 要在Zeppelin中加载Spark的依赖项,您需要创建一个新单元并使用以下内容:

%dep
// it's a good idea to do a reset first, but not required
z.reset()
// the following line will load directly from the Maven online repo
z.load("org.apache.spark:spark-streaming-karka_2.10:1.6.1")

Additional details on loading dependencies for Zeppelin can be found here: https://zeppelin.apache.org/docs/latest/interpreter/spark.html#3-dynamic-dependency-loading-via-dep-interpreter 有关加载Zeppelin依赖关系的更多详细信息,请访问: https//zeppelin.apache.org/docs/latest/interpreter/spark.html#3-dynamic-dependency-loading-via-dep-interpreter

One thin to not here, is that dependency loading must be the first cell you run on your notebook, it will give you an error message if it's not. 一个很薄的不在这里,依赖加载必须是你在笔记本上运行的第一个单元格,如果不是,它会给你一个错误信息。 To get around this click on the Interpreter tab and click restart on the Spark Interpreter, then go back to your notebook and run the cell with the %dep 要解决此问题,请单击解释器选项卡,然后单击Spark解释器上的重新启动,然后返回到您的笔记本并使用%dep运行单元格

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM