儲存空間直接存取中的容錯和儲存效率Fault tolerance and storage efficiency in Storage Spaces Direct

適用於︰WindowsServer 2016Applies To: Windows Server 2016

本主題介紹儲存空間直接存取中可用的復原選項,並概述各選項的規模需求、儲存效率,以及一般的優點和取捨。This topic introduces the resiliency options available in Storage Spaces Direct and outlines the scale requirements, storage efficiency, and general advantages and tradeoffs of each. 文中也會提供一些使用上的指示供您入門,並且會參考一些可讓您進行深入了解的優質文章、部落格和其他內容。It also presents some usage instructions to get you started, and references some great papers, blogs, and additional content where you can learn more.

如果您已熟悉儲存空間,您可以跳到摘要一節。If you are already familiar with Storage Spaces, you may want to skip to the Summary section.

概觀Overview

事實上,儲存空間是要為您的資料提供容錯 (通常稱為「復原」)。At its heart, Storage Spaces is about providing fault tolerance, often called 'resiliency', for your data. 其實作類似 RAID,但差在會分散於伺服器,並實作於軟體中。Its implementation is similar to RAID, except distributed across servers and implemented in software.

和 RAID 一樣,儲存空間有幾個不同方式可執行此操作,這些方式會在容錯、儲存效率與計算複雜度之間做出不同取捨。As with RAID, there are a few different ways Storage Spaces can do this, which make different tradeoffs between fault tolerance, storage efficiency, and compute complexity. 其大致分為兩種類別:「鏡像」和「同位」,後者有時也稱為「清除編碼」。These broadly fall into two categories: 'mirroring' and 'parity', the latter sometimes called 'erasure coding'.

鏡像Mirroring

鏡像會藉由為所有資料保留多個複本來提供容錯。Mirroring provides fault tolerance by keeping multiple copies of all data. 其行為最像 RAID-1。This most closely resembles RAID-1. 資料如何等量分割和放置是相當複雜的 (請參閱這篇部落格文章以深入了解),但絕對正確的說法是:使用鏡像儲存的任何資料都會完整地撰寫多次。How that data is striped and placed is non-trivial (see this blog to learn more), but it is absolutely true to say that any data stored using mirroring is written, in its entirety, multiple times. 每個複本都會寫入到應該只會個別發生故障的不同實體硬體 (不同伺服器中的不同磁碟機)。Each copy is written to different physical hardware (different drives in different servers) that are assumed to fail independently.

在 WindowsServer 2016 中,儲存空間會提供兩種鏡像:「雙向」和「三向」。In Windows Server 2016, Storage Spaces offers two flavors of mirroring – 'two-way' and 'three-way'.

雙向鏡像Two-way mirror

雙向鏡像會為所有內容寫入兩個複本。Two-way mirroring writes two copies of everything. 其儲存效率是 50%,因此若要撰寫 1 TB 的資料,您會需要至少 2 TB 的實體儲存容量。Its storage efficiency is 50% – to write 1 TB of data, you need at least 2 TB of physical storage capacity. 同樣地,您也需要至少兩個硬體「容錯網域」,在使用儲存空間直接存取時,這表示需要兩部伺服器。Likewise, you need at least two hardware 'fault domains' – with Storage Spaces Direct, that means two servers.

雙向鏡像

警告

如果您有兩個以上伺服器,建議您改為使用三向鏡像。If you have more than two servers, we recommend using three-way mirorring instead.

三向鏡像Three-way mirror

三向鏡像會為所有內容寫入三個複本。Three-way mirroring writes three copies of everything. 其儲存效率是 33.3%,因此若要撰寫 1 TB 的資料,您會需要至少 3 TB 的實體儲存容量。Its storage efficiency is 33.3% – to write 1 TB of data, you need at least 3 TB of physical storage capacity. 同樣地,您也需要至少三個硬體「容錯網域」,在使用儲存空間直接存取時,這表示需要三部伺服器。Likewise, you need at least three hardware fault domains – with Storage Spaces Direct, that means three servers.

三向鏡像可安全地一次容許至少兩個硬體問題(磁碟機或伺服器)Three-way mirroring can safely tolerate at least two hardware problems (drive or server) at a time. 例如,如果您重新開機一部伺服器,同時突然另一部磁碟機或伺服器故障,所有資料會保持安全,持續可供存取。For example, if you're rebooting one server when suddenly another drive or server fails, all data remains safe and continuously accessible.

three-way-mirror

同位Parity

