Bird
Raised Fist0
Hadoopdata~5 mins

Rack awareness in HDFS in Hadoop - Cheat Sheet & Quick Revision

Choose your learning style10 modes available
Recall & Review
beginner
What is rack awareness in HDFS?
Rack awareness is a feature in HDFS that helps the system know which data nodes are located on which racks. This helps HDFS place data blocks in a way that improves fault tolerance and network bandwidth usage.
Click to reveal answer
beginner
Why does HDFS use rack awareness when storing data?
HDFS uses rack awareness to reduce the risk of data loss by storing copies of data blocks on different racks. This way, if one rack fails, data is still available from another rack.
Click to reveal answer
intermediate
How does rack awareness improve network efficiency in HDFS?
By knowing the rack location of data nodes, HDFS can place replicas to minimize cross-rack network traffic. It prefers to read data from the same rack to reduce network congestion and improve speed.
Click to reveal answer
intermediate
What happens if rack awareness is not configured in HDFS?
If rack awareness is not configured, HDFS treats all nodes as if they are on the same rack. This can lead to placing all replicas on the same rack, increasing risk of data loss if that rack fails.
Click to reveal answer
advanced
How does HDFS decide where to place replicas using rack awareness?
HDFS places one replica on the local node, another on a different node in a different rack, and the third on a different node in the same rack as the first replica. This balances fault tolerance and network efficiency.
Click to reveal answer
What is the main purpose of rack awareness in HDFS?
ATo encrypt data for security
BTo speed up data processing by using GPUs
CTo improve fault tolerance by spreading replicas across racks
DTo compress data blocks for storage
If rack awareness is not set, what risk increases in HDFS?
AData will be duplicated too many times
BData will be encrypted incorrectly
CData nodes will run out of memory
DData blocks may be lost if a rack fails
How many racks does HDFS try to use when placing three replicas of a block?
ATwo racks
BOne rack only
CThree racks
DFour racks
Which of these is NOT a benefit of rack awareness?
AReduced cross-rack network traffic
BFaster data encryption
CImproved fault tolerance
DBetter data locality
What information does HDFS need to implement rack awareness?
AMapping of data nodes to racks
BCPU speed of each node
CDisk size of each node
DUser access permissions
Explain how rack awareness helps improve fault tolerance and network efficiency in HDFS.
Think about how spreading data copies across racks helps keep data safe and speeds up access.
You got /4 concepts.
    Describe what could happen if rack awareness is not configured in an HDFS cluster.
    Consider the risks of not knowing where nodes are physically located.
    You got /4 concepts.

      Practice

      (1/5)
      1. What is the main purpose of rack awareness in HDFS?
      easy
      A. To place data replicas on different racks to improve fault tolerance
      B. To store all data replicas on the same rack for faster access
      C. To reduce the number of data replicas stored in the cluster
      D. To encrypt data before storing it in HDFS

      Solution

      1. Step 1: Understand rack awareness concept

        Rack awareness means placing data copies on different racks to avoid data loss if one rack fails.
      2. Step 2: Identify the main goal

        The goal is to improve fault tolerance by spreading replicas across racks.
      3. Final Answer:

        To place data replicas on different racks to improve fault tolerance -> Option A
      4. Quick Check:

        Rack awareness = fault tolerance [OK]
      Hint: Think about protecting data from rack failures [OK]
      Common Mistakes:
      • Assuming all replicas are on the same rack
      • Confusing rack awareness with encryption
      • Thinking rack awareness reduces replica count
      2. Which of the following is the correct way to configure rack awareness in HDFS?
      easy
      A. Implement a script that maps nodes to racks and set net.topology.script.file.name
      B. Disable rack awareness by setting dfs.rack.awareness.enabled to false
      C. Set the property dfs.replication to 1
      D. Use hdfs dfs -put command with rack option

      Solution

      1. Step 1: Identify rack awareness configuration

        Rack awareness requires a script that maps nodes to racks.
      2. Step 2: Recognize the correct property

        The property net.topology.script.file.name points to this script.
      3. Final Answer:

        Implement a script that maps nodes to racks and set net.topology.script.file.name -> Option A
      4. Quick Check:

        Rack mapping script = net.topology.script.file.name [OK]
      Hint: Rack awareness needs a node-to-rack mapping script [OK]
      Common Mistakes:
      • Setting replication to 1 disables replication, not rack awareness
      • Using HDFS commands with rack options (not supported)
      • Disabling rack awareness removes its benefits
      3. Given a Hadoop cluster with 3 racks and replication factor 3, how does HDFS place replicas for a block?
      medium
      A. One replica on the local node, and the other two on different racks
      B. Replicas are placed randomly without rack consideration
      C. All 3 replicas on the same rack
      D. One replica on the local node, one on a different rack, and one on the same rack but different node

      Solution

      1. Step 1: Recall HDFS replica placement policy

        HDFS places one replica on the local node, one replica on a different rack, and the third replica on the same rack but a different node to balance fault tolerance and network usage.
      2. Step 2: Apply to 3 racks and replication factor 3

        One replica is local, one is on a different rack, and the third is on the same rack but different node.
      3. Final Answer:

        One replica on the local node, one on a different rack, and one on the same rack but different node -> Option D
      4. Quick Check:

        Replica placement = local + different rack + same rack different node [OK]
      Hint: One local replica, one different rack, one same rack different node [OK]
      Common Mistakes:
      • Placing all replicas on the same rack
      • Placing two replicas on the same rack as local
      • Ignoring rack awareness in placement
      4. You configured rack awareness but notice all replicas are stored on the same rack. What is the likely cause?
      medium
      A. Replication factor is set to 1
      B. The rack awareness script is missing or misconfigured
      C. HDFS does not support rack awareness
      D. Data nodes are all physically on the same rack

      Solution

      1. Step 1: Check rack awareness setup

        If all replicas are on the same rack, the rack awareness script might be missing or incorrect, so HDFS cannot identify racks properly.
      2. Step 2: Rule out other causes

        Replication factor 1 means only one replica, so multiple replicas on same rack is not possible. HDFS supports rack awareness. If all nodes are on the same rack physically, then placement is expected.
      3. Final Answer:

        The rack awareness script is missing or misconfigured -> Option B
      4. Quick Check:

        Missing script = replicas on same rack [OK]
      Hint: Check rack script if replicas cluster on one rack [OK]
      Common Mistakes:
      • Assuming replication factor 1 causes multiple replicas
      • Ignoring physical rack layout
      • Believing HDFS lacks rack awareness support
      5. In a cluster with only two racks and replication factor 3, how does HDFS handle rack awareness when placing replicas?
      hard
      A. Places replicas randomly ignoring rack awareness due to limited racks
      B. Places all replicas on the same rack because there are only two racks
      C. Places one replica on each rack and the third replica on any rack to maximize availability
      D. Fails to store replicas because rack count is less than replication factor

      Solution

      1. Step 1: Understand rack awareness with limited racks

        When racks are fewer than replication factor, HDFS tries to spread replicas across racks as much as possible.
      2. Step 2: Apply to 2 racks and replication factor 3

        HDFS places one replica on each rack, and the third replica on any rack to ensure three copies exist.
      3. Final Answer:

        Places one replica on each rack and the third replica on any rack to maximize availability -> Option C
      4. Quick Check:

        Limited racks = spread as much as possible [OK]
      Hint: With fewer racks, spread replicas as much as possible [OK]
      Common Mistakes:
      • Thinking all replicas must be on different racks always
      • Assuming failure if racks < replication factor
      • Ignoring partial rack spreading
      Recommended

      Ready to prove it?

      Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

      10 questions~5 mineasy hard