RAID (Cont)  Several improvements in disk-use techniques involve the use of multiple disks working cooperatively  Disk striping uses a group of disks as one storage unit  RAID schemes improve performance and improve the reliability of the storage system by storing redundant data  Mirroring or shadowing (RAID 1) keeps duplicate of each disk  Striped mirrors (RAID 1+0) or mirrored stripes (RAID 0+1) provides high performance and high reliability  Block interleaved parity (RAID 4, 5, 6) uses much less redundancy  RAID within a storage array can still fail if the array fails, so automatic replication of the data between arrays is common Operating System Concepts with Java – 8th Edition 12.21 Silberschatz, Galvin and Gagne ©2009
View full slide show




RAID (Cont.)  Several improvements in disk-use techniques involve the use of multiple disks working cooperatively  Disk striping uses a group of disks as one storage unit  RAID schemes improve performance and improve the reliability of the storage system by storing redundant data  Mirroring or shadowing (RAID 1) keeps duplicate of each disk  Striped mirrors (RAID 1+0) or mirrored stripes (RAID 0+1) provides high performance and high reliability  Block interleaved parity (RAID 4, 5, 6) uses much less redundancy  RAID within a storage array can still fail if the array fails, so automatic replication of the data between arrays is common  Frequently, a small number of hot-spare disks are left unallocated, automatically replacing a failed disk and having data rebuilt onto them Operating System Concepts Essentials – 8 th Edition 11.33 Silberschatz, Galvin and Gagne ©2011
View full slide show




RAID (Cont.)  Disk striping uses a group of disks as one storage unit  RAID is arranged into six different levels  RAID schemes improve performance and improve the reliability of the storage system by storing redundant data  Mirroring or shadowing (RAID 1) keeps duplicate of each disk  Striped mirrors (RAID 1+0) or mirrored stripes (RAID 0+1) provides high performance and high reliability  Block interleaved parity (RAID 4, 5, 6) uses much less redundancy  RAID within a storage array can still fail if the array fails, so automatic replication of the data between arrays is common  Frequently, a small number of hot-spare disks are left unallocated, automatically replacing a failed disk and having data rebuilt onto them Operating System Concepts Essentials – 2nd Edition 9.35 Silberschatz, Galvin and Gagne ©2013
View full slide show




Redundant Array of Independent Disks (RAID) Data organization on multiple disks Data disk 0 Data disk 1 Data disk 2 Mirror disk 0 Mirror disk 1 RAID0: Multiple disks for higher data rate; no redundancy Mirror disk 2 RAID1: Mirrored disks RAID2: Error-correcting code DataA disk 0 DataB disk 1 DataC disk 2 Data D disk 3 Parity P disk Spare disk RAID3: Bit- or b yte-level striping with parity/checksum disk ABCDP=0 B=ACDP Data 0 Data 1 Data 2 Data 0’ Data 1’ Data 2’ Data 0” Data 1” Data 2” Data 0’” Data 1’” Data 2’” Parity 0 Parity 1 Parity 2 Spare disk RAID4: Parity/checksum applied to sectors,not bits or bytes Data 0 Data 1 Data 2 Data 0’ Data 1’ Data 2’ Data 0” Data 1” Parity 2 Data 0’” Parity 1 Data 2” Parity 0 Data 1’” Data 2’” Spare disk RAID5: Parity/checksum distributed across several disks RAID6: Parity and 2nd check distributed across several disks Fig. 19.5 RAID levels 0-6, with a simplified view of data organization. Computer Architecture, Memory System Design Slide 50
View full slide show




Redundant Array of Inexpensive Disks (RAID) • Goal: achieve reliability through redundancy or increase speed through parallelism • Seven Raid Organizations 0: Non-redundant striping: Parts of data stored on different disks. Group of disks acts as a single storage device 1: Mirrored data: stores (shadows) duplicates of each disk 2: Error correction codes: Parity is spread over a group of dedicated disks 3: Bit interleaved parity: Parity is written to a dedicated disk 4: Block interleaved parity: Parity stored on a disk separate from the data 5: Block-interleaved distributed parity: stripes data and parity across the RAID 6: P + Q redundancy: Parity and data are written, both with redundancy Parity: Information to reconstruct data in case of failure
View full slide show




Use of RAID Technology (contd.)  Different raid organizations are being used under different situations  Raid level 1 (mirrored disks) is the easiest for rebuild of a disk from other disks   Raid level 2 uses memory-style redundancy by using Hamming codes, which contain parity bits for distinct overlapping subsets of components.    Level 2 includes both error detection and correction. Raid level 3 (single parity disks relying on the disk controller to figure out which disk has failed) and level 5 (block-level data striping) are preferred for Large volume storage, with level 3 giving higher transfer rates. Most popular uses of the RAID technology currently are:   It is used for critical applications like logs Level 0 (with striping), Level 1 (with mirroring) and Level 5 with an extra drive for parity. Design Decisions for RAID include:  Level of RAID, number of disks, choice of parity schemes, and grouping of disks for block-level striping. Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 13- 30
View full slide show




