如果RAID0用作CEPH OSD,则建议禁用磁盘级的缓存,也就是磁盘标签上写的那个256MB缓存:

# /opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp -DisDskCache -Immediate -Lall -aAll
                                     
Set Disk Cache Policy to Disabled on Adapter 0, VD 0 (target id: 0) success
Set Disk Cache Policy to Disabled on Adapter 0, VD 1 (target id: 1) success
Set Disk Cache Policy to Disabled on Adapter 0, VD 2 (target id: 2) success
Set Disk Cache Policy to Disabled on Adapter 0, VD 4 (target id: 4) success
Set Disk Cache Policy to Disabled on Adapter 0, VD 5 (target id: 5) success
Set Disk Cache Policy to Disabled on Adapter 0, VD 7 (target id: 7) success
Set Disk Cache Policy to Disabled on Adapter 0, VD 8 (target id: 8) success

如果要启用target id 0 (系统盘)缓存则运行:

/opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp -EnDskCache -Immediate -L0 -a0

查看结果:

# /opt/MegaRAID/MegaCli/MegaCli64 -LDGetProp -DskCache -Lall -a0
                                     
Adapter 0-VD 0(target id: 0): Disk Write Cache : Disabled
Adapter 0-VD 1(target id: 1): Disk Write Cache : Disabled
Adapter 0-VD 2(target id: 2): Disk Write Cache : Disabled
Adapter 0-VD 4(target id: 4): Disk Write Cache : Disabled
Adapter 0-VD 5(target id: 5): Disk Write Cache : Disabled
Adapter 0-VD 7(target id: 7): Disk Write Cache : Disabled
Adapter 0-VD 8(target id: 8): Disk Write Cache : Disabled

如果计划对RAID0使用RAID的缓存,则务必确保机器电池有电要定期检查,否则突然断电可能造成RAID缓存中的数据丢失,这种情况很少,但还是要留意;最好是不启用RAID的缓存,也就是直写硬盘,或者writethrough模式。

如果还没买设备,或者后面还有计划增加设备,最好买有直通的raid卡!如果因为一些原因没办法用直通卡,只能raid0来创建osd则建议禁用磁盘缓存、禁用raid卡缓存或使用writethrough模式。

学习参考自:
https://bean-li.github.io/disk-cache-policy/
https://serverfault.com/questions/505275/megaraid-changing-cache-policy-online
https://www.dell.com/community/PowerEdge-HDD-SCSI-RAID/How-do-I-view-change-physical-disk-cache-policy-on-PowerEDGE/td-p/2581739

标签: Ceph, RAID

添加新评论