title: Cluster deploy mode is currently not supported for python applications on standalone clusters
body: <p>I am trying to run sample Python program on my <code>Spark</code> cluster. The cluster consists of a master and two workers. Nevertheless, when I am trying to run my sample code, it swears:</p>
  <pre><code>$ spark-submit --master spark://sparkmaster:7077 --deploy-mode cluster test01.py
  Exception in thread &quot;main&quot; org.apache.spark.SparkException: Cluster deploy mode is currently not supported for python applications on standalone clusters.
  </code></pre>
  <p>What does it mean? Is my cluster standalone? Even if it consists of 3 computers, it is still standalone? How to make it non-standalone to run python programs in clustered mode?</p>
  <hr />
  <p>If I just do</p>
  <pre><code>spark-submit test01.py
  </code></pre>
  <p>it crushes with error</p>
  <pre><code>21/03/30 11:07:27 WARN Utils: Service 'sparkDriver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
  21/03/30 11:07:27 WARN Utils: Service 'sparkDriver' could not bind on a random free port. You may check whether configuring an appropriate binding address.
  21/03/30 11:07:27 ERROR SparkContext: Error initializing SparkContext.
  java.net.BindException: Cannot assign requested address: Service 'sparkDriver' failed after 16 retries (on a random free port)! Consider explicitly setting the appropriate binding address for the service 'sparkDriver' (for example spark.driver.bindAddress for SparkDriver) to the correct binding address.
          at sun.nio.ch.Net.bind0(Native Method)
          at sun.nio.ch.Net.bind(Net.java:461)
          at sun.nio.ch.Net.bind(Net.java:453)
          at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:222)
          at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134)
          at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:550)
          at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334)
          at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506)
          at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491)
          at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973)
          at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:248)
          at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356)
          at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
          at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
          at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
          at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
          at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
          at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
          at java.lang.Thread.run(Thread.java:748)
  </code></pre>
  <hr />
  <p>I wrote <code>test01.py</code> in the following way</p>
  <pre><code>from pyspark.sql import SparkSession
  
  logFile = &quot;README.md&quot;  # Should be some file on your system
  spark = SparkSession.builder\
      .appName(&quot;SimpleApp&quot;)\
      .config(&quot;spark.driver.bindAddress&quot;, &quot;127.0.0.1&quot;)\
      .getOrCreate()
  
  logData = spark.read.text(logFile).cache()
  
  numAs = logData.filter(logData.value.contains('a')).count()
  numBs = logData.filter(logData.value.contains('b')).count()
  
  print(&quot;Lines with a: %i, lines with b: %i&quot; % (numAs, numBs))
  
  spark.stop()
  </code></pre>
  <p>and it worked. Unfortunately, there are no traces of this work on spark master page.</p>
  <p>Was it working distributed at all?</p>