복붙노트

[HADOOP] "./bin/spark-shell"우분투 14.04에서 Hazard 2.6+이 설치된 Spark 1.6의 사전 빌드 된 버전으로 작업하지 않습니다.

HADOOP

"./bin/spark-shell"우분투 14.04에서 Hazard 2.6+이 설치된 Spark 1.6의 사전 빌드 된 버전으로 작업하지 않습니다.

Ubuntu 14.04에서 Spark 1.6의 사전 빌드 된 버전을 Hadoop 2.6 이상과 함께 데스크탑에 다운로드했습니다.

나는 불꽃 껍질에 항해하고 아래 주어진 링크에 따라 불꽃을 시작했다. 빠른 시작 스파크 링크 사용

./bin/spark-shell

다음과 같은 오류가 나타납니다. Mac OSX에 대한 비슷한 질문을 보았습니다.

ashwin@Console:~/Desktop/spark-1.6.0-bin-hadoop2.6$ ./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 (OpenJDK 64-Bit Server VM, Java 1.7.0_91)
Type in expressions to have them evaluated.
Type :help for more information.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
16/01/05 12:36:25 ERROR SparkContext: Error initializing SparkContext.
java.net.BindException: Cannot assign requested address: Service 'sparkDriver' failed after 16 retries!
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:463)
    at sun.nio.ch.Net.bind(Net.java:455)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:125)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:485)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1089)
    at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:430)
    at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:415)
    at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:903)
    at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:198)
    at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:348)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:357)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
    at java.lang.Thread.run(Thread.java:745)
java.net.BindException: Cannot assign requested address: Service 'sparkDriver' failed after 16 retries!
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:463)
    at sun.nio.ch.Net.bind(Net.java:455)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:125)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:485)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1089)
    at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:430)
    at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:415)
    at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:903)
    at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:198)
    at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:348)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:357)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
    at java.lang.Thread.run(Thread.java:745)

java.lang.NullPointerException
    at org.apache.spark.sql.SQLContext$.createListenerAndUI(SQLContext.scala:1367)
    at org.apache.spark.sql.hive.HiveContext.<init>(HiveContext.scala:101)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.apache.spark.repl.SparkILoop.createSQLContext(SparkILoop.scala:1028)
    at $iwC$$iwC.<init>(<console>:15)
    at $iwC.<init>(<console>:24)
    at <init>(<console>:26)
    at .<init>(<console>:30)
    at .<clinit>(<console>)
    at .<init>(<console>:7)
    at .<clinit>(<console>)
    at $print(<console>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    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:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    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)

<console>:16: error: not found: value sqlContext
         import sqlContext.implicits._
                ^
<console>:16: error: not found: value sqlContext
         import sqlContext.sql
                ^

어떤 도움?

해결법

  1. ==============================

    1.클러스터를 시작할 때 마스터가 예외로 시작하지 않는 것과 비슷한 문제가 발생했습니다.

    클러스터를 시작할 때 마스터가 예외로 시작하지 않는 것과 비슷한 문제가 발생했습니다.

    이 문제를 해결하기 위해 $ SPARK_HOME / conf / spark-env.sh 파일에서 설정 한 속성을 변경했습니다.

    이전에는 'SPARK_MASTER_IP'를 내 마스터 노드의 IP 주소로 설정했습니다. 상자의 공용 DNS로 변경하면 문제가 해결 된 것으로 보입니다.

  2. ==============================

    2.문제의 가능한 원인은 잘못된 IP 주소에 바인딩하려고한다는 것입니다. $ SPARK_HOME / conf / spark-env.sh에는 $ SPARK_LOCAL_IP라는 변수가 있습니다. 그것이 설정되어 있다면, 그것이 실제로 기계를 대표하고 있는지, 당신이 스파크 껍질을 사용하고 있는지, 또는 주석을 달아보십시오. 그렇지 않으면 설정되지 않은 경우 127.0.0.1과 같이 설정할 수 있습니다.

    문제의 가능한 원인은 잘못된 IP 주소에 바인딩하려고한다는 것입니다. $ SPARK_HOME / conf / spark-env.sh에는 $ SPARK_LOCAL_IP라는 변수가 있습니다. 그것이 설정되어 있다면, 그것이 실제로 기계를 대표하고 있는지, 당신이 스파크 껍질을 사용하고 있는지, 또는 주석을 달아보십시오. 그렇지 않으면 설정되지 않은 경우 127.0.0.1과 같이 설정할 수 있습니다.

  3. from https://stackoverflow.com/questions/34620983/bin-spark-shell-not-working-with-pre-built-version-of-spark-1-6-with-hadoo by cc-by-sa and MIT license