web service for interacting with the Hadoop FileSystem
the service can be run as is or run in a container. deploy the service in a node that can communicate with your Hadoop namenode then run commands against your Hadoop infrastructure using the exposed HTTP endpoints
optionally set the GO_WEBHDFS_ADDRESS (ip:port combination to expose your service at, default is 0.0.0.0:8000) and HADOOP_ADDRESS (ip:port combination to connect to your Hadoop namenode, default is 0.0.0.0:9000) environment variables in your shell environment then execute go run controller/controller.go
to expose the service and connect to your Hadoop cluster
this can be done manually or by executing either the run.sh or run.py script
-a
| the address of your Hadoop namenode. defaults to 0.0.0.0:9000
-p
| the port to expose the service on in your machine. If not specified random unassigned port is selected and printed to stdout
--env
| the environment variables passed to the Docker file. (HADOOP_ADDRESS environment variable which specifies the address of your Hadoop namenode should be provided here)
--port
| the port to expose the service on in your machine. If not specified random unassigned port is selected and printed to stdout
--detach
| whether or not to run the container in detached mode
--tag
| tag for your container
move file from source to destination
src
| HDFS source path
dst
| HDFS destination path
copy file from source to destination
src
| HDFS source path
dst
| HDFS destination path
create a directory at specified location
path
| HDFS path to create folder at
remove file at specific location
path
| HDFS path to file to remove
remove all files at specific location recursively
path
| HDFS path to file to remove
ls files at specific location
path
| HDFS path to location to ls
recursive
| boolean value which specifies whether or not to do a recursive ls
create empty file at a specified destination
path
| HDFS path to create the empty file at
copy a file from the client into a file in HDFS
path
| HDFS path to create the replica file at
file
| multipart/form-data which represents the source file you wish to upload (e.g. curl -F 'file=@example.txt' -L http://go-webhdfs-service:8000/v1/hdfs/writefile\?path\=/my/hdfs/location/example.txt)
copy arbritary data from the HTTP request body into a file in HDFS
path
| HDFS path to create the file at
read or copy data from a file in HDFS
path
| HDFS path to the file to be read
(e.g. curl -L http://go-webhdfs-service:8000/v1/hdfs/readfile\?path\=/my/hdfs/location/example.txt > copyofexample.txt)
get contents summary of a file in HDFS
path
| HDFS path to the file from which to getcontentsummary
chmod a file in HDFS
path
| HDFS path to the file to chmod
mask
| mask to apply to file
chown a file in HDFS
path
| HDFS path to the file to chown
user
| user to own file
group
| group to own file