spark报错:WARN util.Utils: Service 'SparkUI' could not bind on port 4040. Attempting port 4041.4042等错误

spark报错:warn util.utils::service 'sparkUI' can not bind on part 4040.Attempting port 4041. 4042等错误

网上说的原因如下:

问题1 spark-shell里面又单独的设置了spark的context,因为spark-shell里已经有一个context对象了,所以你新建创建的数据无法使用
问题2 主要就是数据库的端囗都已经被占满了,而且无法释放? 但是我发现哪里有数据库的事
最后解决方法如下:

lsof -i:4041

lsof -i:4042

依次查看 直接kill -9  进程ID

最后在启动spark-shell 问题解决了

原文地址:https://www.cnblogs.com/angelasp/p/13274455.html