A single-node Hadoop cluster is the fastest way to check HDFS, YARN, and MapReduce behavior on one host. It still uses real daemons, so configuration, formatting, startup, and smoke-test steps should be explicit.
Start from an installed Hadoop runtime and pseudo-distributed configuration. Format HDFS once, start HDFS and YARN, create the HDFS user directory, and run a small job to prove the cluster can execute work.
Single-node clusters are for lab use. Do not treat successful single-node results as proof of multi-node networking, capacity, Kerberos, or high availability.
$ hdfs getconf -confKey fs.defaultFS hdfs://localhost:9000
$ hdfs namenode -format -clusterId single-node-lab Storage directory /var/lib/hadoop/hdfs/name has been successfully formatted.
$ start-dfs.sh Starting namenodes on [localhost] Starting datanodes Starting secondary namenodes [localhost]
Related: How to restart Hadoop services
$ start-yarn.sh Starting resourcemanager Starting nodemanagers
$ hdfs dfs -mkdir -p /user/hadoop
$ yarn jar $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-examples-3.5.0.jar pi 2 1000 INFO mapreduce.Job: map 100% reduce 100% Estimated value of Pi is 3.14800000000000000000
Related: How to run a MapReduce job on Hadoop
$ stop-yarn.sh Stopping resourcemanager Stopping nodemanagers