目录
一、什么是存储池
存储池即为TrueNAS用于存放数据的地方,可以将多块硬盘组成不同的模式,用于实现数据存储的冗余和更快的读写行能
官网原文
Storage pools are attached drives organized into virtual devices (vdevs). ZFS and TrueNAS periodically reviews and “heals” whenever a bad block is discovered in a pool. Drives are arranged inside vdevs to provide varying amounts of redundancy and performance. This allows for high performance pools, pools that maximize data lifetime, and all situations in between
二、如何建立存储池
要创建新池,请转到存储 > 创建池
命名存储池(此命名不可更改不可重复)->选择硬盘->此处默认会有一个数据VDev点击箭头添加硬盘即可
选择Raid类型点击创建
1、关于Raid类型
与磁盘阵列卡的原理类似
1)条带模式
每个磁盘用于存储数据。至少需要一个磁盘并且没有数据冗余。切勿使用条带模式存储关键数据!单个磁盘故障会导致 vdev 中的所有数据丢失。此模式下磁盘行能最佳,数据最不安全
2)镜像
每个磁盘中的数据都是相同的。至少需要两个磁盘,冗余最多,容量最少。
3)Raid-z
使用一个磁盘进行奇偶校验,而所有其他磁盘存储数据。至少需要三个磁盘。最多允许损坏1块硬盘数据仍能安全存储。
4)Raid-z2
使用两个磁盘进行奇偶校验,而所有其他磁盘都存储数据。至少需要四个磁盘。最多允许损坏2块硬盘数据仍能安全存储。
5)Raid-z3
使用三个磁盘进行奇偶校验,而所有其他磁盘都存储数据。至少需要五个磁盘。最多允许损坏3块硬盘数据仍能安全存储。
2、关于VDev类型
每个系统必须建立一个数据存储池,其余存储池可在数据存储池建立完成后添加或删除。
1)数据
用于主存储操作的标准 vdev。每个存储池至少需要一个数据vdev。
2)缓存
读取缓存与快速设备一起使用以加速读取操作。
TrueNAS存储顺序为内存->缓存存储池->数据存储池。
故使用大内存和大数据存储池可以有效提高数据存储行能。
官网原文
ZFS has several features to help improve performance for frequent access data read operations. One is Adaptive Replacement Cache (ARC), which is uses the server memory (RAM). The other is second level adaptive replacement cache (L2ARC), or cache drives added to ZFS storage pools. These cache drives are multi-level cell (MLC) SSD drives and, while slower than system memory, still much faster than standard hard drives. ZFS (and TrueNAS) uses all of the RAM installed in a system to make the ARC as large as possible, but this can be very expensive. Cache drives provide a cheaper alternative to RAM for frequently accessed data.
How Does L2ARC Work?
When a system gets read requests, ZFS uses ARC (RAM) to serve those requests. When the ARC is full and there are L2ARC drives are allocated to a ZFS pool, ZFS uses the L2ARC to serve the read requests that “overflowed” from the ARC. This minimizes how often the slower hard drives are accessed and increases system performance.
Implementation in TrueNAS
TrueNAS integrates L2ARC management in the Storage > Pools section of the web interface. Specifically, adding a Cache vdev to a new or existing pool and allocating drives to that pool enables L2ARC for that specific storage pool.
Cached drives are not mirrored, but always striped. To increase the size of an existing L2ARC, stripe another cache device with it. Dedicated L2ARC devices cannot be shared between ZFS pools.
A cache device failure does not affect the integrity of the pool, but can impact read performance. This depends on the workload and the ratio of dataset size to cache size.
Device Recommendations
Like all complicated features, trying to decide if using L2ARC is effective requires a strong understanding of your storage environment, performance goals, and the software being