大数据时代--windows下spark的安装与配置教程(转)

作为一个大数据的小白(Hadoop / Spark / .....)花了两天时间在自己的Win10电脑上安装本地的Spark环境,但是报了很多错,如下图

è¿éåå¾çæè¿°

è¿éåå¾çæè¿°

这样的错误??(借用一下网友的错误,我的错误在修改过程中懒得还原了,总之你们遇到的错误和没遇到的错误我都遇到了,笑/cry)

D:\hadoop-2.6.0\bin>spark-shell
log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Using Spark's repl log4j profile: org/apache/spark/log4j-defaults-repl.properties
To adjust logging level use sc.setLogLevel("INFO")
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /___/ .__/\_,_/_/ /_/\_\   version 1.6.0
      /_/

Using Scala version 2.10.5 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_91)
Type in expressions to have them evaluated.
Type :help for more information.
Spark context available as sc.
17/05/17 06:03:01 WARN General: Plugin (Bundle) "org.datanucleus.store.rdbms" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/D:/spark-1.6.0-bin-hadoop2.6/lib/datanucleus-rdbms-3.2.9.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/D:/spark-1.6.0-bin-hadoop2.6/bin/../lib/datanucleus-rdbms-3.2.9.jar."
17/05/17 06:03:01 WARN General: Plugin (Bundle) "org.datanucleus.api.jdo" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/D:/spark-1.6.0-bin-hadoop2.6/lib/datanucleus-api-jdo-3.2.6.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/D:/spark-1.6.0-bin-hadoop2.6/bin/../lib/datanucleus-api-jdo-3.2.6.jar."
17/05/17 06:03:01 WARN General: Plugin (Bundle) "org.datanucleus" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/D:/spark-1.6.0-bin-hadoop2.6/bin/../lib/datanucleus-core-3.2.10.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/D:/spark-1.6.0-bin-hadoop2.6/lib/datanucleus-core-3.2.10.jar."
17/05/17 06:03:01 WARN Connection: BoneCP specified but not present in CLASSPATH (or one of dependencies)
17/05/17 06:03:02 WARN Connection: BoneCP specified but not present in CLASSPATH (or one of dependencies)
17/05/17 06:03:09 WARN ObjectStore: Version information not found in metastore. hive.metastore.schema.verification is not enabled so recording the schema version 1.2.0
17/05/17 06:03:10 WARN ObjectStore: Failed to get database default, returning NoSuchObjectException
java.lang.RuntimeException: java.lang.NullPointerException
        at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:522)
        at org.apache.spark.sql.hive.client.ClientWrapper.(ClientWrapper.scala:194)
        at org.apache.spark.sql.hive.client.IsolatedClientLoader.createClient(IsolatedClientLoader.scala:238)
        at org.apache.spark.sql.hive.HiveContext.executionHive$lzycompute(HiveContext.scala:218)
        at org.apache.spark.sql.hive.HiveContext.executionHive(HiveContext.scala:208)
        at org.apache.spark.sql.hive.HiveContext.functionRegistry$lzycompute(HiveContext.scala:462)
        at org.apache.spark.sql.hive.HiveContext.functionRegistry(HiveContext.scala:461)
        at org.apache.spark.sql.UDFRegistration.(UDFRegistration.scala:40)
        at org.apache.spark.sql.SQLContext.(SQLContext.scala:330)
        at org.apache.spark.sql.hive.HiveContext.(HiveContext.scala:90)
        at org.apache.spark.sql.hive.HiveContext.(HiveContext.scala:101)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.apache.spark.repl.SparkILoop.createSQLContext(SparkILoop.scala:1028)
        at $iwC$$iwC.(:15)
        at $iwC.(:24)
        at (:26)
        at .(:30)
        at .()
        at .(:7)
        at .()
        at $print()
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.spark.repl.SparkIMain$ReadEvalPrint.call(SparkIMain.scala:1065)
        at org.apache.spark.repl.SparkIMain$Request.loadAndRun(SparkIMain.scala:1346)
        at org.apache.spark.repl.SparkIMain.loadAndRunReq$1(SparkIMain.scala:840)
        at org.apache.spark.repl.SparkIMain.interpret(SparkIMain.scala:871)
        at org.apache.spark.repl.SparkIMain.interpret(SparkIMain.scala:819)
        at org.apache.spark.repl.SparkILoop.reallyInterpret$1(SparkILoop.scala:857)
        at org.apache.spark.repl.SparkILoop.interpretStartingWith(SparkILoop.scala:902)
        at org.apache.spark.repl.SparkILoop.command(SparkILoop.scala:814)
        at org.apache.spark.repl.SparkILoopInit$$anonfun$initializeSpark$1.apply(SparkILoopInit.scala:132)
        at org.apache.spark.repl.SparkILoopInit$$anonfun$initializeSpark$1.apply(SparkILoopInit.scala:124)
        at org.apache.spark.repl.SparkIMain.beQuietDuring(SparkIMain.scala:324)
        at org.apache.spark.repl.SparkILoopInit$class.initializeSpark(SparkILoopInit.scala:124)
        at org.apache.spark.repl.SparkILoop.initializeSpark(SparkILoop.scala:64)
        at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1$$anonfun$apply$mcZ$sp$5.apply$mcV$sp(SparkILoop.scala:974)
        at org.apache.spark.repl.SparkILoopInit$class.runThunks(SparkILoopInit.scala:159)
        at org.apache.spark.repl.SparkILoop.runThunks(SparkILoop.scala:64)
        at org.apache.spark.repl.SparkILoopInit$class.postInitialization(SparkILoopInit.scala:108)
        at org.apache.spark.repl.SparkILoop.postInitialization(SparkILoop.scala:64)
        at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1.apply$mcZ$sp(SparkILoop.scala:991)
        at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1.apply(SparkILoop.scala:945)
        at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1.apply(SparkILoop.scala:945)
        at scala.tools.nsc.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:135)
        at org.apache.spark.repl.SparkILoop.org$apache$spark$repl$SparkILoop$$process(SparkILoop.scala:945)
        at org.apache.spark.repl.SparkILoop.process(SparkILoop.scala:1059)
        at org.apache.spark.repl.Main$.main(Main.scala:31)
        at org.apache.spark.repl.Main.main(Main.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:731)
        at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:181)
        at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:206)
        at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121)
        at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Caused by: java.lang.NullPointerException
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1012)
        at org.apache.hadoop.util.Shell.runCommand(Shell.java:482)
        at org.apache.hadoop.util.Shell.run(Shell.java:455)
        at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:715)
        at org.apache.hadoop.util.Shell.execCommand(Shell.java:808)
        at org.apache.hadoop.util.Shell.execCommand(Shell.java:791)
        at org.apache.hadoop.fs.FileUtil.execCommand(FileUtil.java:1097)
        at org.apache.hadoop.fs.RawLocalFileSystem$DeprecatedRawLocalFileStatus.loadPermissionInfo(RawLocalFileSystem.java:582)
        at org.apache.hadoop.fs.RawLocalFileSystem$DeprecatedRawLocalFileStatus.getPermission(RawLocalFileSystem.java:557)
        at org.apache.hadoop.hive.ql.session.SessionState.createRootHDFSDir(SessionState.java:599)
        at org.apache.hadoop.hive.ql.session.SessionState.createSessionDirs(SessionState.java:554)
        at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:508)
        ... 62 more

