Posted on

Hadoop – Learn Free HDFS Files Operations


How to Start HDFS Files

hadoop-HDFS-files-operations (HDFS files)

To start HDFS files you have to format the configured HDFS files by executing following command:

After formatting HDFS files, use the following command to start the namenode as well as the data nodes as cluster.

To know more about HDFS check our previous post HDFS OVERVIEW

How to List Files in HDFS

In order to check the status of file in directory, you can use “ls”. Use the following command:

How to Insert Data Files in HDFS

  • Step 1

First you have to create a input file directory. Use following command to create a directory:

  • Step 2

Since your file is still on your local system. You need to transfer file from local system to Hadoop file sytem. Use the following command:

  • Step 3

Now you have Inserted file in HDFS. You can verify this using “ls” command as following:

How to Retrieving Data from HDFS

Example: You want to retrieve data of file name

  • Step 1

Firstly use “cat” command to view data from HDFS servers. Use following command:

  • Step 2

This step is reverse of Step 2 of How to Insert Data Files in HDFS shown above.

You have to move file from HDFS to your local server. Use following command to get the data to local server:

  • Step 3

Shutting Down HDFS

To shutdown HDFS you can use following Command: