HttpFS is a server that provides a REST HTTP gateway supporting all HDFS File System operations (read and write). And it is inteoperable with the webhdfs REST HTTP API.
HttpFS can be used to transfer data between clusters running different versions of Hadoop (overcoming RPC versioning issues), for example using Hadoop DistCP.
HttpFS can be used to access data in HDFS on a cluster behind of a firewall (the HttpFS server acts as a gateway and is the only system that is allowed to cross the firewall into the cluster).
HttpFS can be used to access data in HDFS using HTTP utilities (such as curl and wget) and HTTP libraries Perl from other languages than Java.
The webhdfs client FileSytem implementation can be used to access HttpFS using the Hadoop filesystem command (hadoop fs
) line tool as well as from Java applications using the Hadoop FileSystem Java API.
HttpFS has built-in security supporting Hadoop pseudo authentication and HTTP SPNEGO Kerberos and other pluggable authentication mechanims. It also provides Hadoop proxy user support.
HttpFS is a separate service from Hadoop NameNode.
HttpFS itself is Java web-application and it runs using a preconfigured Tomcat bundled with HttpFS binary distribution.
HttpFS HTTP web-service API calls are HTTP REST calls that map to a HDFS file system operation. For example, using the curl
Unix command:
$ curl http://httpfs-host:14000/webhdfs/v1/user/foo/README.txt
returns the contents of the HDFS /user/foo/README.txt
file.
$ curl http://httpfs-host:14000/webhdfs/v1/user/foo?op=list
returns the contents of the HDFS /user/foo
directory in JSON format.
$ curl http://httpfs-host:14000/webhdfs/v1/user/foo?op=GETTRASHROOT
returns the path /user/foo/.Trash
, if /
is an encrypted zone, returns the path /.Trash/foo
. See more details about trash path in an encrypted zone.
$ curl -X POST http://httpfs-host:14000/webhdfs/v1/user/foo/bar?op=mkdirs
creates the HDFS /user/foo.bar
directory.