已安装 Spark,针对正确的 hadoop 版本构建,无法分配请求的地址错误
Posted
技术标签:
【中文标题】已安装 Spark,针对正确的 hadoop 版本构建,无法分配请求的地址错误【英文标题】:Installed Spark, built against right hadoop version , getting cannot assigned requested address error 【发布时间】:2013-07-10 04:22:51 【问题描述】:当我尝试运行 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,但不确定我做错了什么。任何帮助都会有所帮助! :)
【问题讨论】:
【参考方案1】:Spark 尝试解析您的主机名,然后绑定到解析的 IP 地址。在您的设置中,此 IP 地址不可用(错误的 DNS/网卡设置)。
尝试编辑您的/etc/hosts
(或C:\windows\system32\drivers\etc\hosts
记录并添加一行:<your ip address> <your hostname>
【讨论】:
它仍然绑定到 10.9.247.151? 是的,不知道为什么。 @nekto0n host $(hostname) 声称自己的 IP 是什么?【参考方案2】:您可以通过设置环境变量 SPARK_LOCAL_IP='some ip-address' 来更改 spark 绑定到的本地 IP 地址。我遇到了类似的问题。
【讨论】:
帮我将本地 IP 设置为主机的 IP。没有尝试将其设置为 127.0.0.1以上是关于已安装 Spark,针对正确的 hadoop 版本构建,无法分配请求的地址错误的主要内容,如果未能解决你的问题,请参考以下文章