:16: error: not found: value sqlContext
         import sqlContext.implicits._
                ^
:16: error: not found: value sqlContext
         import sqlContext.sql
--------------------- 
作者:lyric_木凡 
来源:CSDN 
原文:https://blog.csdn.net/u012942818/article/details/72356104 
版权声明:本文为博主原创文章,转载请附上博文链接!

总之有很多错误,先来说明一下安装Spark需要哪些支持:

  • jdk配置;---java的Scala是基于JVM运行的得支持
  • scala安装与配置;---Spark 是基于Scala开发的得支持
  • spark安装与配置;---Spark得支持(就是安装这个的)
  • hadoop安装与配置;---Spark是基于Hadoop环境的得支持 ----- 好了就这么多

具体的安装过程我就不废话了,大神写的比我好大家可以参考这两位位大哥的文章https://blog.csdn.net/songhaifengshuaige/article/details/79480491,写的非常详细https://blog.csdn.net/nxw_tsp/article/details/78281533,我也是从这两篇文章中获益匪浅,帮我省去了很多时间,网上也有很多文章是关于Spark安装的总觉的还不够详细,以至于我,唉~算了一把辛酸泪啊.

总之,若是你安装完了之后发现都是对的Spark也都正常启动了

大数据时代--windows下spark的安装与配置教程(转)_第1张图片

 

但是还是有一堆奇怪的WARN,如下

19/01/22 22:54:23 WARN General: Plugin (Bundle) "org.datanucleus.store.rdbms" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/C:/PROGRA~1/spark-1.6.3-bin-hadoop2.6/bin/../lib/datanucleus-rdbms-3.2.9.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/C:/Program%20Files/spark-1.6.3-bin-hadoop2.6/lib/datanucleus-rdbms-3.2.9.jar."
19/01/22 22:54:23 WARN General: Plugin (Bundle) "org.datanucleus.api.jdo" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/C:/Program%20Files/spark-1.6.3-bin-hadoop2.6/lib/datanucleus-api-jdo-3.2.6.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/C:/PROGRA~1/spark-1.6.3-bin-hadoop2.6/bin/../lib/datanucleus-api-jdo-3.2.6.jar."
19/01/22 22:54:23 WARN General: Plugin (Bundle) "org.datanucleus" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/C:/Program%20Files/spark-1.6.3-bin-hadoop2.6/lib/datanucleus-core-3.2.10.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/C:/PROGRA~1/spark-1.6.3-bin-hadoop2.6/bin/../lib/datanucleus-core-3.2.10.jar."
19/01/22 22:54:23 WARN Connection: BoneCP specified but not present in CLASSPATH (or one of dependencies)
19/01/22 22:54:23 WARN Connection: BoneCP specified but not present in CLASSPATH (or one of dependencies)
19/01/22 22:54:42 WARN ObjectStore: Version information not found in metastore. hive.metastore.schema.verification is not enabled so recording the schema version 1.2.0
19/01/22 22:54:43 WARN ObjectStore: Failed to get database default, returning NoSuchObjectException
19/01/22 22:54:47 WARN General: Plugin (Bundle) "org.datanucleus.store.rdbms" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/C:/PROGRA~1/spark-1.6.3-bin-hadoop2.6/bin/../lib/datanucleus-rdbms-3.2.9.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/C:/Program%20Files/spark-1.6.3-bin-hadoop2.6/lib/datanucleus-rdbms-3.2.9.jar."
19/01/22 22:54:47 WARN General: Plugin (Bundle) "org.datanucleus.api.jdo" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/C:/Program%20Files/spark-1.6.3-bin-hadoop2.6/lib/datanucleus-api-jdo-3.2.6.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/C:/PROGRA~1/spark-1.6.3-bin-hadoop2.6/bin/../lib/datanucleus-api-jdo-3.2.6.jar."
19/01/22 22:54:47 WARN General: Plugin (Bundle) "org.datanucleus" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/C:/Program%20Files/spark-1.6.3-bin-hadoop2.6/lib/datanucleus-core-3.2.10.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/C:/PROGRA~1/spark-1.6.3-bin-hadoop2.6/bin/../lib/datanucleus-core-3.2.10.jar."
19/01/22 22:54:47 WARN Connection: BoneCP specified but not present in CLASSPATH (or one of dependencies)
19/01/22 22:54:48 WARN Connection: BoneCP specified but not present in CLASSPATH (or one of dependencies)
19/01/22 22:54:59 WARN ObjectStore: Version information not found in metastore. hive.metastore.schema.verification is not enabled so recording the schema version 1.2.0
19/01/22 22:54:59 WARN ObjectStore: Failed to get database default, returning NoSuchObjectException

甭管他,没事儿,只是在引入的JAR包出现了一些重复,这个不影响使用.

笔记~~~

你可能感兴趣的:(大数据学习)