RAID        0  data striping on two disks; improved read and write performance, no effect on durability 1  mirroring without parity or striping; PUT writes several replicas of the data and place the replicas on different physical devices 2  the spindles are synchronized and each sequential bit is on a different disk. Hamming code parity stored on parity disks. Very high transfer rates. 3  byte-level striping with dedicated parity; the spindles are synchronized and each sequential byte is on a different disk. Parity calculated across corresponding bytes and stored on a dedicated disk. Very high transfer rates. 4  block-level striping with dedicated parity. 5  block-level striping with distributed parity. 6  block-level striping with double distributed parity. 03/22/2019 Lecture 15 22
View full slide show




18 Redundant Arrays of Disks • Redundant Array of Inexpensive Disks (RAID) Widely available and used in today’s market Files are "striped" across multiple spindles Redundancy yields high data availability despite low reliability Contents of a failed disk is reconstructed from data redundantly stored in the disk array – Drawbacks include capacity penalty to store redundant data and bandwidth penalty to update a disk block – Different levels based on replication level and recovery techniques – – – – RAID level 0 Non-redundant Failures survived 0 Data disks Check disks 8 0 1 Mirrored 1 8 8 2 Memory-style ECC 1 8 4 3 Bit-interleaved parity 1 8 1 4 Block-interleaved 1 8 1 5 Block-interleaved distributed parity 1 8 1
View full slide show




Simple levels of RAID • RAID 0 – Striping • RAID 1 – Mirrored Volumes • RAID 2 – Bit-level striping with parity distributed to one or more disks • RAID 3 – Byte-level striping with dedicated parity disk • RAID 4 – Block-level striping with dedicated parity disk • RAID 5 – Block-level striping with distributed parity • RAID 6 – Block-level striping with distributed double parity
View full slide show




RAID Technology (contd.)  Different raid organizations were defined based on different combinations of the two factors of granularity of data interleaving (striping) and pattern used to compute redundant information.  Raid level 0 has no redundant data and hence has the best write performance at the risk of data loss  Raid level 1 uses mirrored disks.  Raid level 2 uses memory-style redundancy by using Hamming codes, which contain parity bits for distinct overlapping subsets of components. Level 2 includes both error detection and correction.  Raid level 3 uses a single parity disk relying on the disk controller to figure out which disk has failed.  Raid Levels 4 and 5 use block-level data striping, with level 5 distributing data and parity information across all disks.  Raid level 6 applies the so-called P + Q redundancy scheme using Reed-Soloman codes to protect against up to two disk failures by using just two redundant disks. Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 13- 29
View full slide show




Basic Disks (2 of 7) • Basic disks recognize primary and extended partitions • Basic disks also can be configured for any of three RAID levels: • Disk striping (RAID level 0) • Disk mirroring (RAID level 1) • Disk striping with parity (RAID level 5) • RAID stands for redundant array of inexpensive (or independent) disks • A set of standards for lengthening disk life and preventing data loss • Disk striping • The ability to spread data over multiple disks or volumes • Disk mirroring • The practice of creating a mirror image of all data on an original disk, so that the data is fully copied or mirrored to a backup disk © 2018 Cengage. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-protected website for classroom use. 5
View full slide show




RAID: Level 0+1 (Striping with Mirroring) sec1,b0 sec1,b1 sec1 blk2 sec1,b2 sec1,b3 blk3 blk4 sec1,b0 sec1,b1 sec1,b2 sec1,b3 blk1 blk2 blk3 blk4 redundant (check) data  Combines the best of RAID 0 and RAID 1, data is striped across four disks and mirrored to four disks, called “a mirror of stripes” or RAID 01, but may be marketed as “RAID 10”  + Four times the throughput (due to striping)  - # redundant disks = # of data disks, so 2X the cost of one big disk  - writes have to be made to both sets of disks, so writes will be only 1/2 the performance of RAID 0  What if one disk fails?  + If a disk fails, the system just goes to the “mirror” for the data 12/8-10/09 CSE502-F09, Lec 22+23 Disk Storage 21
View full slide show




RAID (Redundant Array of Independent Disks) Technology • There are a number of different disk configurations called RAID levels. – – – – – – – – 11/4/2012 RAID 0 Nonredundant RAID 1 Mirrored RAID 0+1 Nonredundant and Mirrored RAID 2 Memory-Style Error-Correcting Codes RAID 3 Bit-Interleaved Parity RAID 4 Block-Interleaved Parity RAID 5 Block-Interleaved Distributed Parity RAID 6 P+Q Redundancy ISC239 Isabelle Bichindaritz 25
View full slide show




