java.net.BindException: 无法指定被请求的地址: Service 'sparkDriver' failed after 16 retries!

在Centos7 中 使用 Intellij IDEA 来 Spark 本地模式启动时,报错:

java.net.BindException: 无法指定被请求的地址: Service 'sparkDriver' failed after 16 retries!
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 WARN Utils: Service ‘sparkDriver’ could not bind on port 0. Attempting port 1. 
16/06/27 19:36:34 ERROR SparkContext: Error initializing SparkContext. 
Java.NET.BindException: 无法指定被请求的地址: Service ‘sparkDriver’ failed after 16 retries!

这是因为我的客户端电脑IP改变了,改过来之后就好了。

例如:

val sparkConf = new SparkConf()
  .setAppName(jobName)
  .set("spark.driver.host", "localhost")
  .setMaster("local[4]")
25/06/05 15:43:33 ERROR SparkContext: Error initializing SparkContext. java.net.BindException: Cannot assign requested address: bind: Service 'sparkDriver' failed after 16 retries (on a random free port)! Consider explicitly setting the appropriate binding address for the service 'sparkDriver' (for example spark.driver.bindAddress for SparkDriver) to the correct binding 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:225) at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:141) at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:562) at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334) at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:600) at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:579) at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973) at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:260) at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356) at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748) 25/06/05 15:43:33 INFO SparkContext: SparkContext is stopping with exitCode 0. 25/06/05 15:43:33 INFO SparkContext: Successfully stopped SparkContext Exception in thread "main" java.net.BindException: Cannot assign requested address: bind: Service 'sparkDriver' failed after 16 retries (on a random free port)! Consider explicitly setting the appropriate binding address for the service 'sparkDriver' (for example spark.driver.bindAddress for SparkDriver) to the correct binding 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:225) at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:141) at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:562) at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334) at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:600) at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:579) at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973) at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:260) at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356) at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748)
最新发布
06-07
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值