2

I have a Spark Spark cluster where the master node is also the worker node. I can't reach the master from the driver-code node, and I get the error:

14:07:10 WARN client.AppClient$ClientEndpoint: Failed to connect to master master-machine:7077

The SparkContext in driver-code node is configured as: SparkConf conf = new SparkConf(true).setMaster(spark:master-machine//:7077);

I can successfully ping master-machine, but I can't successfully telnet master-machine 7077. Meaning the machine is reachable but the port is not.

What could be the issue? I have disabled Ubuntu's ufw firewall for both master node and node where driver code runs (client).

nikk
  • 2,627
  • 5
  • 30
  • 51
  • 1
    can you connect if you run the driver directly on the master node? – Rockie Yang Jul 25 '16 at 01:08
  • 1
    Here [Application client issue](http://stackoverflow.com/questions/28453835/apache-spark-error-could-not-connect-to-akka-tcp-sparkmaster) question. this might help you for your issue. – Uttam Kasundara Jul 25 '16 at 10:05

1 Answers1

4

Your syntax is a bit off, you have:

setMaster(spark:master-machine//:7077)

You want:

setMaster(spark://master-machine:7077)

From the Spark docs:

Once started, the master will print out a spark://HOST:PORT URL for itself, which you can use to connect workers to it, or pass as the “master” argument to SparkContext. You can also find this URL on the master’s web UI, which is http://localhost:8080 by default.

You can use an IP address in there too, I have run into issues with debian-based installs where I always have to use the IP address but that's a separate issue. An example:

spark.master            spark://5.6.7.8:7077

From a configuration page in Spark docs

JimLohse
  • 1,209
  • 4
  • 19
  • 44