If our Big Data is on the local filesystem, we need to move it to HDFS. In this section, we will list steps to move data from the local filesystem to the HDFS filesystem.
We assume that our Hadoop cluster has been properly configured and all the Hadoop daemons are running without any issues. And we assume that the data on the local system is in the directory
Perform the following steps to import data to HDFS:
hadoop fs -mkdir data
This command will create a directory
/user/hduser/data in the HDFS filesystem.
hadoop fs -cp file:///data/datafile /user/hduser/data ...