同位編碼 (通常稱為「清除編碼」) 會使用位元算術提供容錯,而這會變得非常複雜Parity encoding, often called 'erasure coding', provides fault tolerance using bitwise arithmetic, which can get remarkably complicated. 相較於鏡像,同位的運作方式較不容易理解,但有許多絕佳的線上資源 (例如,這個由第三方提供的清除編碼傻瓜指南) 可協助您了解。The way this works is less obvious than mirroring, and there are many great online resources (for example, this third-party Dummies Guide to Erasure Coding) that can help you get the idea. 可以這麼說,它提供更好的儲存效率,卻又不會犧牲容錯能力。Sufficed to say it provides better storage efficiency without compromising fault tolerance.

在 WindowsServer 2016 中,儲存空間會提供兩種同位:「單同位」和「雙同位」,後者採用稱為「本機重建程式碼」的較大規模進階技術。In Windows Server 2016, Storage Spaces offers two flavors of parity – 'single' parity and 'dual' parity, the latter employing an advanced technique called 'local reconstruction codes' at larger scales.

重要

我們建議使用鏡像處理大部分易受效能影響的工作負載。We recommend using mirroring for most performance-sensitive workloads. 若要深入了解如何根據您的工作負載來平衡效能與產能,請參閱規劃磁碟區To learn more about how to balance performance and capacity depending on your workload, see Plan volumes.

單同位Single parity

單同位只會保留一個位元同位符號,因此一次只能對一個故障提供容錯。Single parity keeps only one bitwise parity symbol, which provides fault tolerance against only one failure at a time. 其行為最像 RAID-5。It most closely resembles RAID-5. 若要使用單同位,您需要至少三個硬體「容錯網域」,在使用儲存空間直接存取時,這表示需要三部伺服器。To use single parity, you need at least three hardware fault domains – with Storage Spaces Direct, that means three servers. 因為三向鏡像可在相同規模提供更多容錯能力,我們不建議您使用單同位。Because three-way mirroring provides more fault tolerance at the same scale, we discourage using single parity. 但如果您堅持要使用也沒問題,而且會受到完全支援。But, it's there if you insist on using it, and it is fully supported.

警告

我們不建議使用單同位,因為它一次只能安全地容許一個硬體故障:如果您重新開機一部伺服器,同時突然另一部磁碟機或伺服器故障,就會發生停機。We discourage using single parity because it can only safely tolerate one hardware failure at a time: if you're rebooting one server when suddenly another drive or server fails, you will experience downtime. 如果您只有三部伺服器,建議您使用三向鏡像。If you only have three servers, we recommend using three-way mirroring. 如果您有四部以上,請參閱下一節。If you have four or more, see the next section.

雙同位Dual parity

雙同位會實作 Reed-Solomon 錯誤修正程式碼以保留兩個位元同位符號,進而提供和三向鏡像相同的容錯能力 (也就是一次最多兩個故障),但此方式擁有更好的儲存效率。Dual parity implements Reed-Solomon error-correcting codes to keep two bitwise parity symbols, thereby providing the same fault tolerance as three-way mirroring (i.e. up to two failures at once), but with better storage efficiency. 其行為最像 RAID-6。It most closely resembles RAID-6. 若要使用雙同位,您需要至少四個硬體「容錯網域」,在使用儲存空間直接存取時,這表示需要四部伺服器。To use dual parity, you need at least four hardware fault domains – with Storage Spaces Direct, that means four servers. 在此規模下,其儲存效率是 50%,因此若要儲存 2 TB 的資料,您需要至少 4 TB 的實體儲存容量。At that scale, the storage efficiency is 50% – to store 2 TB of data, you need 4 TB of physical storage capacity.

dual-parity

雙同位的儲存效率會讓您增加更多硬體容錯網域 (從 50% 增加為 80%)。The storage efficiency of dual parity increases the more hardware fault domains you have, from 50% up to 80%. 例如,在七個時 (在使用儲存空間直接存取時,這表示需要七部伺服器),效率會躍升至 66.7%,若要儲存 4 TB 資料,您只需要 6 TB 的實體儲存容量。For example, at seven (with Storage Spaces Direct, that means seven servers) the efficiency jumps to 66.7% – to store 4 TB of data, you need just 6 TB of physical storage capacity.

dual-parity-wide

如需各種規模的雙同位效率和本機重建程式碼,請參閱摘要一節。See the Summary section for the efficiency of dual party and local reconstruction codes at every scale.

本機重建程式碼Local reconstruction codes

WindowsServer 2016 的儲存空間引進了 Microsoft Research 所開發的進階技術,其名稱為「本機重建程式碼」,簡稱 LRC。Storage Spaces in Windows Server 2016 introduces an advanced technique developed by Microsoft Research called 'local reconstruction codes', or LRC. 在大規模的環境中,雙同位會使用 LRC 將其編碼/解碼分割為幾個較小的群組,以降低進行寫入或從故障中復原所需的負荷。At large scale, dual parity uses LRC to split its encoding/decoding into a few smaller groups, to reduce the overhead required to make writes or recover from failures.

