尝试运行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?
原文:
最满意答案
如果您尝试使用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 machinehttp://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 ...
-
即使在注销SSH之后,如何在后台运行Python脚本?(How to run a Python script in the background even after I logout SSH?)[2022-07-27]
运行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 ... -
Python挂在ssh上(Python hangs over ssh)[2023-09-28]
尝试使用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 ...
-
在启动时执行Python脚本(Execute Python script at boot)[2020-01-07]
您应该将“&”添加到“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连接的服务器执行python脚本?(How to execute python script based on the server of an ssh connection?)[2023-01-06]
好吧,如果我已经正确理解,你的客户端上有脚本,并希望在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 ... -
在网页中执行ssh脚本(Execute ssh script in webpage)[2023-04-28]
感谢@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 ...