# 设置 RAID

## RAID 级别 <a href="#raid-level" id="raid-level"></a>

RAID（独立冗余磁盘阵列）将多个物理磁盘组合成一个阵列，以形成一个可用的数据磁盘，从而提高速度和容错能力。Zenlayer 支持最常用的 RAID 类型：0、1、5 和 10。

| RAID 级别 | 磁盘数量  | 容错能力     | 空间效率    | 读写性能 | 可靠性 |
| ------- | ----- | -------- | ------- | ---- | --- |
| RAID 0  | n ≧ 2 | 无        | 100%    | 快速   | 低   |
| RAID 1  | n ≧ 2 | n/2 磁盘故障 | 50%     | 低    | 高   |
| RAID 5  | n ≧ 3 | 1 磁盘故障   | (n-1)/n | 中等   | 中等  |
| RAID 10 | n ≧ 4 | n/2 磁盘故障 | 50%     | 快速   | 高   |

应用场景解释：

* RAID 0 RAID 0 不包含任何冗余（或备份）。这意味着如果其中一个磁盘发生故障，您将丢失该磁盘上的所有数据。它主要用于需要高性能且能够容忍较低可靠性的应用程序，例如存储临时文件或已在其他地方备份的文件。
* RAID 1 如果您至少有两个磁盘，使用 RAID 1 将会复制您的数据并将其存储在每个磁盘上。由于具有高可靠性，RAID 1 通常用于重要的服务器或数据库存储。
* RAID 5：RAID 5 是一个平衡的解决方案，具有不错的处理能力，同时留有一些存储空间用于冗余。最适合存储关键数据和运行需要良好速度和效率的应用程序。
* RAID 10：RAID 10 具有高安全性和相对较高的性能，结合了 RAID 0 和 RAID 1 的优点，除了成本较高外，它是一个理想的解决方案。最适合需要 24/7 运行的应用程序或托管服务器。

## 前提条件 <a href="#prerequisites" id="prerequisites"></a>

* 您应至少有 2 个磁盘来设置 RAID。
* LCC、LCE 和 LCG 型号的实例不支持 RAID 设置。
* RAID 快速设置适用于存储空间相同的磁盘，自定义设置适用于存储空间不同的磁盘。
* 如果您有超过 4 个磁盘，在 RAID 快速设置中使用 RAID 10 而不是 RAID 1，因为 RAID 1 只需要 2 个磁盘，其他两个磁盘将被浪费。

## 设置 RAID <a href="#set-up-raid" id="set-up-raid"></a>

在选择实例规格后，检查 **磁盘** 和 **RAID** 列。

<figure><img src="/files/I8nNXqgkl94acVOQT1ph" alt=""><figcaption><p>实例配置</p></figcaption></figure>

只有一个磁盘时，RAID 设置不可用。

超过 2 个磁盘时：

<figure><img src="/files/FE2P9a1VvBcds7EzqQLQ" alt=""><figcaption><p>RAID 设置</p></figcaption></figure>

* 如果磁盘的存储空间不同，选择 **自定义设置**。

  选择所需的磁盘来设置不同的级别。
* 如果磁盘的存储空间相同，选择 **快速设置**
  * 磁盘数量 = 2，选择 RAID 0 或 RAID 1
  * 磁盘数量 = 3，选择 RAID 0 或 RAID 5
  * 磁盘数量 ≧ 4 且为偶数，选择 RAID 0、RAID 5 或 RAID 10


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/welcome/cn/bare-metal/get-started/create-a-bare-metal-instance/set-up-raid.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