使用硬碟 (HDD) 時,群組大小是四個符號;使用固態硬碟 (SSD) 時,群組大小是六個符號。With hard disk drives (HDD) the group size is four symbols; with solid-state drives (SSD), the group size is six symbols. 例如,以下是具有硬碟和 12 個硬體容錯網域 (亦即 12 部伺服器) 之配置的可能樣貌,其中有兩組四個一群的資料符號。For example, here's what the layout looks like with hard disk drives and 12 hardware fault domains (meaning 12 servers) – there are two groups of four data symbols. 此方式可達到 72.7% 儲存效率。It achieves 72.7% storage efficiency.

local-reconstruction-codes

建議您閱讀這篇深入淺出的逐步解說:本機重建程式碼如何處理各種故障案例,以及它們吸引人的原因,作者是我們公司的 Claus JoergensenWe recommend this in-depth yet eminently readable walk-through of how local reconstruction codes handle various failure scenarios, and why they're appealing, by our very own Claus Joergensen.

鏡像加速的同位Mirror-accelerated parity

從 Windows Server 2016 起,一個儲存空間直接存取磁碟區可以部分鏡像、部分同位。Beginning in Windows Server 2016, a Storage Spaces Direct volume can be part mirror and part parity. 寫入首先登陸鏡像部分,稍後逐漸移動至同位部分。Writes land first in the mirrored portion and are gradually moved into the parity portion later. 實際上,這是使用鏡像加速清除編碼Effectively, this is using mirroring to accelerate erasure coding.

若要混合使用三向鏡像與雙同位,您需要至少四個容錯網域,亦即四部伺服器。To mix three-way mirror and dual parity, you need at least four fault domains, meaning four servers.

鏡像加速同位的儲存效率介於全部使用鏡像與全部使用同位之間,並取決於您選擇的混合比例。The storage efficiency of mirror-accelerated parity is in between what you'd get from using all mirror or all parity, and depends on the proportions you choose. 例如,本簡報 37 分鐘處的示範顯示具有 12 部伺服器、達到 46%、54% 和 65% 效率的各種混合For example, the demo at the 37-minute mark of this presentation shows various mixes achieving 46%, 54%, and 65% efficiency with 12 servers.

重要

我們建議使用鏡像處理大部分易受效能影響的工作負載。We recommend using mirroring for most performance-sensitive workloads. 若要深入了解如何根據您的工作負載來平衡效能與產能,請參閱規劃磁碟區To learn more about how to balance performance and capacity depending on your workload, see Plan volumes.

摘要Summary

本節摘要說明儲存空間直接存取中可用的復原類型、使用各種類型的最小規模需求、每種類型可容許多少故障,以及對應的儲存效率。This section summarizes the resiliency types available in Storage Spaces Direct, the minimum scale requirements to use each type, how many failures each type can tolerate, and the corresponding storage efficiency.

復原類型Resiliency types

復原Resiliency 容錯Failure tolerance 儲存效率Storage efficiency
雙向鏡像Two-way mirror 11 50.0%50.0%
三向鏡像Three-way mirror 22 33.3%33.3%
雙同位Dual parity 22 50.0% - 80.0%50.0% - 80.0%
混合式Mixed 22 33.3% - 80.0%33.3% - 80.0%

最小規模需求Minimum scale requirements

復原Resiliency 最小必要容錯網域Minimum required fault domains
雙向鏡像Two-way mirror 22
三向鏡像Three-way mirror 33
雙同位Dual parity 44
混合式Mixed 44

提示

除非您使用底座或機架容錯,否則容錯網域的數目就是指伺服器數目。Unless you are using chassis or rack fault tolerance, the number of fault domains refers to the number of servers. 只要您符合儲存空間直接存取的最小需求,每部伺服器中的磁碟機數目就不會影響您所能使用的復原類型。The number of drives in each server does not affect which resiliency types you can use, as long as you meet the minimum requirements for Storage Spaces Direct.

混合式部署的雙同位效率Dual parity efficiency for hybrid deployments

下表顯示同時包含硬碟 (HDD) 和固態硬碟 (SSD) 的混合式部署中,雙同位和本機重建程式碼在各種規模的儲存效率。This table shows the storage efficiency of dual parity and local reconstruction codes at each scale for hybrid deployments which contain both hard disk drives (HDD) and solid-state drives (SSD).

