You can't access HDFS file from local machine(system user), so that you can't open HDFS file using gedit
.
To open in gedit
you have to copy to local machine.
To do that, open terminal(Ctrl+Alt+T) and use copyToLocal
a Hadoop Shell Command to copy the output file into local machine.
Do the following,
hadoopuser@arul-PC:/usr/local/hadoop$ sudo bin/hadoop dfs -copyToLocal /user/hadoopuser/MapReduceSample-output/part-00000 /home/arul/Downloads/
Now you can open the output file using gedit
as follows,
$ sudo gedit /home/arul/Downloads/part-00000
Note :
- My HDFS username is
hadoopuser
. - You can move a file from HDFS to local machine. The Hadoop Shell Command
fs -mv
allow to move different HDFS location. - For more Hadoop Shell Commands(click here).
Update (An another option to do the same from Y-Prithvi's post)
you can also use getmerge to copy HDFS file to local system.
hadoopuser@arul-PC:/usr/local/hadoop$ bin/hadoop dfs -getmerge /user/hadoopuser/MapReduceSample-output/part-00000 /home/arul/MROutput
hadoop dfs -getmerge /path/to/HDFS /path/to/save