I'm trying to read a file in my hdfs. Here's a showing of my hadoop file structure.
hduser@GVM:/usr/local/spark/bin$ hadoop fs -ls -R /
drwxr-xr-x - hduser supergroup 0 2016-03-06 17:28 /inputFiles
drwxr-xr-x - hduser supergroup 0 2016-03-06 17:31 /inputFiles/CountOfMonteCristo
-rw-r--r-- 1 hduser supergroup 2685300 2016-03-06 17:31 /inputFiles/CountOfMonteCristo/BookText.txt
Here's my pyspark code:
from pyspark import SparkContext, SparkConf
conf = SparkConf().setAppName("myFirstApp").setMaster("local")
sc = SparkContext(conf=conf)
textFile = sc.textFile("hdfs://inputFiles/CountOfMonteCristo/BookText.txt")
textFile.first()
The error I get is:
Py4JJavaError: An error occurred while calling o64.partitions.
: java.lang.IllegalArgumentException: java.net.UnknownHostException: inputFiles
Is this because I'm setting my sparkContext incorrectly? I'm running this in a ubuntu 14.04 virtual machine through virtual box.
I'm not sure what I'm doing wrong here....