各位大神,我现在自己动手编写了一个scala程序,想放在放在linux服务器上运行,但是出现了很奇怪的问题:我的运行命令是这样的(在jar包所在目录下运行):java -classpath "./spark-test.jar:./spark-assembly-1.1.0-cdh5.2.0-hadoop2.5.0-cdh5.2.0.jar:./hadoop-hdfs-2.5.0-cdh5.2.0.jar:." sparktest.Test其中spark-test.jar是我自己编写的scala程序,后面的两个jar包是我在这个服务器上找到的jar包当我在程序里面把SparkContext设置为local的时候运行是没有问题的但是当我想把SparkContext换成集群的spark://shzx002:18080的时候就会出现错误:14/12/04 17:17:41 WARN TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient memory
14/12/04 17:17:42 INFO AppClient$ClientActor: Connecting to master spark://shzx002:18080...
14/12/04 17:17:42 WARN AppClient$ClientActor: Could not connect to akka.tcp://sparkMaster@shzx002:18080: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@shzx002:18080]
14/12/04 17:17:42 WARN AppClient$ClientActor: Could not connect to akka.tcp://sparkMaster@shzx002:18080: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@shzx002:18080]
14/12/04 17:17:42 WARN AppClient$ClientActor: Could not connect to akka.tcp://sparkMaster@shzx002:18080: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@shzx002:18080]
14/12/04 17:17:42 WARN AppClient$ClientActor: Could not connect to akka.tcp://sparkMaster@shzx002:18080: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@shzx002:18080]这个集群不是我自己配置的,再加上我接触不久,所以不是很懂……集群的地址应该是没什么问题的我不知道是什么原因造成的,如何才能解决呢?在网上查了很多的东西,但是都没用……先谢过各位了

解决方案 »

  1.   

    为什么不用spark-submit ?
      

  2.   

    我用submit 也出现同样的问题!求帮忙。
      

  3.   

    把你的Spark程序发上来。setMaster哪里写的格式是不是正确。
      

  4.   

     check your cluster UI to ensure that workers are registered and have sufficient memory
    应该是你uri不对。检查配置
      

  5.   

    没有配置SPARK_EXECUTOR_MEMORY参数,默认会使用1G内存,所以会出现内存不足,从而出现上面日志报的警告信息。所以解决办法是在spark-env.sh中添加如下参数:export SPARK_EXECUTOR_MEMORY=100M
      

  6.   

    独立部署模式下,client模式的spark master默认端口的7077,cluster模式端口是6066,端口搞错了,不是spark web ui 的端口
      

  7.   

    1.端口错误引起的。2.你的HOST,也就是域名配置有问题 3.内存方面有问题