You are on page 1of 7

ASSIGNMENT -1

NAME – SHASHANK
SECTION – S14
BRANCH -E.C.E

HDFS Task-1

1. What is the Namenode's URI and which file is it configured in?

Ans 1 . In the Namenode URI field, we enter the URI pointing to the machine used as the
NameNode service of the Cloudera Hadoop cluster to be used.

The namenode URI is configured in  hdfs-site.xml file.

2. Where on a local file system will Namenode store its image and which file is it configured
in?
Ans 2. The NameNode keeps an image of the entire file system namespace and file
Blockmap in memory.

The offline image Viewer can be used for editing or configuring the images stored by the
namenode.

Also the namenode is configured in hdfs-site.xml file

3. Where on a local file system will Datanode store its blocks and which file is it configured
in?

Ans 3.  The DataNode has no knowledge about HDFS files. It stores each block of HDFS data
in a separate file in its local file system. 

The Datanode is configured in hdfs-site.xml file.

4. What is the block replication and which file is it configured in?

Ans 4. HDFS stores each file as a sequence of blocks. The blocks of a file are replicated for
fault tolerance.The Namenode makes all decisions regarding replication of blocks. It
periodically receives a Blockreport from each of the DataNodes in the cluster. A Blockreport
contains a list of all blocks on a DataNode.

It is configured in hdfs-site.xml file


Perform

1. Start HDFS and verify that it's running

Ans 1. Starting the HDFS :

HDFS RUNNING :

2. Create a new directory /exercise1 on HDFS


Ans 2.

3. Upload GitHub repo sample_data/deckofcards.txt to HDFS under /exercise1 directory

Ans 3.

4. View the content of the /exercise1 directory


Ans 4. Content of the exercise1 directory:

5. Determine the size of the hamlet.txt file in KB that resides on HDFS (not local directory)

Ans 5. The size of the hamlet.txt file is = 206.3k


6. Print the first 25 lines to the screen from deckofcards.txt on HDFS
Ans 6.

7. Copy deckofcards.txt to deckofcardsCopy.txt


Ans 7.

8. Copy deckofcards.txt back to local file system and name it deckofcards.copy.txt

Ans 8.

9. Check the entire filesystem for inconsistencies/problems


Ans 9.
10. Delete deckofcards.txt from HDFS
Ans 10.

11. Delete the /exercise1 directory from HDFS


Ans 11.
12. Take a second to look at other available shell options.

Ans 12.

You might also like