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 had this problem and it is because of changing real IP with my IP in /etc/hosts.