Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources

后端 未结 5 1731
长情又很酷
长情又很酷 2020-12-31 04:23

I\'m trying to run the spark examples from Eclipse and getting this generic error: Initial job has not accepted any resources; check your cluster UI to en

5条回答
  •  粉色の甜心
    2020-12-31 04:35

    If you try to run your application with IDE, and you have free resources on your workers, you need to do this:

    1) Before all, configure workers and master spark nodes.

    2) Specify driver(PC) configuration to return calculation value from workers.

    SparkConf conf = new SparkConf()
                .setAppName("Test spark")
                .setMaster("spark://ip of your master node:port of your master node")
                .set("spark.blockManager.port", "10025")
                .set("spark.driver.blockManager.port", "10026")
                .set("spark.driver.port", "10027") //make all communication ports static (not necessary if you disabled firewalls, or if your nodes located in local network, otherwise you must open this ports in firewall settings)
                .set("spark.cores.max", "12") 
                .set("spark.executor.memory", "2g")
                .set("spark.driver.host", "ip of your driver (PC)"); //(necessary)
    

提交回复
热议问题