Here is the solution
Instead of using:
val textFile = sc.textFile("hdfs://input/war-and-peace.txt")
Use this as you fire up your Spark-shell:
How did I find out nn1home:8020?
Just search for the file core-site.xml, the core-site.xml is always located in the conf directory either on the local or cluster installation of Spark and then look for xml element fs.defaultFS.
If you want to know more about Hadoop, then do check out this awesome video tutorial: