title: 'Connection Refused' error while running Spark Streaming on local machine
body: <p>I know there are many threads already on 'spark streaming connection refused' issues. But most of these are in Linux or at least pointing to HDFS. I am running this on my local laptop with Windows.</p>
  
  <p>I am running a very simple basic Spark streaming standalone application, just to see how the streaming works. Not doing anything complex here:-</p>
  
  <pre><code>import org.apache.spark.streaming.Seconds
  import org.apache.spark.streaming.StreamingContext
  import org.apache.spark.SparkConf
  
  object MyStream 
  {
      def main(args:Array[String]) 
      {
          val sc = new StreamingContext(new SparkConf(),Seconds(10))
          val mystreamRDD = sc.socketTextStream("localhost",7777)
          mystreamRDD.print()
          sc.start()
          sc.awaitTermination()
      }
  }
  </code></pre>
  
  <p>I am getting the following error:-</p>
  
  <pre class="lang-none prettyprint-override"><code>2015-07-25 18:13:07 INFO  ReceiverSupervisorImpl:59 - Starting receiver
  2015-07-25 18:13:07 INFO  ReceiverSupervisorImpl:59 - Called receiver onStart
  2015-07-25 18:13:07 INFO  SocketReceiver:59 - Connecting to localhost:7777
  2015-07-25 18:13:07 INFO  ReceiverTracker:59 - Registered receiver for      stream 0 from 192.168.19.1:11300
  2015-07-25 18:13:08 WARN  ReceiverSupervisorImpl:92 - Restarting receiver     with delay 2000 ms: Error connecting to localhost:7777
  java.net.ConnectException: Connection refused
  </code></pre>
  
  <p>I have tried using different port numbers, but it doesn't help. So it keeps retrying in loop and keeps on getting same error. Does anyone have an idea?</p>