Linux 下运行spark local bind on port 0. Attempting port 1 问题
2016-11-01 16:04:56 [org.apache.spark.util.Utils]-[WARN] - Service ‘sparkDriver‘ could not bind on port 0. Attempting port 1.
2016-11-01 16:04:56 [org.apache.spark.SparkContext]-[ERROR] - Error initializing SparkContext.
java.net.BindException: Can‘t assign requested address: Service ‘sparkDriver‘ failed after 16 retries! Consider explicitly setting the appropriate port for the service ‘sparkDriver‘ (for example spark.ui.port for SparkUI) to an available port or increasing spark.port.maxRetries.
原因是找不到主机对应的ip地址,而不是端口绑定不正确引起的。
在hosts中加入如下代码
127.0.0.1 hostname
这里的用户名根据实际情况来写,这样,spark local 就能找到本地对应的ip了,启动成功
本文出自 “去买大白兔” 博客,转载请与作者联系!
Spark bind on port 0. Attempting port 1 问题解决
原文地址:http://xk0230.blog.51cto.com/11859350/1927704