RAID Structure  RAID – redundant array of inexpensive disks  multiple disk drives provides reliability via redundancy  Increases the mean time to failure  Mean time to repair – exposure time when another failure could cause data loss  Mean time to data loss based on above factors  If mirrored disks fail independently, consider disk with 1300,000 mean time to failure and 10 hour mean time to repair  Mean time to data loss is 100, 0002 / (2 ∗ 10) = 500 ∗ 106 hours, or 57,000 years!  Frequently combined with NVRAM to improve write performance  Several improvements in disk-use techniques involve the use of multiple disks working cooperatively Operating System Concepts Essentials – 2nd Edition 9.34 Silberschatz, Galvin and Gagne ©2013
View full slide show




HDFS (Hadoop Distributed File System) is a distr file sys for commodity hdwr. Differences from other distr file sys are few but significant. HDFS is highly fault-tolerant and is designed to be deployed on low-cost hardware. HDFS provides hi thruput access to app data and is suitable for apps that have large data sets. HDFS relaxes a few POSIX requirements to enable streaming access to file system data. HDFS originally was infrastructure for Apache Nutch web search engine project, is part of Apache Hadoop Core http://hadoop.apache.org/core/ 2.1. Hardware Failure Hardware failure is the normal. An HDFS may consist of hundreds or thousands of server machines, each storing part of the file system’s data. There are many components and each component has a non-trivial prob of failure means that some component of HDFS is always non-functional. Detection of faults and quick, automatic recovery from them is core arch goal of HDFS. 2.2. Streaming Data Access Applications that run on HDFS need streaming access to their data sets. They are not general purpose applications that typically run on general purpose file systems. HDFS is designed more for batch processing rather than interactive use by users. The emphasis is on high throughput of data access rather than low latency of data access. POSIX imposes many hard requirements not needed for applications that are targeted for HDFS. POSIX semantics in a few key areas has been traded to increase data throughput rates. 2.3. Large Data Sets Apps on HDFS have large data sets, typically gigabytes to terabytes in size. Thus, HDFS is tuned to support large files. It provides high aggregate data bandwidth and scale to hundreds of nodes in a single cluster. It supports ~10 million files in a single instance. 2.4. Simple Coherency Model: HDFS apps need a write-once-read-many access model for files. A file once created, written, and closed need not be changed. This assumption simplifies data coherency issues and enables high throughput data access. A Map/Reduce application or a web crawler application fits perfectly with this model. There is a plan to support appending-writes to files in future [write once read many at file level] 2.5. “Moving Computation is Cheaper than Moving Data” A computation requested by an application is much more efficient if it is executed near the data it operates on. This is especially true when the size of the data set is huge. This minimizes network congestion and increases the overall throughput of the system. The assumption is that it is often better to migrate the computation closer to where the data is located rather than moving the data to where the app is running. HDFS provides interfaces for applications to move themselves closer to where the data is located. 2.6. Portability Across Heterogeneous Hardware and Software Platforms: HDFS has been designed to be easily portable from one platform to another. This facilitates widespread adoption of HDFS as a platform of choice for a large set of applications. 3. NameNode and DataNodes: HDFS has a master/slave architecture. An HDFS cluster consists of a single NameNode, a master server that manages the file system namespace and regulates access to files by clients. In addition, there are a number of DataNodes, usually one per node in the cluster, which manage storage attached to the nodes that they run on. HDFS exposes a file system namespace and allows user data to be stored in files. Internally, a file is 1 blocks stored in a set of DataNodes. The NameNode executes file system namespace operations like opening, closing, and renaming files and directories. It also determines the mapping of blocks to DataNodes. The DataNodes are responsible for serving read and write requests from the file system’s clients. The DataNodes also perform block creation, deletion, and replication upon instruction The NameNode and DataNode are pieces of software designed to run on commodity machines, typically run GNU/Linux operating system (OS). HDFS is built using the Java language; any machine that supports Java can run the NameNode or the DataNode software. Usage of the highly portable Java language means that HDFS can be deployed on a wide range of machines. A typical deployment has a dedicated machine that runs only the NameNode software. Each of the other machines in the cluster runs one instance of the DataNode software. The architecture does not preclude running multiple DataNodes on the same machine but in a real deployment that is rarely the case. The existence of a single NameNode in a cluster greatly simplifies the architecture of the system. The NameNode is the arbitrator and repository for all HDFS metadata. The system is designed in such a way that user data never flows through the NameNode. 4. The File System Namespace: HDFS supports a traditional hierarchical file organization. A user or an application can create directories and store files inside these directories. The file system namespace hierarchy is similar to most other existing file systems; one can create and remove files, move a file from one directory to another, or rename a file. HDFS does not yet implement user quotas or access permissions. HDFS does not support hard links or soft links. However, the HDFS architecture does not preclude implementing these features. The NameNode maintains the file system namespace. Any change to the file system namespace or its properties is recorded by the NameNode. An application can specify the number of replicas of a file that should be maintained by HDFS. The number of copies of a file is called the replication factor of that file. This info is stored by NameNode. 5. Data Replication: HDFS is designed to reliably store very large files across machines in a large cluster. It stores each file as a sequence of blocks; all blocks in a file except the last block are the same size. The blocks of a file are replicated for fault tolerance. The block size and replication factor are configurable per file. An application can specify the number of replicas of a file. The replication factor can be specified at file creation time and can be changed later. Files in HDFS are write-once and have strictly one writer at any time. The NameNode makes all decisions regarding replication of blocks. It periodically receives a Heartbeat and a Blockreport from each of the DataNodes in the cluster. Receipt of a Heartbeat implies that the DataNode is functioning properly. A Blockreport contains a list of all blocks on a DataNode
View full slide show




