Spark master 在 Windows 上获取错误的 IP [英] Spark master picking up wrong IP on windows

查看:52
本文介绍了Spark master 在 Windows 上获取错误的 IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我出于某种原因在 Windows 7 机器上本地启动 spark master 时,WebUI 显示 URL 和 REST URL 的 IP 地址错误.

When I start a spark master locally on my windows 7 machine for some reason to WebUI displays the URL and REST URL with the wrong ip address.

下面是我用来启动 master 的批处理脚本,其中 %IP% 是我的本地 IP 地址.

Below is my batch script I use to start master where %IP% is my local IP address.

set SPARK_MASTER_IP=%IP%
set SPARK_PUBLIC_DNS=%IP%
set SPARK_MASTER_PORT=7077
set SPARK_MASTER_WEBUI_PORT=8080
set SPARK_MASTER_REST_PORT=6066

START "spark-master" /MIN "C:/spark-1.6.0-bin-hadoop2.6/bin/spark-class.cmd" ^
    org.apache.spark.deploy.master.Master

主 Web UI 显示错误的 IP.出于某种原因,它正在获取属于安装在同一台机器上的 VirtualBox 的 IPv4 地址的 IP 地址.(请注意,我不会以任何方式使用 Virutalbox 来运行 Spark)

The master Web UI displays the wrong IP. For some reason it is picking up the IP address of the IPv4 Address belonging to the VirtualBox installed on the same machine. (Note I'm am not using Virutalbox in any way to run Spark)

URL: spark://169.254.237.14:7077
REST URL: spark://169.254.237.14:6066 (cluster mode)

推荐答案

我认为是安装 VirtualBox 后,hostname to ip 解析顺序导致的问题.我通过在 hosts 文件中添加我的主机名和 IP 解决了这个问题.

I think the issue is caused by hostname to ip resolution order after VirtualBox is installed. I solved the problem by added my hostname and IP the my hosts file.

c:\Windows\System32\Drivers\etc\hosts

MY_HOST_NAME MY_IP

这篇关于Spark master 在 Windows 上获取错误的 IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