ERROR SparkContext:无法指定请求的地址: bind: Service 'sparkDriver' failed after 16 retries!


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")

 

你可能感兴趣的:(大数据spark)