Bird
0
0

You want to quickly find all error messages in Hadoop logs stored in HDFS at /var/log/hadoop. Which command sequence will help you achieve this efficiently?

hard📝 Application Q15 of 15
Hadoop - Cluster Administration
You want to quickly find all error messages in Hadoop logs stored in HDFS at /var/log/hadoop. Which command sequence will help you achieve this efficiently?
Ahdfs dfs -cat /var/log/hadoop/* | grep ERROR
Byarn logs -applicationId * | grep ERROR
Chdfs dfs -ls /var/log/hadoop | grep ERROR
Dhadoop fs -copyToLocal /var/log/hadoop /tmp && grep ERROR /tmp/*
Step-by-Step Solution
Solution:
  1. Step 1: Identify command to read all logs in HDFS directory

    hdfs dfs -cat /var/log/hadoop/* outputs all files in that directory.
  2. Step 2: Filter output for error lines

    Piping to grep ERROR shows only lines with 'ERROR'.
  3. Final Answer:

    hdfs dfs -cat /var/log/hadoop/* | grep ERROR -> Option A
  4. Quick Check:

    Cat all logs + grep ERROR = quick error search [OK]
Quick Trick: Cat all logs then grep ERROR to find errors fast [OK]
Common Mistakes:
  • Using yarn logs without specifying app ID
  • Using ls which lists files, not content
  • Copying logs locally is slower and unnecessary

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Hadoop Quizzes