Build Spark Source Reading environment

Source: Internet
Author: User

1. Install JDK1.7, Maven3.2.5, Scala2.10.4

2. Download the decompression Spark1.4.0
: http://mirrors.cnnic.cn/apache/spark/spark-1.4.0/spark-1.4.0.tgz

3. Download and install IntelliJ idea 14.1.4, install the Scala plugin for idea, then import the Spark project



4. Compiling spark in Idea
If you encounter errors as shown in compiling:

Click "Generate Sources and Update Folders for all Projects" in the Maven window to resolve this issue

You may encounter the "Unable to import maven Project:see for details" error during the "Generate Sources and Update Folders for all Projects" procedure; Click Help-->show Log in Exploere to view the error log information as follows:
2015-08-29 22:59:08,909 [105808] warn-#org. Jetbrains.idea.maven-embedder class Org.jetbrains.idea.maven.projec T.mavenembeddersmanager.for_folders_resolve is already used 2015-08-29 22:59:08,916 [105815] Warn-ution.rmi.remotepro Cesssupport-exception in Thread "RMI TCP Connection (idle)" Java.lang.OutOfMemoryError:PermGen space 2015-08-29 22:59:08 , 923 [105822] warn-ution.rmi.remoteprocesssupport-exception in thread "RMI TCP Connection (idle)" Java.lang.OutOfMem Oryerror:permgen space 2015-08-29 22:59:08,923 [105822] error-#org. Jetbrains.idea.maven-cannot Reconnect. Java.lang.RuntimeException:Cannot reconnect.at Org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform ( remoteobjectwrapper.java:82) at Org.jetbrains.idea.maven.server.MavenEmbedderWrapper.customizeForResolve ( mavenembedderwrapper.java:64) at Org.jetbrains.idea.maven.project.MavenProjectsTree.executeWithEmbedder ( mavenprojectstree.java:1366) at Org.jetbrains.idea.maven.project.MavenProjectsTrEe.resolvefolders (mavenprojectstree.java:1312) at Org.jetbrains.idea.maven.project.MavenProjectsProcessorFoldersResolvingTask.perform ( MAVENPROJECTSPROCESSORFOLDERSRESOLVINGTASK.JAVA:39) at Org.jetbrains.idea.maven.project.MavenProjectsProcessor.doProcessPendingTasks (mavenprojectsprocessor.java:134) At org.jetbrains.idea.maven.project.mavenprojectsprocessor.access$100 (mavenprojectsprocessor.java:30) at Org.jetbrains.idea.maven.project.mavenprojectsprocessor$2.run (mavenprojectsprocessor.java:109) at Org.jetbrains.idea.maven.utils.mavenutil$6.run (mavenutil.java:441) at Com.intellij.openapi.application.impl.applicationimpl$8.run (applicationimpl.java:400) at Java.util.concurrent.executors$runnableadapter.call (executors.java:471) at Java.util.concurrent.FutureTask.run ( futuretask.java:262) at Java.util.concurrent.ThreadPoolExecutor.runWorker (threadpoolexecutor.java:1145) at Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:615) at Java.lang.Thread.run ( thread.java:745) at Org.jetbRains.ide.pooledthreadexecutor$1$1.run (pooledthreadexecutor.java:56) caused by:java.rmi.UnmarshalException:Error Unmarshaling return; Nested exception Is:java.io.EOFExceptionat Sun.rmi.transport.StreamRemoteCall.executeCall (Streamremotecall.java : 246) at Sun.rmi.server.UnicastRef.invoke (unicastref.java:161) at Java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod (remoteobjectinvocationhandler.java:194) at Java.rmi.server.RemoteObjectInvocationHandler.invoke (remoteobjectinvocationhandler.java:148) at com.sun.proxy.$ Proxy91.set (Unknown source) at Sun.reflect.GeneratedMethodAccessor124.invoke (Unknown source) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43) at Java.lang.reflect.Method.invoke (method.java:606) at Com.intellij.execution.rmi.RemoteUtil.invokeRemote ( remoteutil.java:124) at com.intellij.execution.rmi.remoteutil.access$100 (remoteutil.java:36) at Com.intellij.execution.rmi.remoteutil$2$1$1.compute (remoteutil.java:105) at Com.intellij.executIon.rmi.RemoteUtil.executeWithClassLoader (remoteutil.java:181) at com.intellij.execution.rmi.remoteutil$2$1. Invoke (remoteutil.java:102) at Com.sun.proxy. $Proxy 91.set (Unknown Source) at Org.jetbrains.idea.maven.server.MavenServerManager.create (mavenservermanager.java:175) at Org.jetbrains.idea.maven.server.MavenServerManager.create (mavenservermanager.java:71) at Org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee (remoteobjectwrapper.java:41) at Org.jetbrains.idea.maven.server.mavenservermanager$5.create (mavenservermanager.java:481) at Org.jetbrains.idea.maven.server.mavenservermanager$5.create (mavenservermanager.java:469) at Org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee (remoteobjectwrapper.java:41) at Org.jetbrains.idea.maven.server.MavenEmbedderWrapper.doCustomize (mavenembedderwrapper.java:87) at org.jetbrains.idea.maven.server.mavenembedderwrapper.access$000 (mavenembedderwrapper.java:36) at Org.jetbrains.idea.maven.server.mavenembedderwrapper$2.execute(mavenembedderwrapper.java:67) at Org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform ( remoteobjectwrapper.java:76) ... morecaused By:java.io.EOFExceptionat Java.io.objectinputstream$blockdatainputstream.peekbyte ( objectinputstream.java:2598) at Java.io.ObjectInputStream.readObject0 (objectinputstream.java:1318) at Java.io.ObjectInputStream.defaultReadFields (objectinputstream.java:1990) at Java.io.ObjectInputStream.readSerialData (objectinputstream.java:1915) at Java.io.ObjectInputStream.readOrdinaryObject (objectinputstream.java:1798) at Java.io.ObjectInputStream.readObject0 (objectinputstream.java:1350) at Java.io.ObjectInputStream.readObject ( objectinputstream.java:370) at Sun.rmi.transport.StreamRemoteCall.executeCall (streamremotecall.java:244) ... More2015-08-29 22:59:08,924 [105823] error-#org. Jetbrains.idea.maven-intellij idea 14.1.4 Build #IU-141.153 2.4 2015-08-29 22:59:08,924 [105823] error-#org. jetbrains.idea.maven-jdk:1.7.0_80 2015-08-29 22:59:08,924 [105823] error-#org. Jetbrains.idea.maven-vm:java HotSpot (TM) 64-bit Server VM 2015-08-29 22:59:08,924 [105823] error-#org. jetbrains.idea.maven-vendor:oracle Corporation 2015-08-29 22:59:08,924 [105823] error-#org. Jetbrains.idea.maven-os:windows 8 2015-08-29 22:59:08,925 [105824] error-#org. Jetbrains.idea.maven-last Acti  On:Maven.UpdateFolders

this should be the cause of the GFW, change the time period or use the agent can be


5. Run Master in the IDE: Run the class Org.apache.spark.deploy.master.Master directly, if the error is reported as shown

Modify the Pom.xml under the project root path to change the guava version range from provided to compile
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>14.0.1</version>
<scope>compile</scope>
</dependency>
When running successfully, the console output is as follows:


6. Run worker in the IDE: Run the class Org.apache.spark.deploy.worker.Worker and specify the parameter--webui-port 8081 spark://192.168.63.1:7077



Build spark source reading environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.