RAPTOR Syntax and Semantics - Arrays Array variable - Array variables are used to store many values (of the same type) without having to have many variable names. Instead of many variables names a count-controlled loop is used to gain access (index) the individual elements (values) of an array variable. RAPTOR has one and two dimensional arrays of numbers. A one dimensional array can be thought of as a sequence (or a list). A two dimensional array can be thought of as a table (grid or matrix). To create an array variable in RAPTOR, use it like an array variable. i.e. have an index, ex. Score[1], Values[x], Matrix[3,4], etc. All array variables are indexed starting with 1 and go up to the largest index used so far. RAPTOR array variables grow in size as needed. The assignment statement GPAs[24] ← 4.0 assigns the value 4.0 to the 24th element of the array GPAs. If the array variable GPAs had not been used before then the other 23 elements of the GPAs array are initialized to 0 at the same time. i.e. The array variable GPAs would have the following values: 1 2 3 4… Array variables in action- Arrays and count-controlled loop statements were made for each other. Notice in each example below the connection between the Loop Control Variable and the array index! Notice how the Length_Of function can be used in the count-controlled loop test! Notice that each example below is a count-controlled loop and has an Initialize, Test, Execute, and Modify part (I.T.E.M)! Assigning values to an array variable Reading values into an array variable Writing out an array variable’s values Computing the total and average of an array variable’s values Index ← 1 Index ← 1 Index ← 1 Total ← 0 Loop Loop Loop Index ← 1 PUT “The value of the array at position “ + Index + “ is “ + GPAs[Index] Loop GPAs[Index] ← 4.0 “Enter the GPA of student “” + Index + “: “ GET GPAs[Index] Index >= 24 Index >= 24 Index >= Length_Of (GPAs) Index ← Index + 1 Index ← Index + 1 Index ← Index + 1 Total ← Total + GPAs[Index] Index >= Length_Of(GPAs) Index ← Index + 1 … 23 24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4.0 The initialization of previous elements to 0 happens only when the array variable is created. Successive assignment statements to the GPAs variable affect only the individual element listed. For example, the following successive assignment statements GPAs[20] GPAs[11] ← ← 1.7 3.2 would place the value 1.7 into the 20th position of the array, and would place the value 3.2 into the 11th position of the array. i.e. GPAs[20] ← 1.7 GPAs[11] ← 3.2 1 2 3 4… … 23 24 Initialize the elements of a two dimensional array (A two dimensional array requires two loops) Row ← 1 Loop Average ← Total / Length_Of(GPAs) Find the largest value of all the values in an array variable Find the INDEX of the largest value of all the values in an array variable Highest_GPA ← GPAs[1] Highest_GPA_Index ←1 Index ← 1 Index ← 1 Loop Loop GPAs[Index] > Highest_GPA GPAs[Index] >= GPAs[Highest_GPA_Index] Column ← 1 Loop 0 0 0 0 0 0 0 0 0 0 3.2 0 0 0 0 0 0 0 0 1.7 0 0 0 4.0 An array variable name, like GPAs, refers to ALL elements of the array. Adding an index (position) to the array variable enables you to refer to any specific element of the array variable. Two dimensional arrays work similarly. i.e. Table[7,2] refers to the element in the 7 th row and 2nd column. Individual elements of an array can be used exactly like any other variable. E.g. the array element GPAs[5] can be used anywhere the number variable X can be used. The Length_Of function can be used to determine (and return) the number of elements that are associated with a particular array variable. For example, after all the above, Length_Of(GPAs) is 24. Matrix[Row, Column] ← 1 Column >= 20 Column ← Column + 1 Highest_GPA ← GPAs[Index] Highest_GPA_Index ← Index Index >= Length_Of(GPAs) Index >= Length_Of(GPAs) Index ← Index + 1 Index ← Index + 1 PUT “The highest GPA is “ + Highest_GPA¶ PUT “The highest GPA is “ + GPAs[Highest_GPA_Index] + “ it is at position “ + Highest_GPA_Index¶ Row >= 20 Row ← Row + 1
View full slide show




