You could probably use the DataNode API for this (default on port 50075), it supports a streamFile
command which you could take advantage of. Using wget
this would look something like:
wget http://$datanode:50075/streamFile/demofile.txt -O ~/demofile.txt
Note that this command needs to be executed on the datanode itself, not on the namenode !
Alternatively, if you don't know which datanode to hit you could ask the jobtracker and it will redirect you to the right datanode with this URL:
http://$namenode:50070/data/demofile.txt