title: Spark Standalone Cluster - Slave not connecting to Master
body: <p>I am trying to setup a Spark standalone cluster following the official documentation.</p>
  
  <p>My master is on a local vm running ubuntu and I also have one worker running in the same machine. It is connecting and I am able to see its status in the WebUI of the master.</p>
  
  <p>Here is the WebUi image -</p>
  
  <p><img src="https://i.stack.imgur.com/u0DH5.png" alt="enter image description here"></p>
  
  <p>But when I try to connect a slave from another machine, I am not able to do it.</p>
  
  <p>This is the log message I get in the worker when I start from another machine.
  I have tried using <code>start-slaves.sh</code> from the master after updating conf\slaves and also <code>start-slave.sh spark://spark:7077</code> from the slave.</p>
  
  <p>[Master hostname - spark; Worker hostanme - worker]</p>
  
  <pre><code>15/07/01 11:54:16 WARN ReliableDeliverySupervisor: Association with remote system [akka.tcp://sparkMaster@spark:7077] has failed, address is now gated for [5000] ms. Reason is: [Association failed with [akka.tcp://sparkMaster@spark:7077]].
  15/07/01 11:54:59 ERROR Worker: All masters are unresponsive! Giving up.
  15/07/01 11:54:59 INFO Utils: Shutdown hook called
  </code></pre>
  
  <p>When I try to telnet from the slave to the master, this is what I get -</p>
  
  <pre><code>root@worker:~# telnet spark 7077
  Trying 10.xx.xx.xx...
  Connected to spark.
  Escape character is '^]'.
  Connection closed by foreign host.
  </code></pre>
  
  <p>Telnet seems to work but the connection is closed as soon as it is established. Could this have something to do with the problem ?</p>
  
  <p>I have added the master and slave IP addresses in /etc/hosts on both machines.
  I followed all the solutions given at <a href="https://stackoverflow.com/questions/23822222/spark-standalone-cluster-cannot-start-worker-from-another-machine">SPARK + Standalone Cluster: Cannot start worker from another machine</a>
  but they have not worked for me.</p>
  
  <p>I have the following config set in spark-env.sh in both machines -</p>
  
  <blockquote>
    <p>export SPARK_MASTER_IP=spark  </p>
    
    <p>export SPARK_WORKER_PORT=44444</p>
  </blockquote>
  
  <p>Any help is greatly appreciated.</p>