1.直接运行本地模式,显示未知服务,那么很可能就是/etc/hosts文件中的主机名和IP地址没配或者配置错误
2.如果本地模式出现ERROR SparkContext: Error initializing SparkContext.
java.net.BindException: 无法指定被请求的地址: Service ‘sparkDriver’ failed after 16 retries (starting from 0)! 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.
解决办法在spark-env.sh文件中加上
export SPARK_MASTER_IP=127.0.0.1
export SPARK_LOCAL_IP=127.0.0.1