1
momocraft 56 天前
1 的 FYI: zfs 的 raidz 在一个多盘 raid 单位 ("vdev") 建好后不能通过加盘来加容量(用正确的方法可以逐块盘替换成大容量)。如果这点不是问题我觉得 zfs 的 raid 挺好的。
|
![]() |
2
sidkang 56 天前 ♥ 1
@momocraft 嗯,对的,这一点确实也是个缺点,不过最近稍微有些进展,https://github.com/zfsonlinux/zfs/pull/8853,鉴于 3*8T 应该可以组 Raid 后有 14T 的容量,应该够用挺长时间的,这个 feature 到时候应该也差不多能 release,剩下就是不同容量的盘的替换扩容问题了= =
|
![]() |
3
smilzman 56 天前
我没组 raid,3 块数据盘,1 快备份盘,重要数据实时同步到备份盘,然后通过自带的网盘软件同步到本地。
|
4
momocraft 56 天前
> #2
我还不是很相信 zfsonlinux (现在用的裸机 /freebsd), 不过 freebsd 将来要改用 zol 了, 总之也是好消息 |
![]() |
6
sidkang 56 天前
@smilzman 如果是这样直接使用 Basic 模式的话,如果是自建,我推荐可以考虑 SnapRaid + MergerFS 的方式,完全没有损失作为 Basic 模式下的那些优点,并且还有一些独有的优点
我想要用 ZFS 主要是还是有一大部分的碎片文件存在,想通过 Raid 的方式提高一些性能,并且能够有一定的可靠性 |
![]() |
8
lulu00147 56 天前 via iPhone ♥ 1
兄弟,首先要明确你的 nas 想干嘛。
如果想跑日常 dev 可以按 pve 硬盘直通啥的,如果单纯是存储数据可以按 freenas 或 XigmaNAS,两个方向,一个是应用开发向,一个是稳定存储向。 接下来应该是存储文件的冷热分离,日常不经常使用的冷文件可以放到机械硬盘上,日常常用的热文件最好放在 ssd 上。 最后才是考虑数据存储介质的问题,推荐 4 块机械硬盘组一个 zfs,ssd 组一个 zfs。 ssd 定期快照备份到机械硬盘。 机械硬盘不用快照,定期扫描就行。 |
![]() |
9
lulu00147 56 天前 via iPhone
我的方案仅供参考。
只有一个主板,所以 host 是 pve,直通给 guest4 块 8t 的硬盘,guest 是 XigmaNAS,四块 8t 组成一个 zfs。 剩下的 2 块 ssd 都是笔记本升级淘汰下来的,安装 pve 的时候格式化为 zfs,shell 开了 smb git 做开发机。 之前 pve 里面还跑了个 ros 当主路由,很稳定。 后来家里宽带升级到 400m,破 j1900 板子跑不到上限,直接换了个 hap ac2,pve 里面现在就个小破站了。 |
![]() |
10
lulu00147 56 天前 via iPhone
1 hdd 用 zfs 比较稳定,之前多次停电都没问题,无 ups
|
![]() |
11
lulu00147 56 天前 via iPhone ♥ 1
2 普通 raid 和 zfs 性能区别不大,主要区别在于 zfs 支持快照和自压缩及自恢复,普通 raid 停电很容易出问题
|
![]() |
12
lulu00147 56 天前 via iPhone
3 仓库存储建议使用稳定的 freenas 或 XigmaNAS,开发存储可以直接 pve 接管,我用的方案就是分开了
|
![]() |
13
lulu00147 56 天前 via iPhone
这个方案优点是稳定,即使 pve 跪了,插一个 XigmaNAS 的 u 盘就可以再次启动 4 块机械硬盘的 zfs,pve 快照定期写入机械硬盘,可以随时恢复。
缺点也有,缺点是运行两个系统 pve 和 XigmaNAS,多耗费一点内存。 直接 pve 管理可以省点内存,XigmaNAS 比较节省内存支持嵌入式,比 freenas 节省,4g 内存就能跑的很好。 pve 直接管理也可以但是数据没有分离开,如果出现灾难恢复是个问题。 |
![]() |
14
lulu00147 56 天前 via iPhone
以上,希望能帮到你
|
![]() |
15
shinko 56 天前
MergerFS+SnapRaid
|
![]() |
16
orzfly 56 天前
ZFS 的 snapshot 和 compression 还是很好用的(
|
![]() |
17
sidkang 55 天前
@lulu00147 灰常感谢你的回复,我这台应该会和你的差不多,应用向和存储向都有需求,理解,如果是这样的话,那我就考虑直接在 proxmox 下做三个 zpool,U 盘,SSD,HDD 分别各一个,内存其实问题不大,目前已经上 32G,而且我的存储容量目测不到 15T,这方面应该还好。
不过我注意到你的配置方式里应该是采用直通硬盘的方式到 VM 的方式来组成 HDD 的 ZPool 的,这个在 Freenas 的官网说不太推荐在 vm 下这么做,如果实在要在 vm 下管理,应该把整个 sata controller 直通给 vm 来管理(我目前的方式是 host 装 proxmox,给黑群直通了硬盘来用,感觉不是很放心,所以打算重新搞一遍,机器只有 4 盘位 3.5,所以最多也就 raid5,但是未来肯定会上大容量硬盘,目前看来但盘容量越大,raid5 就越不合适,所以想想就打算趁着升级硬件的机会彻底解决这个问题) 以下是 freenas 的原文: ZFS combines the roles of RAID controller, Volume Manager, and file system, and since it’s all three in one, it wants direct access to your disks in order to work properly. The closer you can get ZFS to your storage hardware, the happier ZFS is, and the better it can do its job of keeping your data safe. Things like native virtual disks or virtual disks on RAID controllers insulate ZFS from the disks, and therefore should be avoided whenever possible. Using a hypervisor, you typically have a disk on a RAID controller presented to a hypervisor which creates a datastore with a disk on it running FreeNAS. This places two layers between ZFS and the physical disks which warrants taking the following precautions. Precautions If you are not using PCI passthrough (more on that below), then you must disable the scrub tasks in ZFS. The hardware can “lie” to ZFS so a scrub can do more damage than good, possibly even permanently destroying your zpool. The second precaution is to disable any write caching that is happening on the SAN, NAS, or RAID controller itself. A write cache can easily confuse ZFS about what has or has not been written to disk. This confusion can result in catastrophic pool failures. Using a single disk leaves you vulnerable to pool metadata corruption which could cause the loss of the pool. To avoid this, you need a minimum of three vdevs, either striped or in a RAIDZ configuration. Since ZFS pool metadata is mirrored between three vdevs if they are available, using a minimum of three vdevs to build your pool is safer than a single vdev. Ideally vdevs that have their own redundancy are preferred. |
![]() |
18
lucifer9 55 天前
超过 500G 的硬盘用 raid5 也不是不行,反正尽可能勤做备份吧
|
![]() |
19
lulu00147 55 天前 via iPhone
@sidkang
1.千万不要用黑群做安全存储,血泪史啊,我以前用的黑群,一次家里停电就跪了,只有一次,花了 2000 多找人恢复的数据,费了老大劲了。 2.vm 使用 freenas 直通我没有发言权,我用的是 xigmanas 没啥问题很稳定。 建议问问其他兄弟。 如果喜欢黑群的 app,可以在 pve 按黑裙分个 20g 硬盘,黑群里面挂载 pve 的 smb 共享,类似这种方案,毕竟 zfs 安全太多了。 |
![]() |
21
lucifer9 54 天前
没 ECC 内存的话,zfs 其实也没好太多
|
![]() |
23
SaltyLeo 37 天前
ZFS 的自恢复真的很赞,前段时间把内核搞坏了,重新覆盖安装新的系统,ZFS 自动挂载了,数据一点都没丢。
|
![]() |
25
sidkang 37 天前
@lucifer9 ECC 的争论好像挺多的,不过目前看下来主流的讲法还是“ECC 其实不是 ZFS 特殊,而是任何系统用 ECC 内存都更推荐”,我买的主板也是支持纯 ECC 的,不过纯 ECC 有点难买,打算以后方便的时候再搞
|
26
xivisi 35 天前
我用的 gentoo + 用的 zfs 文件系统
|