Nested RAID • RAID 0+1: striped sets in a mirrored set • RAID 10 (or RAID 1+0): mirrored sets in a striped set • RAID 5+1: mirrored striped set with distributed parity (also known as RAID 53) • RAID 5+0: striped set of RAID-5 sets
View full slide show




6. The Persistence of File System Metadata: The HDFS namespace is stored by the NameNode. The NameNode uses a transaction log called the EditLog to persistently record every change that occurs to file system metadata. For example, creating a new file in HDFS causes the NameNode to insert a record into the EditLog indicating this. Similarly, changing the replication factor of a file causes a new record to be inserted into the EditLog. The NameNode uses a file in its local host OS file system to store the EditLog. The entire file system namespace, including the mapping of blocks to files and file system properties, is stored in a file called the FsImage. The FsImage is stored as a file in the NameNode’s local file system too. The NameNode keeps an image of the entire file system namespace and file Blockmap in memory. This key metadata item is designed to be compact, such that a NameNode with 4 GB of RAM is plenty to support a huge number of files and directories. When the NameNode starts up, it reads the FsImage and EditLog from disk, applies all the transactions from the EditLog to the in-memory representation of the FsImage, and flushes out this new version into a new FsImage on disk. It can then truncate the old EditLog because its transactions have been applied to the persistent FsImage. This process is called a checkpoint. In the current implementation, a checkpoint only occurs when the NameNode starts up. Work is in progress to support periodic checkpointing in the near future. The DataNode stores HDFS data in files in its local file system. 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 does not create all files in the same directory. Instead, it uses a heuristic to determine the optimal number of files per directory and creates subdirectories appropriately. It is not optimal to create all local files in the same directory because the local file system might not be able to efficiently support a huge number of files in a single directory. When a DataNode starts up, it scans through its local file system, generates a list of all HDFS data blocks that correspond to each of these local files and sends this report to the NameNode: this is the Blockreport. 7. The Communication Protocols: All HDFS communication protocols are layered on top of the TCP/IP protocol. A client establishes a connection to a configurable TCP port on the NameNode machine. It talks the ClientProtocol with the NameNode. The DataNodes talk to the NameNode using the DataNode Protocol. A Remote Procedure Call (RPC) abstraction wraps both the Client Protocol and the DataNode Protocol. By design, the NameNode never initiates any RPCs. Instead, it only responds to RPC requests issued by DataNodes or clients. 8. Robustness: The primary objective of HDFS is to store data reliably even in the presence of failures. The three common types of failures are NameNode failures, DataNode failures and network partitions. 8.1. Data Disk Failure, Heartbeats and Re-Replication: Each DataNode sends a Heartbeat message to the NameNode periodically. A network partition can cause a subset of DataNodes to lose connectivity with the NameNode. The NameNode detects this condition by the absence of a Heartbeat message. The NameNode marks DataNodes without recent Heartbeats as dead and does not forward any new IO requests to them. Any data that was registered to a dead DataNode is not available to HDFS any more. DataNode death may cause the replication factor of some blocks to fall below their specified value. The NameNode constantly tracks which blocks need to be replicated and initiates replication whenever necessary. The necessity for re-replication may arise due to many reasons: a DataNode may become unavailable, a replica may become corrupted, a hard disk on a DataNode may fail, or the replication factor of a file may be increased. 8.2. Cluster Rebalancing: HDFS arch is compatible with data rebalancing . A scheme might automatically move data from 1 DataNode to another if the free space on a DataNode falls below a certain threshold. In the event of a sudden high demand for a particular file, a scheme might dynamically create additional replicas and rebalance other data in the cluster. These types of data rebalancing schemes are not yet implemented. 8.3. Data Integrity: It is possible that a block of data fetched from a DataNode arrives corrupted. This corruption can occur because of faults in a storage device, network faults, or buggy software. The HDFS client software implements checksum checking on the contents of HDFS files. When a client creates an HDFS file, it computes a checksum of each block of the file and stores these checksums in a separate hidden file in the same HDFS namespace. When a client retrieves file contents it verifies that the data it received from each DataNode matches the checksum stored in the associated checksum file. If not, then the client can opt to retrieve that block from another DataNode that has a replica of that block.
View full slide show




Preamble “Post-amble” Block Execution: 3 Detail Observing Block Observing Block “Post-amble” “Post-amble” 3 Observing Block Observing Block ok Measurement Set ready “Post-amble” EVLA Data Processing PDR Observing Observing Block Block Observing Observing Block Block Failed! Preamble “Post-amble” Preamble ok ?4 5 Preamble ready Preamble Observing Observing Block Block Observing Observing Block Block Observing Block Observing Block Measurement Set “Post-amble” “Post-amble” Preamble Preamble “Post-amble” Measurement Set “Post-amble” “Post-amble” “Post-amble” July 18 - 19, 2002 2 2 Observing Observing Block Block Block Observing Observing Observing Block Block ok Archive: Preamble Observing Block Observing Block 34 ready Preamble “Post-amble” 1 3 Observing Block Observing Observing Block Block Observing Block Observing Observing Block Block ready Preamble Execution: Preamble ready Observing Observing Block Block Observing Observing Block Block Preamble Observing Block Observing Block 22 “Post-amble” “Post-amble” Preamble Preamble 1 “Post-amble” Preamble Input Queue: ok Measurement Set Boyd Waters 13
View full slide show




