首页 \ 问答 \ 尝试运行SparkPi示例时ClassNotFoundException(ClassNotFoundException when trying run the SparkPi example)

尝试运行SparkPi示例时ClassNotFoundException(ClassNotFoundException when trying run the SparkPi example)

我正在尝试从文档中运行第一个示例:

Spark运行在Java 6+和Python 2.6+上。 对于Scala API,Spark 1.0.0使用Scala 2.10。 您需要使用兼容的Scala版本(2.10.x)。

运行命令时会发生这种情况:

./bin/run-example examples/src/main/scala/org/apache/spark/examples/SparkPi.scala 10


Exception in thread "main" java.lang.ClassNotFoundException: org.apache.spark.examples.examples/src/main/scala/org/apache/spark/examples/SparkPi.scala
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:270)
    at org.apache.spark.deploy.SparkSubmit$.launch(SparkSubmit.scala:289)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:55)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

我正在使用的版本For Hadoop 2 (HDP2, CDH5)

已经尝试过scala 2.9.3,2.10.3和2.11

一些想法?


I'm trying to run the first example from the documentation that says:

Spark runs on Java 6+ and Python 2.6+. For the Scala API, Spark 1.0.0 uses Scala 2.10. You will need to use a compatible Scala version (2.10.x).

This happens when I run the command:

./bin/run-example examples/src/main/scala/org/apache/spark/examples/SparkPi.scala 10


Exception in thread "main" java.lang.ClassNotFoundException: org.apache.spark.examples.examples/src/main/scala/org/apache/spark/examples/SparkPi.scala
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:270)
    at org.apache.spark.deploy.SparkSubmit$.launch(SparkSubmit.scala:289)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:55)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

I'm using the version For Hadoop 2 (HDP2, CDH5)

already tried scala 2.9.3, 2.10.3 and 2.11

Some ideas?


原文:
更新时间:2022-09-06 08:09

最满意答案

如果您尝试使用ssh在远程计算机上执行脚本,则可以使用ssh运行脚本。 例如

os.system('ssh ' + <varWithHostName> + ' foo.py')

假设foo.py存在foo.py

http://www.cyberciti.biz/faq/unix-linux-execute-command-using-ssh/


If you're trying to execute the script on the remote machine with ssh you could run the script using ssh. e.g.

os.system('ssh ' + <varWithHostName> + ' foo.py')

given that foo.py exists on the machine

http://www.cyberciti.biz/faq/unix-linux-execute-command-using-ssh/

相关问答

更多
  • 我会把你转到paramiko 看到这个问题 ssh = paramiko.SSHClient() ssh.connect(server, username=username, password=password) ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command(cmd_to_execute) I will refer you to paramiko see this question ssh = paramiko.SSHClient() ssh.c ...
  • 运行nohup python bgservice.py & ,让脚本忽略挂断信号并继续运行。 输出将被放在nohup.out 。 理想情况下,您可以使用像supervise这样的操作来运行脚本,以便在(何时)死机时重新启动脚本。 Run nohup python bgservice.py & to get the script to ignore the hangup signal and keep running. Output will be put in nohup.out. Ideally, you ...
  • 尝试使用ssh -t hostname python_script 。 默认情况下, ssh在给定程序运行时不会分配一个伪tty来进行交互(尽管如果你只是执行ssh hostname )。 -t告诉它这样做。 Try ssh -t hostname python_script. By default, ssh doesn't allocate a pseudo-tty to interact with when it's given a program to run (although it does if ...
  • import subprocess, pipes # Generate your list of arguments *as a list of Python strings* rcvdate = '02/01/2018 00:00 am' cmd=['sed', '-i', 's@BEGRCVDDATE=[0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9] [0-9][0-9]:[0-9][0-9] [a-z][a-z]@BEGRCVDDATE=%s@' % ( ...
  • scp user@host:/PATH_YOUR_SCRIPT/Script.py Script.py;Script.py arg1 arg2 arg3 The solution to my problem is to use PATH=/cygdrive/c/WINDOWS/system32:/bin cmd /c in front of the script call, sth like: ssh user@host "PATH=/cygdrive/c/WINDOWS/system32:/bin cm ...
  • 您应该将“&”添加到“sudo python /{{path}}/{{script}}.py”的末尾 python /{{path}}/{{script}}.py & 这应该起作用,因为“&”表示rc.local继续运行,即使script.py也在执行。 编辑::从代码中删除“sudo”,因为rc.local以root身份运行,并且不需要“sudo”命令。 At the end, I solved this following this guide here Main steps: - create la ...
  • 好吧,如果我已经正确理解,你的客户端上有脚本,并希望在ssh的Pi上执行它。 scp /path/to/script.py user @ hostname:/ path / to / 然后将您的rsa密钥添加到您的服务器。 这本完美的指南告诉你如何。 然后编写.sh,它可以访问你的服务器ssh user@hostname ,然后是cd /path/to ,最后是python script.py Ok, if I have properly understood, you have script on you ...
  • 感谢@Bozidar Sikanjic 我已按照以下步骤确定问题 mkdir -p /var/www/.ssh sudo -u www-data ssh-keygen -t rsa 将id_rsa.pub复制到远程主机(我们将在脚本中使用ssh)授权的_key文件,这有效。 所以这意味着apache用户有权使用ssh write登录远程主机。 Thanks to @Bozidar Sikanjic I have followed below steps to nail down the issue mkd ...
  • 使用stream_get_contents(stream_out); 在你的代码中$stream_out = ssh2_fetch_stream($stream, SSH2_STREAM_STDIO); 这将返回resource而不是字符串输出。 试试这个代码。 $myfile = fopen("newfile.txt", "w") or die("Unable to open file!"); $connection = ssh2_connect('192.168.56.180', 22); ssh2_ ...
  • 如果您尝试使用ssh在远程计算机上执行脚本,则可以使用ssh运行脚本。 例如 os.system('ssh ' + + ' foo.py') 假设foo.py存在foo.py http://www.cyberciti.biz/faq/unix-linux-execute-command-using-ssh/ If you're trying to execute the script on the remote machine with ssh you could ru ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)