简体   繁体   English

在 Spark 中将 IP 地址设置为 spark.driver.host 而不是主机名?

[英]Setting an IP address as spark.driver.host instead of hostname in Spark?

I have a problem with declaring an spark.driver.host setting.我在声明 spark.driver.host 设置时遇到问题。 Assume that i have an host with a HOSTNAME and binded address 192.168.1.1 (its linux, windows has not this problem at all).假设我有一个带有 HOSTNAME 和绑定地址192.168.1.1的主机(它的 linux,windows 根本没有这个问题)。

If i set a property spark.driver.hostname = 192.168.1.1 workers will respond to HOSTNAME, which is really bad, because they don't have DNS with this hostname.如果我设置属性spark.driver.hostname = 192.168.1.1工作人员将响应 HOSTNAME,这真的很糟糕,因为他们没有使用此主机名的 DNS。

As this troubleshooting page says:如此故障排除页面所说:

If SPARK_LOCAL_IP is set to an IP address, it will be resolved to a hostname.如果 SPARK_LOCAL_IP 设置为 IP 地址,它将被解析为主机名。

And here is a question: how to NOT setting this IP address as a hostname?这里有一个问题:如何将此 IP 地址设置为主机名?

你可以在你的spark环境中设置SPARK_LOCAL_HOSTNAME=ip地址来解决这个问题。

hostname -f gives your FQDN add this to /etc/hosts file as主机名 -f 将您的 FQDN 添加到 /etc/hosts 文件中

[your ip address] [your hostname] on spark nodes [您的 IP 地址] [您的主机名] 在火花节点上

or add your hostname to dns used by your spark nodes或将您的主机名添加到您的 spark 节点使用的 dns

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM