Spark WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.

Posted go-no-1

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Spark WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.相关的知识,希望对你有一定的参考价值。

问题

执行 spark-submit --master local模式时产生warn并达重试数限制失败,导致spark local不能启动:

...

WARN Utils: Service ‘sparkDriver‘ could not bind on port 0. Attempting port 1.

...


原因及解决

估计是机器环境变量问题,可尝试设置

export SPARK_LOCAL_IP="127.0.0.1"
export SPARK_LOCAL_IP="${hostname_ip}"

 

如还不行启动时直接配置driver host:

 

 --conf spark.driver.host=‘127.0.0.1‘

本次使用配置 driver host 解决


参考

https://stackoverflow.com/questions/34601554/mac-spark-shell-error-initializing-sparkcontext

spark-submit配置说明

以上是关于Spark WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.的主要内容,如果未能解决你的问题,请参考以下文章