HDFS
HDFS
The following commands can be used to copy files/folders between a container and
the local filesystem. Specifically, the commands below will copy files/folders from
the source_path to the destination_path in the specified container. The container
does not need to be running.
Mounting a directory makes the directory directly accessible from within the
container, as if the directory was part of the container. This is accomplished by using
the -v option with docker run, which allows you to mount a localDirectory to a
containerDirectory, which is a directory within the container. Note that if
containerDirectory already exists, then its contents will be replaced. In addition, this
option only works when creating the container (e.g., it cannot be used with an
already running container).
To move data from the container to HDFS, commands begin with hdfs dfs (formerly
hadoop fs) and are followed by an option and appropriate arguments. Options and
their arguments are similar to their linux counterparts.
Hadoop User Experience (Hue) provides a web interface for working with HDFS and
Hadoop. When a docker container is running Hue and the container port 8888 is
mapped to local port 8888, Hue can be accessed by pointing a web browser to
localhost:8888, and logging in using cloudera for both the username and password.
Clicking the first icon on the top right of the page (hovering over this shows “Manage
HDFS”) will take you to the HDFS file browser, where you can add, delete, and
rename files and directories.