RAID: Level 3 (Bit-Interleaved Parity) sec1,b0 sec1,b1 sec1,b2 sec1,b3 1 0 1   0 1 (odd) bit parity disk 0 disk fails Cost of higher availability is reduced to 1/N where N is the number of disks in a protection group  # redundant disks = 1 × # of protection groups - writes require writing the new data to the data disk as well as computing the parity, meaning reading the other disks, so that the parity disk can be updated  Can tolerate limited (single) disk failure, since the data can be reconstructed - reads require reading all the operational data disks as well as the parity disk to calculate the missing data that was stored on the failed disk 12/8-10/09 CSE502-F09, Lec 22+23 Disk Storage 24
View full slide show




RAID: Level 2 (Redundancy via Hamming ECC) Checks sec1,b0 sec1,b1 sec1,b2 sec1,b3 4,5,6,7 1 0 1 0 1 3 5 6 0 7 error 4 Checks 2,3,6,7 Checks 1,3,5,7 0 1 2 1 ECC disks ECC disks 4 and 2 point to either data disk 6 or 7 as being bad, but ECC disk 1 says disk 7 is okay, so disk 6 must be in error Why it works. 1 001 2 010 21 011 4 100 4 1 101 42 110 421 111 1 2 3 4 5 6 7 ECC: 421 ECC (Hamming Error Correcting Code) disks contain the even-parity of data on a set of distinct overlapping disks  # ECC redundant disks = log2 (total # of data + ECC disks) so almost twice the cost of one big disk if small # of data disks used. - writes require computing parity to write to “half” the ECC disks - reads require reading “half” the ECC disks and confirming parity  Can tolerate limited disk failure, since the data can be reconstructed; first correction method; no longer used. 12/8-10/09 CSE502-F09, Lec 22+23 Disk Storage 22
View full slide show




RAID: Level 0 (No Redundancy; Striping)  sec1 sec2 sec3 sec4 sec1,b0 sec1,b1 sec1,b2 sec1,b3 Multiple smaller disks as opposed to one big disk  Spreading the sector over multiple disks – striping – means that multiple blocks can be accessed in parallel increasing the performance - A 4 disk system gives four times the throughput of a 1 disk system   Same cost as one big disk – assuming 4 small disks cost the same as one big disk No redundancy, so what if one disk fails?  Failure of one or more disks is more likely as the number of disks in the system increases 12/8-10/09 CSE502-F09, Lec 22+23 Disk Storage 19
View full slide show




RAID: Level 5 (Distributed Block-Interleaved Parity) one of these assigned as the block parity disk  Cost of higher availability still only 1/N but any single parity block may be located on any of the disks so there is no single bottleneck for writes      Still four times the throughput (striping) # redundant disks = 1 × # of protection groups Supports “small reads” and “small writes” (reads and writes that go to just one (or a few) data disk in a protection group) Allows multiple simultaneous writes as long as the accompanying parity blocks are not located on the same disk Can tolerate limited (single) disk failure, since the data can be reconstructed 12/8-10/09 CSE502-F09, Lec 22+23 Disk Storage 27
View full slide show




RAID Volumes (1 of 4) • RAID is a set of standards for lengthening disk life, preventing data loss, and enabling relatively uninterrupted access to data • Windows Server 2016 supports RAID levels 0, 1, and 5 • RAID level 0 • Striping with no other redundancy features (such as no parity or mirroring) • RAID level 0 is not recommended in many situations because it does not really provide fault tolerance • RAID level 1 • Disk duplexing is the same as disk mirroring, with the exception that it places the backup disk on a different controller or adapter than is used by the main disk • RAID level 5 • Combines the best features of RAID, including striping, error correction, and checksum verification © 2018 Cengage. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-protected website for classroom use. 22
View full slide show




Mike Meyers’ CompTIA A+® Guide to Managing and Troubleshooting PCs Fifth Edition RAID (continued) • RAID 10—nested, striped mirrors – “Stripe of mirrors” – 1 pair of mirrored disks, and another pair mirrors the first pair • RAID 0+1—nested, mirrored stripes – Start with two RAID 0 striped arrays, then mirror the two arrays to each other Copyright © 2016 by McGraw-Hill Education. All rights reserved. Copyright Copyright © 2016 by©McGraw-Hill 2016 by McGraw-Hill Education.Education. All rights reserved. All rights reserved. Copyright © 2016 by McGraw-Hill Education. All rights reserved.
View full slide show




