I used the following command to run the spark java example of wordcount:-
time spark-submit --deploy-mode cluster --master spark://192.168.0.7:6066 --class o
I solved this problem by modifying the slave file.its spark-2.4.0-bin-hadoop2.7/conf/slave please check your configure。