更新时间:2023-10-12 08:26:40
有几种不同的解决方案
获取您的主机名
Get your hostname
$ hostname
然后尝试分配您的主机名
then try to assign your host name
$ sudo hostname -s 127.0.0.1
开始spark-shell
.
将主机名添加到/etc/hosts文件中(如果不存在)
Add your hostname to your /etc/hosts file (if not present)
127.0.0.1 your_hostname
添加环境变量
Add env variable
export SPARK_LOCAL_IP="127.0.0.1"
load-spark-env.sh
以上步骤解决了我的问题,但您也可以尝试添加
Above steps solved my problem but you can also try to add
export SPARK_LOCAL_IP=127.0.0.1
在模板文件spark-env.sh.template
(/usr/local/Cellar/apache-spark/2.1.0/libexec/conf/
)上的本地IP注释下
under the comment for local IP on template file spark-env.sh.template
(/usr/local/Cellar/apache-spark/2.1.0/libexec/conf/
)
然后
cp spark-env.sh.template spark-env.sh
spark-shell
如果以上均未解决,请检查您的防火墙并启用它(如果尚未启用)
If none of the above fixes, check your firewall and enable it, if not already enabled