安装Spark,针对右侧hadoop版本构建,获取无法分配请求的地址错误

时间:2013-07-11 18:51:27

标签: apache-spark

当我尝试运行Spark shell时,这就是我得到的

org.jboss.netty.channel.ChannelException: Failed to bind to: /10.9.247.151:0
    at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:298)
    at akka.remote.netty.NettyRemoteServer.start(Server.scala:53)
    at akka.remote.netty.NettyRemoteTransport.start(NettyRemoteSupport.scala:89)
    at akka.remote.RemoteActorRefProvider.init(RemoteActorRefProvider.scala:94)
    at akka.actor.ActorSystemImpl._start(ActorSystem.scala:588)
    at akka.actor.ActorSystemImpl.start(ActorSystem.scala:595)
    at akka.actor.ActorSystem$.apply(ActorSystem.scala:111)
    at spark.util.AkkaUtils$.createActorSystem(AkkaUtils.scala:51)
    at spark.SparkEnv$.createFromSystemProperties(SparkEnv.scala:67)
    at spark.SparkContext.<init>(SparkContext.scala:79)
    at spark.repl.SparkILoop.createSparkContext(SparkILoop.scala:841)
    at <init>(<console>:10)
    at <init>(<console>:22)
    at <init>(<console>:24)
    at .<init>(<console>:28)
    at .<clinit>(<console>)
    at .<init>(<console>:7)
    at .<clinit>(<console>)
    at $export(<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 spark.repl.SparkIMain$ReadEvalPrint.call(SparkIMain.scala:629)
    at spark.repl.SparkIMain$Request$$anonfun$10.apply(SparkIMain.scala:890)
    at scala.tools.nsc.interpreter.Line$$anonfun$1.apply$mcV$sp(Line.scala:43)
    at scala.tools.nsc.io.package$$anon$2.run(package.scala:25)
    at java.lang.Thread.run(Thread.java:724)
Caused by: java.net.BindException: Cannot assign requested address
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:444)
    at sun.nio.ch.Net.bind(Net.java:436)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.bind(NioServerSocketPipelineSink.java:138)
    at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleServerSocket(NioServerSocketPipelineSink.java:90)
    at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:64)
    at org.jboss.netty.channel.Channels.bind(Channels.java:569)
    at org.jboss.netty.channel.AbstractChannel.bind(AbstractChannel.java:187)
    at org.jboss.netty.bootstrap.ServerBootstrap$Binder.channelOpen(ServerBootstrap.java:343)
    at org.jboss.netty.channel.Channels.fireChannelOpen(Channels.java:170)
    at org.jboss.netty.channel.socket.nio.NioServerSocketChannel.<init>(NioServerSocketChannel.java:80)
    at org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory.newChannel(NioServerSocketChannelFactory.java:158)
    at org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory.newChannel(NioServerSocketChannelFactory.java:86)
    at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:277)
    ... 27 more

仅供参考,它说无法绑定的IP地址是hadoop上主机的IP(与我运行此机器的机器不同)。我正在使用Hadoop和Scala的正确版本,我不确定我做错了什么。任何帮助都会有所帮助! :)

2 个答案:

答案 0 :(得分:1)

Spark会尝试解析您的主机名,然后绑定到已解析的IP地址。在您的设置中,此IP地址不可用(错误的DNS /网卡设置)。 尝试修改您的/etc/hosts(或C:\windows\system32\drivers\etc\hosts记录并添加一行:<your ip address> <your hostname>

答案 1 :(得分:1)

您可以通过设置环境变量SPARK_LOCAL_IP ='some ip-address'来更改本地IP地址spark绑定。我有类似的问题。