8.4. Metadata Disk Failure: The FsImage and EditLog are central data structures. A corruption of these files can cause the HDFS instance to be non-functional. For this reason, the NameNode can be configured to support maintaining multiple copies of the FsImage and EditLog. Any update to either the FsImage or EditLog causes each of the FsImages and EditLogs to get updated synchronously. This synchronous updating of multiple copies of the FsImage and EditLog may degrade the rate of namespace transactions per second that a NameNode can support. However, this degradation is acceptable because even though HDFS applications are very data intensive in nature, they are not metadata intensive. When a NameNode restarts, it selects the latest consistent FsImage and EditLog to use. The NameNode machine is a single point of failure for an HDFS cluster. If the NameNode machine fails, manual intervention is necessary. Currently, automatic restart and failover of the NameNode software to another machine is not supported. 8.5. Snapshots: Snapshots support storing a copy of data at a particular instant of time. One usage of the snapshot feature may be to roll back a corrupted HDFS instance to a previously known good point in time. HDFS does not currently support snapshots but will in a future release. 9. Data Organization 9.1. Data Blocks: HDFS is designed to support very large files. Applications that are compatible with HDFS are those that deal with large data sets. These applications write their data only once but they read it one or more times and require these reads to be satisfied at streaming speeds. HDFS supports write-once-read-many semantics on files. A typical block size used by HDFS is 64 MB. Thus, an HDFS file is chopped up into 64 MB chunks, and if possible, each chunk will reside on a different DataNode. 9.2. Staging: A client request to create a file does not reach the NameNode immediately. In fact, initially the HDFS client caches the file data into a temporary local file. Application writes are transparently redirected to this temporary local file. When the local file accumulates data worth over one HDFS block size, the client contacts the NameNode. The NameNode inserts the file name into the file system hierarchy and allocates a data block for it. The NameNode responds to the client request with the identity of the DataNode and the destination data block. Then the client flushes the block of data from the local temporary file to the specified DataNode. When a file is closed, the remaining un-flushed data in the temporary local file is transferred to the DataNode. The client then tells the NameNode that the file is closed. At this point, the NameNode commits the file creation operation into a persistent store. If the NameNode dies before the file is closed, the file is lost. The above approach has been adopted after careful consideration of target applications that run on HDFS. These applications need streaming writes to files. If a client writes to a remote file directly without any client side buffering, the network speed and the congestion in the network impacts throughput considerably. This approach is not without precedent. Earlier distributed file systems, e.g. AFS, have used client side caching to improve performance. A POSIX requirement has been relaxed to achieve higher performance of data uploads. 9.3. Replication Pipelining: When a client is writing data to an HDFS file, its data is first written to a local file as explained in the previous section. Suppose the HDFS file has a replication factor of three. When the local file accumulates a full block of user data, the client retrieves a list of DataNodes from the NameNode. This list contains the DataNodes that will host a replica of that block. The client then flushes the data block to the first DataNode. The first DataNode starts receiving the data in small portions (4 KB), writes each portion to its local repository and transfers that portion to the second DataNode in the list. The second DataNode, in turn starts receiving each portion of the data block, writes that portion to its repository and then flushes that portion to the third DataNode. Finally, the third DataNode writes the data to its local repository. Thus, a DataNode can be receiving data from the previous one in the pipeline and at the same time forwarding data to the next one in the pipeline. Thus, the data is pipelined from one DataNode to the next.
View full slide show




RAID: Level 4 (Block-Interleaved Parity) sec1 sec2 sec3 sec4 block parity disk  Cost of higher availability still only 1/N but the parity is stored as blocks associated with sets of data blocks    Four times the throughput (striping) # redundant disks = 1 × # of protection groups Supports “small reads” and “small writes” (reads and writes that go to just one (or a few) data disk in a protection group) - by watching which bits change when writing new information, need only to change the corresponding bits on the parity disk - the parity disk must be updated on every write, so it is a bottleneck for back-to-back writes  Can tolerate limited (single) disk failure, since the data can be reconstructed 12/8-10/09 CSE502-F09, Lec 22+23 Disk Storage 25
View full slide show




