概述
22/11/17 13:50:43 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicable
Using Spark’s default log4j profile: org/apache/spark/log4j-defaults.properties
Setting default log level to “WARN”.
To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 WARN Utils: Service ‘sparkDriver’ could not bind on a random free port. You may check whether configuring an appropriate binding address.
22/11/17 13:50:50 ERROR SparkContext: Error initializing SparkContext.
java.net.BindException: Cannot assign requested address: 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:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134)
at io.netty.channel.AbstractChannel
A
b
s
t
r
a
c
t
U
n
s
a
f
e
.
b
i
n
d
(
A
b
s
t
r
a
c
t
C
h
a
n
n
e
l
.
j
a
v
a
:
550
)
a
t
i
o
.
n
e
t
t
y
.
c
h
a
n
n
e
l
.
D
e
f
a
u
l
t
C
h
a
n
n
e
l
P
i
p
e
l
i
n
e
AbstractUnsafe.bind(AbstractChannel.java:550) at io.netty.channel.DefaultChannelPipeline
AbstractUnsafe.bind(AbstractChannel.java:550)atio.netty.channel.DefaultChannelPipelineHeadContext.bind(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491)
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973)
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:248)
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
at io.netty.channel.nio.NioEventLoop.run(NioEventLo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
u
n
.
n
i
o
.
c
h
.
N
e
t
.
b
i
n
d
0
(
N
a
t
i
v
e
M
e
t
h
o
d
)
a
t
s
u
n
.
n
i
o
.
c
h
.
N
e
t
.
b
i
n
d
(
N
e
t
.
j
a
v
a
:
433
)
a
t
s
u
n
.
n
i
o
.
c
h
.
N
e
t
.
b
i
n
d
(
N
e
t
.
j
a
v
a
:
425
)
a
t
s
u
n
.
n
i
o
.
c
h
.
S
e
r
v
e
r
S
o
c
k
e
t
C
h
a
n
n
e
l
I
m
p
l
.
b
i
n
d
(
S
e
r
v
e
r
S
o
c
k
e
t
C
h
a
n
n
e
l
I
m
p
l
.
j
a
v
a
:
223
)
a
t
i
o
.
n
e
t
t
y
.
c
h
a
n
n
e
l
.
s
o
c
k
e
t
.
n
i
o
.
N
i
o
S
e
r
v
e
r
S
o
c
k
e
t
C
h
a
n
n
e
l
.
d
o
B
i
n
d
(
N
i
o
S
e
r
v
e
r
S
o
c
k
e
t
C
h
a
n
n
e
l
.
j
a
v
a
:
134
)
a
t
i
o
.
n
e
t
t
y
.
c
h
a
n
n
e
l
.
A
b
s
t
r
a
c
t
C
h
a
n
n
e
l
2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748) 22/11/17 13:50:50 ERROR Main: Failed to initialize Spark session. java.net.BindException: Cannot assign requested address: 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:433) at sun.nio.ch.Net.bind(Net.java:425) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134) at io.netty.channel.AbstractChannel
2.run(ThreadExecutorMap.java:74)atio.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)atjava.lang.Thread.run(Thread.java:748)22/11/1713:50:50ERRORMain:FailedtoinitializeSparksession.java.net.BindException:Cannotassignrequestedaddress:Service′sparkDriver′failedafter16retries(onarandomfreeport)!Considerexplicitlysettingtheappropriatebindingaddressfortheservice′sparkDriver′(forexamplespark.driver.bindAddressforSparkDriver)tothecorrectbindingaddress.atsun.nio.ch.Net.bind0(NativeMethod)atsun.nio.ch.Net.bind(Net.java:433)atsun.nio.ch.Net.bind(Net.java:425)atsun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)atio.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134)atio.netty.channel.AbstractChannelAbstractUnsafe.bind(AbstractChannel.java:550)
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491)
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973)
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:248)
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
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)
使用Ubuntu虚拟机启动spark失败。
但是我明明上次成功了啊,spark还能自己坏掉不成吗?
看看报错大概就是没有正确绑定地址。
不卖关子了,就是hosts文件绑定的ip地址和你当前的ip地址是不对的。
修改一下就好了
ifconfig
查看当前ip地址
sudo vim /etc/hosts
输入密码
按i允许编辑,然后将绑定的ip地址修改为当前的ip
ESC
:wq
即可。
spark-shell
尝试即可成功启动。
最后
以上就是高兴朋友为你收集整理的ERROR SparkContext: Error initializing SparkContext. java.net.BindException: Cannot assign requested的全部内容,希望文章能够帮你解决ERROR SparkContext: Error initializing SparkContext. java.net.BindException: Cannot assign requested所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复