You are on page 1of 6

Assignment 1

Exercise 1: CREATING DIRECTORY ON HDFS AND STORE THE FILE

1: Create a Directory on top of HDFS PATH

2: Create a file (sample.txt) on local directory using any editors (cat,nano,vi)

3: Store the file (sample.txt) on HDFS PATH (/hd_siddhant) using (put or copyFromLocal).

4: To list the contents of HDFS DIR

5: To display the contents of a file on HDFS DIR

Exercise 2: CREATING DIRECTORY ON LOCAL SYSTEM AND GET THE DATA FROM HDFS PATH
1: Create a Directory on local system.

2: Get the data (file eg: sample.txt) from Hdfs location and store in local directory (Example) using (get,
copyToLocal).

3: To list the contents of local directory (Example)

4: To display the contents of file

Exercise 3: (moving the data form local file system to HDFS PATH (cntrl+x --> cntrl+v))

1: Create one more directory on HDFS PATH (/hd_siddhant_mv)


2: Create one file (temp.txt) on Local file System

3: Move the data from Local System (file: temp.txt) to HDFS Path (Dir: /hd_dir_mv)

4: Try to display the contents of file (temp.txt)

Because in source folder file not available, in destination it available.

Exercise 4: (copying the data from <hdfs-path>to<hdfs-path>)

1: create two directories on HDFS PATH (/hd_siddhant_cp1, /hd_siddhant_cp2)


2: Create one file (simple.txt) and store it on HDFS PATH (/hd_siddhant_cp1)

3: copy the file from one directory to another ON HDFS (cntrl+c to cntrl+v)

4: output

Exercise 5: (moving the data from <hdfs-path>to<hdfs-path>)

1: create two directories on HDFS PATH (/hd_siddhant_mv1, /hd_siddhant_mv2)


2: Create one file(sample.txt) and store it on HDFS PATH(/hd_siddhant_mv1)

3: move the file from one directory to another ON HDFS (cntrl+x to cntrl+v)

4: output

Exercise:6 (setting the replication factor explicitly for file ON HDFS PATH)

1: create a directory on Hdfs Path


2: Copy a file from local system to HDFS (/hd_siddhant_rep)

3: In our system default replication factor is 1, but explicitly to increase the replication factor of a file to 2

You might also like