Transferring a file to HDFS from Apache Zeppelin running on a remote server
You can try:
sc.textFile("hdfs://DNS:PORT/test.csv")
where DNS
is address of name node of your Hadoop cluster and PORT
is port on which HDFS is listening, where default value depends on Hadoop distribution. Common value is 8020
. You can check it in core-site.xml
in parameter fs.default.name
or fs.defaultFS
depending on your Hadoop version.
Example request can look like:
sc.textFile("hdfs://address:8020/test.csv")
If you are trying to read a local file in zeppelin make sure to put that file in the zeppelin folder(zeppelin installation folder) as zeppelin is not able to access files outside the zeppelin folder.