title: Apache Spark: "failed to launch org.apache.spark.deploy.worker.Worker" or Master
body: <p>I have created a Spark cluster on Openstack running on Ubuntu14.04 with 8gb of ram. I created two virtual machines with 3gb each (keeping 2 gb for the parent OS). Further, i create a master and 2 workers from first virtual machine and 3 workers from second machine.</p>
  
  <p>The spark-env.sh file has basic setting with </p>
  
  <pre><code>export SPARK_MASTER_IP=10.0.0.30
  export SPARK_WORKER_INSTANCES=2
  export SPARK_WORKER_MEMORY=1g
  export SPARK_WORKER_CORES=1
  </code></pre>
  
  <p>Whenever i deploy the cluster with start-all.sh, i get "failed to launch org.apache.spark.deploy.worker.Worker" and some times "failed to launch org.apache.spark.deploy.master.Master". When i see the log file to look for error i get the following</p>
  
  <blockquote>
    <p>Spark Command: /usr/lib/jvm/java-7-openjdk-amd64/bin/java -cp    >/home/ubuntu/spark-1.5.1/sbin/../conf/:/home/ubuntu/spark->1.5.1/assembly/target/scala-2.10/spark-assembly-1.5.1->hadoop2.2.0.jar:/home/ubuntu/spark-1.5.1/lib_managed/jars/datanucleus-api->jdo-3.2.6.jar:/home/ubuntu/spark-1.5.1/lib_managed/jars/datanucleus-core->3.2.10.jar:/home/ubuntu/spark-1.5.1/lib_managed/jars/datanucleus-rdbms->3.2.9.jar -Xms1g -Xmx1g -XX:MaxPermSize=256m >org.apache.spark.deploy.master.Master --ip 10.0.0.30 --port 7077 --webui->port 8080</p>
  </blockquote>
  
  <p>Though I get the fail message but the master or worker become alive after a few seconds.</p>
  
  <p>Can someone please explain the reason?</p>