ERROR SparkContext: Error initializing SparkContext.
java.net.BindException: Cannot assign requested address: Service 'sparkDriver' failed after 16 retries
(on a random free port)! Consider explicitly setting the appropriate binding address
for the service 'sparkDriver' (for example spark.driver.bindAddress for SparkDriver) to the correct binding address.
ERROR SparkContext: Error initializing SparkContext.
java.net.BindException: Cannot assign requested address: Service 'sparkDriver' failed after 16 retries(on a random free port)! Consider explicitly setting the appropriate binding address
for the service 'sparkDriver' (for example spark.driver.bindAddress for SparkDriver) to the correct binding address.
原因
就是hosts文件绑定的ip地址和你当前的ip地址是不对的。
出现这个问题,一般是虚拟机上,没有固定IP, 每次电脑重启的时候, IP就变了。
解决方法
查看本机ip
ifconfig
修改绑定的ip
sudo vim /etc/hosts