问题
执行 spark-submit --master local模式时产生warn并达重试数限制失败,导致spark local不能启动:
...
WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
...
原因及解决
估计是机器环境变量问题,可尝试设置
export SPARK_LOCAL_IP="127.0.0.1"
export SPARK_LOCAL_IP="${hostname_ip}"
如还不行启动时直接配置driver host:
--conf spark.driver.host='127.0.0.1'
本次使用配置 driver host 解决
参考
https://stackoverflow.com/questions/34601554/mac-spark-shell-error-initializing-sparkcontext