Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a backup directory in HDFS.
Hadoop
hdfs dfs -mkdir [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a directory path that already exists or is not intended for backup.
Forgetting the leading slash in the directory path.
✗ Incorrect
The command 'hdfs dfs -mkdir /backup' creates a backup directory in HDFS.
2fill in blank
mediumComplete the code to copy data from HDFS to the backup directory.
Hadoop
hdfs dfs -cp [1] /backup/ Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Copying from the backup directory itself.
Using a temporary or unrelated directory as source.
✗ Incorrect
The command copies data from '/user/hadoop/data' to the backup directory '/backup/'.
3fill in blank
hardFix the error in the command to restore data from backup to the original location.
Hadoop
hdfs dfs -mv /backup/[1] /user/hadoop/data Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the backup directory name instead of the data folder.
Using unrelated folder names like 'logs' or 'tmp'.
✗ Incorrect
The data folder inside /backup is moved back to the original location '/user/hadoop/data'.
4fill in blank
hardFill both blanks to create a snapshot of the /user/hadoop/data directory.
Hadoop
hdfs dfsadmin -allowSnapshot [1] hdfs dfs -createSnapshot [2] snapshot1
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Allowing snapshots on one directory but creating snapshot on another.
Using backup or temporary directories instead of the data directory.
✗ Incorrect
First, snapshots are allowed on the data directory, then a snapshot named 'snapshot1' is created there.
5fill in blank
hardFill all three blanks to list snapshots, delete a snapshot, and verify deletion.
Hadoop
hdfs dfs -ls [1] hdfs dfs -deleteSnapshot [2] [3] hdfs dfs -ls [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using different directories for listing and deleting snapshots.
Deleting a snapshot that does not exist.
✗ Incorrect
The commands list snapshots in the data directory, delete 'snapshot1', then list snapshots again to confirm deletion.