docker-spark icon indicating copy to clipboard operation
docker-spark copied to clipboard

Wrong driverHostname for Application UI

Open atomobianco opened this issue 7 years ago • 9 comments
trafficstars

Hi, I am using your wonderful docker images. When I moved up from a cluster with

spark-base:2.2.0-hadoop2.8-hive-java8

to a cluster with the most recent version:

spark-master:2.3.1-hadoop2.7

I notice that the Web UI is no more a valid URL. Before that was giving the http://<worker ip>:4040, while now it's a strange http://a585a25be0f7:4040 which is not reachable (I have to write it by hand).

Do you know what could be the cause?

atomobianco avatar Jun 28 '18 16:06 atomobianco

@atomobianco hi!

what you see there as a hostname a585a25be0f7 is a docker container id (default internal docker hostname representation). You may try to plan with spark.driver.bindAddress configuration option to set it back.

Did you change anything else beside the image version?

earthquakesan avatar Jul 01 '18 11:07 earthquakesan

Could you solved @atomobianco ?

jgoodman8 avatar Aug 13 '18 16:08 jgoodman8

@earthquakesan Thanks for the tip I did not try it yet, but to answer your question no, I only did change the image version. @jgoodman8 not yet solved

atomobianco avatar Aug 14 '18 10:08 atomobianco

Hello, coming back on this problem as I am updating the stack to Spark 2.3.2.

As far as I understood @earthquakesan you suggest to submit the job with spark.driver.bindAddress; the problem is that as I am submitting in cluster mode, I don't know which worker will be the driver, therefore I can't set a priori the address, or I am mistaken?

atomobianco avatar Oct 17 '18 15:10 atomobianco

For information, here two Spark UI environmental variables taken from the previous version and the current version:

with bde2020/spark-base:2.2.0-hadoop2.8-hive-java8

spark.driver.host	172.24.0.5
spark.master	spark://e0e2e4fea039:7077

with bde2020/spark-base:2.3.2-hadoop2.8

spark.driver.host	afe3b572290b
spark.master	spark://39b10c64d584:7077

atomobianco avatar Oct 17 '18 19:10 atomobianco

The workaround I did for the moment is rewrite the /etc/hosts in the worker nodes:

The old one was 172.24.0.5 afe3b572290b

The new one is 172.24.0.5 172.24.0.5

This rewriting is performed inside worker.sh script, which is the Docker entry point for each worker node, so that each worker container gets its IP at run time.

atomobianco avatar Oct 19 '18 15:10 atomobianco

That sounds good. I will try!

jgoodman8 avatar Oct 19 '18 17:10 jgoodman8

This line within worker.sh should work:

# Substitute container id with current IP
sed -r "s/$(hostname -i).+/$(hostname -i) $(hostname -i)/" /etc/hosts > /tmp/.intermediate-file-2431; cp tmp/.intermediate-file-2431 /etc/hosts;

atomobianco avatar Oct 31 '18 16:10 atomobianco

This line within worker.sh should work:

# Substitute container id with current IP
sed -r "s/$(hostname -i).+/$(hostname -i) $(hostname -i)/" /etc/hosts > /tmp/.intermediate-file-2431; cp tmp/.intermediate-file-2431 /etc/hosts;

Hi atomobianco,

I'm creating my own image and i have similar issue ... the hostname have the Container ID, and i'm trying (withou success) to change it ... to the IP for example ...

tpsimoes avatar Jun 27 '19 14:06 tpsimoes