大网数据广告活动
服务器运维问答

mdadm, raid1: write to multiple devs but read (mostly) from one?

· 52CE 我爱测

Is it possible to prioritize which devices are for writes/reads in mdadm RAID1 setup? I'd like to write to both devices for fault tolerance (AWS EBS and local storage SSD), but read mostly from local SSDs to improve latency and a…

问题原文

原帖链接 · Slawomir · CC BY-SA 3.0

Is it possible to prioritize which devices are for writes/reads in mdadm RAID1 setup? I'd like to write to both devices for fault tolerance (AWS EBS and local storage SSD), but read mostly from local SSDs to improve latency and avoid excessive AWS I/O fees?

Above setup is for MySQL data. Ideally, queries would be handled by the local SSD serving as cache, but writes would go to both EBS and SSD devices.

Follow up: I found this article http://tansi.info/hybrid/ Does anybody see a problem if HDD was replaced by EBS in above setup?

Answer: the exact setup is described here http://hatim.eu/2014/05/25/leveraging-ssd-ephemeral-disks-in-ec2-part-2/

已采纳解答

原帖链接 · shodanshok · CC BY-SA 3.0

You can use -W option when creating the array. From the manual:

-W, --write-mostly
              subsequent devices listed in a --build, --create, or --add  com‐
              mand will be flagged as 'write-mostly'.  This is valid for RAID1
              only and means that the 'md'  driver  will  avoid  reading  from
              these devices if at all possible.  This can be useful if mirror‐
              ing over a slow link.

To further optimize your setup, give a look to --write-behind also.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-06-09)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。