Big Data Hadoop & Spark

Hadoop Admin Commands

In this blog we will be discussing about some of the Administration commands and how they work?

Hadoop fsck Commands

1. Hadoop fsck /

100% Free Course On Big Data Essentials

Subscribe to our blog and get access to this course ABSOLUTELY FREE.

fsck command is used to check the HDFS file system. There are different arguments that can be passed with this command to emit different results.

Please follow the below screenshot for the same.

2. hadoop fsck / -files

It displays all the files in HDFS while checking. Please refer to the below screenshot for the same.

2

3. hadoop fsck / -files -blocks

It displays all the blocks of the files while checking. Please refer to the below screenshot for the same.

3

4. hadoop fsck / -files -blocks -locations

It displays all the files block locations while checking. Please refer to the below screenshot for the same.

4

5. hadoop fsck / -files -blocks -locations -racks

This command is used to display the networking topology for data-node locations. Please refer to the below screenshot for the same.

5

Hadoop

6. hadoop fsck -delete

This command will delete the corrupted files in HDFS. Please refer to the below screenshot for the same.

6

7. hadoop fsck -move

This command is used to move the corrupted files to a particular directory, by default it will move to the /lost+found directory. Please refer to the below screens shot for the same.

7

Let us now discuss about the hadoop dfsadmin commands.

Hadoop dfsadmin Commands

1. hadoop dfsadmin -report

This command is used to return the file system information and its statistics. Please refer to the below screenshot for the same.

8

2.hadoop dfsadmin -metasave file_name.txt

This command is used to save the meta data that is present in the namenode in a file in the HDFS. Please refer to the below screenshot for the same.

9

Here we have given the file_name as nn.txt and it has been saved in the log directory of hdfs.

3.hadoop dfsadmin -refreshNodes

This command is used to refresh the data nodes that are allowed to connect to the name node. Please refer the below screenshot for the same.

10

4.hadoop fs -count -q /mydir

Checks for the quota space for the specified directory or a file. Please refer to the below screenshot for the same.

11

5.hadoop dfsadmin -setSpaceQuota 10M /dir_name

This command is used to set the space quota space for a particular directory. Now we will set the directory quota to 10MB and then we will check it using the command hadoop fs -count -q /mydir. Please refer to the below screenshot for the same.

12

In the above screenshot you can see that 10MB quota has been allocated.

6.hadoop dfsadmin -clrSpaceQuota /mydir

This command is used to clear the allocated quota to a particular directory in HDFS. Now we will clear the quota which we have previously created and check the quota again. Please refer to the below screenshot for the same.

13

In the above screenshot you can see that the quota has been cleared.

Hadoop Safe Mode (Maintenance Mode) Commands

Here we will discuss about Safe Mode commands:

1.hadoop dfsadmin -safe mode enter

This command is used to enter safe mode. Please refer to the below screenshot for the same.

13

2.hadoop dfsadmin -safemode leave

This command is used to leave safe mode. Please refer to the below screenshot for the same.

143.hadoop dfsadmin -safemode get

This command is used to get the status of the safe mode. Please refer to the below screenshot for the same.

15

Hope this blog about hadoop admin commands was informative. Click here to learn in depth about Big Data Hadoop Administration.

Feel free to contact us at [email protected] for any further query.

Spark

Tags

2 Comments

  1. Pingback: Hadoop Admin commands by acadgild.com – hadoopminds
  2. Hey
    I have gone through your post It is very informative and useful post for reader in fact these commands are very useful for who wants to learn hadoop admin certification course.
    From my point of view “Hadoop Safe Mode (Maintenance Mode) Commands” these commands are important
    I have learned hadoop administration course from koenig solutions.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Articles

Close
Close