5.1. Replica Placement: The First Baby Steps: The placement of replicas is critical to HDFS reliability and performance. Optimizing replica placement distinguishes HDFS from most other distributed file systems. This is a feature that needs lots of tuning and experience. The purpose of a rack-aware replica placement policy is to improve data reliability, availability, and network bandwidth utilization. The current implementation for the replica placement policy is a first effort in this direction. The short-term goals of implementing this policy are to validate it on production systems, learn more about its behavior, and build a foundation to test and research more sophisticated policies. Large HDFS instances run on a cluster of computers that commonly spread across many racks. Communication between two nodes in different racks has to go through switches. In most cases, network bandwidth between machines in the same rack is greater than network bandwidth between machines in different racks. The NameNode determines the rack id each DataNode belongs to via the process outlined in Rack Awareness: A simple but non-optimal policy is to place replicas on unique racks. This prevents losing data when an entire rack fails and allows use of bandwidth from multiple racks when reading data. This policy evenly distributes replicas in the cluster which makes it easy to balance load on component failure. However, this policy increases the cost of writes because a write needs to transfer blocks to multiple racks. For the common case, when the replication factor is three, HDFS’s placement policy is to put one replica on one node in the local rack, another on a different node in the local rack, and the last on a different node in a different rack. This policy cuts the inter-rack write traffic which generally improves write performance. The chance of rack failure is far less than that of node failure; this policy does not impact data reliability and availability guarantees. However, it does reduce the aggregate network bandwidth used when reading data since a block is placed in only two unique racks rather than three. With this policy, the replicas of a file do not evenly distribute across the racks. One third of replicas are on one node, two thirds of replicas are on one rack, and the other third are evenly distributed across the remaining racks. This policy improves write performance without compromising data reliability or read performance. The current, default replica placement policy described here is a work in progress. 5.2. Replica Selection: To minimize global bandwidth consumption and read latency, HDFS tries to satisfy a read request from a replica that is closest to the reader. If there exists a replica on the same rack as the reader node, then that replica is preferred to satisfy the read request. If angg/ HDFS cluster spans multiple data centers, then a replica that is resident in the local data center is preferred over any remote replica. 5.3. Safemode: On startup, the NameNode enters a special state called Safemode. Replication of data blocks does not occur when the NameNode is in the Safemode state. The NameNode receives Heartbeat and Blockreport messages from the DataNodes. A Blockreport contains the list of data blocks that a DataNode is hosting. Each block has a specified minimum number of replicas. A block is considered safely replicated when the minimum number of replicas of that data block has checked in with the NameNode. After a configurable percentage of safely replicated data blocks checks in with the NameNode (plus an additional 30 seconds), the NameNode exits the Safemode state. It then determines the list of data blocks (if any) that still have fewer than the specified # of replicas. NameNode then replicates blocks to other DataNodes. Distributed Databases Hadoop Computing Model Notion of trans: unit of work ACID props, CC Notion of jobL unit work No CC Data Model Struct data w known schema Read/Write mode Any data any format ReadOnly mode Cost Model - Expensive servers Cheap commodity mach Fault Tolerance - Failures are rare Recovery mechanisms Failure common ~1000s Simple efficient fault tol KeyCharacteristi Effic, optimizatns, fine-tuning Scalability, flex, fault tol Bigger Picture: Hadoop vs. Other Systems Cloud Computing Compute model where any compute infrastructure can run on cloud Hardware & Software provided as remote services Elastic: grows/shrinks based on user’s demand Example: Amazon EC2
View full slide show




RAID: Level 1 (Redundancy via Mirroring) sec1 sec2 sec3 sec4 sec1 sec2 sec3 sec4 redundant (check) data  Uses twice as many disks as RAID 0 (e.g., 8 smaller disks with the second set of 4 duplicating the first set) so there are always two copies of the data  # redundant disks = # of data disks so twice the cost of one big disk - writes have to be made to both sets of disks, so writes will be only 1/2 the performance of a RAID 0  What if one disk fails?  If a disk fails, the system just goes to the “mirror” for the data 12/8-10/09 CSE502-F09, Lec 22+23 Disk Storage 20
View full slide show




RAID: Level 3 (Bit-Interleaved Parity) sec1,b0 sec1,b1 sec1,b2 sec1,b3 1 0 1   0 (odd) bit parity disk Cost of higher availability is reduced to 1/N where N is the number of disks in a protection group  # redundant disks = 1 × # of protection groups - writes require writing the new data to the data disk as well as computing the parity, meaning reading the other disks, so that the parity disk can be updated  Can tolerate limited (single) disk failure, since the data can be reconstructed - reads require reading all the operational data disks as well as the parity disk to calculate the missing data that was stored on the failed disk 12/8-10/09 CSE502-F09, Lec 22+23 Disk Storage 23
View full slide show




Summary: RAID Techniques: Goal was performance, popularity due to reliability of storage • Disk Mirroring, Shadowing (RAID 1) Each disk is fully duplicated onto its "shadow" Logical write = two physical writes 100% capacity overhead • Parity Data Bandwidth Array (RAID 3) Parity computed horizontally Logically a single high data bw disk 1 0 0 1 0 0 1 1 1 0 0 1 0 0 1 1 1 0 0 1 0 0 1 1 1 1 0 0 1 1 0 1 1 0 0 1 0 0 1 1 0 0 1 1 0 0 1 0 • High I/O Rate Parity Array (RAID 5) Interleaved parity blocks Independent reads and writes Logical write = 2 reads + 2 writes 03/24/19 24
View full slide show