18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
18/10/25 13:07:58 ERROR SparkContext: Error initializing SparkContext.
java.net.BindException: Cannot assign requested address: bind: 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.

1、首先查看hosts文件里面,是否有192.168....网段的IP,有的话取消掉,(我的是这样就可以了)/

如果不行的 2、需要手工添加一个环境设置:

val conf=new SparkConf()

.set("spark.driver.host","localhost")

.setMaster("local").setName("jobName")
 

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