容錯網域Fault domains 配置Layout 效率Efficiency
22
33
44 RS 2+2RS 2+2 50.0%50.0%
55 RS 2+2RS 2+2 50.0%50.0%
66 RS 2+2RS 2+2 50.0%50.0%
77 RS 4+2RS 4+2 66.7%66.7%
88 RS 4+2RS 4+2 66.7%66.7%
99 RS 4+2RS 4+2 66.7%66.7%
1010 RS 4+2RS 4+2 66.7%66.7%
1111 RS 4+2RS 4+2 66.7%66.7%
1212 LRC (8, 2, 1)LRC (8, 2, 1) 72.7%72.7%
1313 LRC (8, 2, 1)LRC (8, 2, 1) 72.7%72.7%
1414 LRC (8, 2, 1)LRC (8, 2, 1) 72.7%72.7%
1515 LRC (8, 2, 1)LRC (8, 2, 1) 72.7%72.7%
1616 LRC (8, 2, 1)LRC (8, 2, 1) 72.7%72.7%

全快閃部署的雙同位效率Dual parity efficiency for all-flash deployments

下表顯示只包含固態硬碟 (SSD) 的全快閃部署中,雙同位和本機重建程式碼在各種規模的儲存效率。This table shows the storage efficiency of dual parity and local reconstruction codes at each scale for all-flash deployments which contain only solid-state drives (SSD). 在全快閃組態中,同位配置可使用較大的群組大小,並達到更好的儲存效率。The parity layout can use larger group sizes and achieve better storage efficiency in an all-flash configuration.

容錯網域Fault domains 配置Layout 效率Efficiency
22
33
44 RS 2+2RS 2+2 50.0%50.0%
55 RS 2+2RS 2+2 50.0%50.0%
66 RS 2+2RS 2+2 50.0%50.0%
77 RS 4+2RS 4+2 66.7%66.7%
88 RS 4+2RS 4+2 66.7%66.7%
99 RS 6+2RS 6+2 75.0%75.0%
1010 RS 6+2RS 6+2 75.0%75.0%
1111 RS 6+2RS 6+2 75.0%75.0%
1212 RS 6+2RS 6+2 75.0%75.0%
1313 RS 6+2RS 6+2 75.0%75.0%
1414 RS 6+2RS 6+2 75.0%75.0%
1515 RS 6+2RS 6+2 75.0%75.0%
1616 LRC (12, 2, 1)LRC (12, 2, 1) 80.0%80.0%

範例Examples

除非您只有兩部伺服器,否則建議您使用三向鏡像和/或雙同位,因為它們提供較好的容錯能力。Unless you have only two servers, we recommend using three-way mirroring and/or dual parity, because they offer better fault tolerance. 具體而言,它們可確保即使兩個錯誤網域 (在使用儲存空間直接存取時,這表示兩部伺服器) 都受到同時故障的影響,所有資料仍可保持安全並持續可供存取。Specifically, they ensure that all data remains safe and continuously accessible even when two fault domains – with Storage Spaces Direct, that means two servers - are affected by simultaneous failures.

全都保持上線的範例Examples where everything stays online

這六個範例示範三向鏡像和/或雙同位可以容許的情形。These six examples show what three-way mirroring and/or dual parity can tolerate.

  • 1. 失去一個磁碟機 (包括快取磁碟機)1. One drive lost (includes cache drives)
  • 2. 失去一部伺服器2. One server lost

fault-tolerance-examples-1-and-2

  • 3. 失去一部伺服器和一個磁碟機3. One server and one drive lost
  • 4. 失去不同伺服器中的兩個磁碟機4. Two drives lost in different servers

fault-tolerance-examples-3-and-4

  • 5. 只要最多兩部伺服器受到影響,就會失去兩個以上的磁碟機5. More than two drives lost, so long as at most two servers are affected
  • 6. 失去兩部伺服器6. Two servers lost

fault-tolerance-examples-5-and-6

...在每個案例中,所有磁碟區都會保持上線。...in every case, all volumes will stay online. (請確定您的叢集會保持仲裁)。(Make sure your cluster maintains quorum.)

全都離線的範例Examples where everything goes offline

儲存空間在其存留期內可容許任何數目的故障,因為只要時間足夠,它就會在每次故障後還原成完整復原能力。Over its lifetime, Storage Spaces can tolerate any number of failures, because it restores to full resiliency after each one, given sufficient time. 不過,任何特定時刻最多只會有兩個錯誤網域可安全地受到故障影響。However, at most two fault domains can safely be affected by failures at any given moment. 因此,下列是三向鏡像和/或雙同位無法容許之情形的範例。The following are therefore examples of what three-way mirroring and/or dual parity cannot tolerate.

  • 7. 一次失去三部以上伺服器中的磁碟機7. Drives lost in three or more servers at once
  • 8. 一次失去三部以上的伺服器8. Three or more servers lost at once

fault-tolerance-examples-7-and-8

使用方式Usage

請查看建立儲存空間直接存取中的磁碟區Check out Creating volumes in Storage Spaces Direct.

請參閱See also

下列每個連結都內嵌在本主題的內文中。Every link below is inline somewhere in the body of this topic.