In the docker runner mode each step of a cluster ran in a container of its
own, so nothing a step left in /home/hadoop, or in HDFS, was there for the
next, and the image has no HDFS at all: an hdfs:// path failed, and a path
without a scheme, which EMR reads as HDFS, went to the container's own
disk. The Management Guide calls HDFS "best used for caching the results produced by
intermediate job-flow steps", the prefix "hdfs:// (or no prefix)", and
"ephemeral storage that is reclaimed when you terminate a cluster"; the
Release Guide's S3DistCp page copies data "into HDFS where it can be
processed by subsequent steps".
Now a cluster's storage outlives its steps:
- each step's container mounts the cluster's two Docker volumes, one at
/home/hadoop and one at /mnt, both of which the image gives its hadoop
user, so Docker gives an empty volume that owner, and what the cluster's
bootstrap left there in the image its steps run in;
- HDFS is /mnt/hdfs: Spark gets fs.defaultFS hdfs:/// and the hdfs scheme
through Hadoop's ViewFileSystemOverloadScheme with a fallback link to
that folder, so hdfs:// paths and those without a scheme lead there, a
relative one under /user/hadoop, and a streaming query keeps its
checkpoints through Spark's file system checkpoint manager, as
FileContext refuses an hdfs:// path without a host. The cluster's
spark-defaults can set any of these otherwise;
- a command step's hadoop fs gets the same, through a copy of the image's
Hadoop configuration, or of the folder a spark-env export of
HADOOP_CONF_DIR names, links followed, whose core-site.xml takes in
the original's through Hadoop's XInclude and then those properties,
with its HDFS, MapReduce and YARN homes set; hdfs dfs runs as hadoop
fs, the image's hdfs command being unable to run;
- the volumes go once the cluster has ended and its last step is done,
tried again while Docker refuses, as the bootstrap's image is; on a
reset, a step's thread it overtook removing them again once its
container is gone; and, for clusters that are gone or have ended, when
the service starts, unless reconcile-containers-on-startup is off.
SparkJobRunner.Job carries the storage, which an EMR Serverless run leaves
null. ClusterStorage names, makes and removes the volumes;
EmrClusterStorage is its Docker side. A path without a scheme that a step
meant for its container's own disk now leads to HDFS, as on EMR. emr.md
says what HDFS lacks: no NameNode, no hdfs:// path with a host, no
hadoop fs -ls / and no S3 through hadoop fs.