2017-08-16 48 views
0

我無法啓動Apache Spark 2.1.1的工作者節點(我有單節點設置,我的主人和工作人員將在同一主機上運行),下面是日誌:下面無法啓動Apache Spark 2.1.1的工作者節點

$ ./start-all.sh 

starting org.apache.spark.deploy.master.Master, logging to /home/kedar/software/spark/logs/spark-kedar-org.apache.spark.deploy.master.Master-1-myhost.out localhost: starting org.apache.spark.deploy.worker.Worker, logging to /home/kedar/software/spark/logs/spark-kedar-org.apache.spark.deploy.worker.Worker-1-myhost.out localhost: failed to launch: nice -n 0 /home/kedar/software/spark/bin/spark-class org.apache.spark.deploy.worker.Worker --webui-port 8081 spark://myhost:7077 localhost: at java.lang.ClassLoader.loadClass(ClassLoader.java:358) localhost: at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482) localhost: full log in /home/kedar/software/spark/logs/spark-kedar-org.apache.spark.deploy.worker.Worker-1-myhost.out

是日誌:

$ cat /home/kedar/software/spark/logs/spark-kedar-org.apache.spark.deploy.worker.Worker-1-myhost.out 

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/spark/launcher/Main : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:803) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:442) at java.net.URLClassLoader.access$100(URLClassLoader.java:64) at java.net.URLClassLoader$1.run(URLClassLoader.java:354) at java.net.URLClassLoader$1.run(URLClassLoader.java:348) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:347) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:312) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

任何幫助表示讚賞!謝謝!

+0

沒有Java相關的問題我看,師父可以開始。 –

+0

大師和工作人員是不同的機器,所以它可以啓動 –

+0

這似乎是multiversion java問題,當我調試它時,我看到我的java選項指向錯誤的java版本,我會發布正確的步驟來解決此問題。 –

回答

2

這個問題是我的Java替代品指向錯誤的Java版本,下面是解決ubuntu上的問題的步驟,並且我們可以看到火花也成功啓動:

[email protected]:/opt$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/opt/jdk1.8.0_72/bin/javac" 
javac 
[email protected]:/opt$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/opt/jdk1.8.0_72/bin/javac" 1 
[email protected]:/opt$ ll javac 
ls: cannot access javac: No such file or directory 
[email protected]:/opt$ sudo update-alternatives --config java 
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 
Nothing to configure. 
[email protected]:/opt$ sudo update-alternatives --config javac 
There are 2 choices for the alternative javac (providing /usr/bin/javac). 

    Selection Path           Priority Status 
------------------------------------------------------------ 
* 0   /usr/lib/jvm/java-7-openjdk-amd64/bin/javac 1071  auto mode 
    1   /opt/jdk1.8.0_72/bin/javac     1   manual mode 
    2   /usr/lib/jvm/java-7-openjdk-amd64/bin/javac 1071  manual mode 

Press enter to keep the current choice[*], or type selection number: 1  
update-alternatives: using /opt/jdk1.8.0_72/bin/javac to provide /usr/bin/javac (javac) in manual mode 
[email protected]:/opt$ sudo update-alternatives --config javac 
There are 2 choices for the alternative javac (providing /usr/bin/javac). 

    Selection Path           Priority Status 
------------------------------------------------------------ 
    0   /usr/lib/jvm/java-7-openjdk-amd64/bin/javac 1071  auto mode 
* 1   /opt/jdk1.8.0_72/bin/javac     1   manual mode 
    2   /usr/lib/jvm/java-7-openjdk-amd64/bin/javac 1071  manual mode 

Press enter to keep the current choice[*], or type selection number: [email protected]:/opt$ 
[email protected]:/opt$ 
[email protected]:/opt$ 
[email protected]:/opt$ sudo update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.8.0_72/bin/java" 1 
[email protected]:/opt$ ll javac 
ls: cannot access javac: No such file or directory 
[email protected]:/opt$ sudo update-alternatives --config java 
There are 2 choices for the alternative java (providing /usr/bin/java). 

    Selection Path           Priority Status 
------------------------------------------------------------ 
* 0   /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071  auto mode 
    1   /opt/jdk1.8.0_72/bin/java      1   manual mode 
    2   /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071  manual mode 

Press enter to keep the current choice[*], or type selection number: 1 
update-alternatives: using /opt/jdk1.8.0_72/bin/java to provide /usr/bin/java (java) in manual mode 
[email protected]:/opt$ cd 
[email protected]:~$ cd $SPARK_HOME 
[email protected]:~/software/spark$ ./sbin/stop-all.sh 
localhost: no org.apache.spark.deploy.worker.Worker to stop 
stopping org.apache.spark.deploy.master.Master 
[email protected]:~/software/spark$ ./sbin/start-all.sh 
starting org.apache.spark.deploy.master.Master, logging to /home/kedar/software/spark/logs/spark-kedar-org.apache.spark.deploy.master.Master-1-myhost.out 
localhost: starting org.apache.spark.deploy.worker.Worker, logging to /home/kedar/software/spark/logs/spark-kedar-org.apache.spark.deploy.worker.Worker-1-myhost.out