High performance SCST iSCSI Target on Linux software Raid: Difference between revisions

From Alpine Linux
No edit summary
Line 22: Line 22:


In my personal setup i have 4 pieces of WD RE4 1TB drives which i want to use in the best performance raid level with redundancy.  
In my personal setup i have 4 pieces of WD RE4 1TB drives which i want to use in the best performance raid level with redundancy.  
According to many mailing lists and opinion of the Linux raid author raid 10 seems to preform best while still having redundancy.
According to many mailing lists and opinion of the Linux raid author RAID10 with layout f2 (far) seems to preform best while still having redundancy.
You will loose 50% of your data storage but you will almost the same performance of RAID0 and redundancy of raid1.
Please remember with RAID10 50% of your hard disk space will go to redundancy, but performance is almost the same as RAID0 (stripe).


For most up-to-date information regarding Linux software raid: https://raid.wiki.kernel.org/index.php/Overview
For most up-to-date information regarding Linux software raid: https://raid.wiki.kernel.org/index.php/Overview


Raid10 level has multiple layout types. f(far)2 in tests seem to preform the best. Please see above link for references.
RAID10 has multiple layout types. f(far)2 in tests seem to preform the best. Please see above link for references.


  mdadm -v --create /dev/md0 --level=raid10 --layout=f2 --raid-devices=4 /dev/sda /dev/sdb /dev/sdc /dev/sdd
  mdadm -v --create /dev/md0 --level=raid10 --layout=f2 --raid-devices=4 /dev/sda /dev/sdb /dev/sdc /dev/sdd
Line 37: Line 37:
You can now monitor your raid (re)building: cat /proc/mdstat
You can now monitor your raid (re)building: cat /proc/mdstat


Default the rebuild speed will be set and can be checked and changed here:
By default, the rebuild speed will be set and can be checked and changed here:


  cat /proc/sys/dev/raid/speed_limit_max
  cat /proc/sys/dev/raid/speed_limit_max

Revision as of 08:53, 6 January 2011

This is a WIP

Introduction

This HOW-TO is focusing on performance. This is why I made some decisions targeted on performance instead of security (like you are used in Alpine Linux). This means we are not using grsec and not using a firewall. I presume you will take security actions on another level.

To get started, you can download a boot cd here:

http://alpine.nethq.org/distfiles/alpine-scst-110105-x86.iso

Content

  • Vanilla Kernel with SCST patches (linux-scst)
  • SCST modules and SCST ISCSI modules (linux-scst)
  • Linux software raid and raid level (mdadm)
  • Volume Management (LVM2)
  • SCST administration (scstadmin)
  • Linux raid monitoring

Linux software raid

In my personal setup i have 4 pieces of WD RE4 1TB drives which i want to use in the best performance raid level with redundancy. According to many mailing lists and opinion of the Linux raid author RAID10 with layout f2 (far) seems to preform best while still having redundancy. Please remember with RAID10 50% of your hard disk space will go to redundancy, but performance is almost the same as RAID0 (stripe).

For most up-to-date information regarding Linux software raid: https://raid.wiki.kernel.org/index.php/Overview

RAID10 has multiple layout types. f(far)2 in tests seem to preform the best. Please see above link for references.

mdadm -v --create /dev/md0 --level=raid10 --layout=f2 --raid-devices=4 /dev/sda /dev/sdb /dev/sdc /dev/sdd

I am not using partitions on my disks, although there are reasons to use partitions, see here:

https://raid.wiki.kernel.org/index.php/Partition_Types

You can now monitor your raid (re)building: cat /proc/mdstat

By default, the rebuild speed will be set and can be checked and changed here:

cat /proc/sys/dev/raid/speed_limit_max
cat /proc/sys/dev/raid/speed_limit_min

make sure we have raid10 module loaded at boot

echo raid10 >> /etc/modules

When you are happy with your raid configuration, save its information to mdamd.conf file

mdadm --detail --scan >> /etc/mdadm.conf

It should display something like

ARRAY /dev/md0 metadata=1.2 name=scst:0 UUID=71fc93b8:3fef0057:9f5feec1:7d9e57e8

Monitor software raid

Linux software raid can be monitored with mdadm daemon option. Alpine Linux includes an initd script which can invoke the daemon

/etc/init.d/mdadm

It will be default monitor the array's defined in mdadm.conf. To receive email notifications about array issues, we need to provide our email address inside mdadm.conf:

MAILADDR me@inter.net

Because mdadm cannot send email itself, we need to setup an sendmail (replacement) program.

apk add ssmtp

Ssmtp can be configured by editing /etc/ssmtp/ssmtp.conf

You can monitor messages (syslog) for actions invoked by mmdadm.

If you have your own monitoring system active, you can also let mdadm issue a script and notify it.

SCST and iSCSI management

To add an device

scstadmin -open_dev disk01 -handler vdisk_fileio -attributes filename=/mnt/array1/disk01,nv_cache=1

To close a device

scstadmin -close_dev disk01 -handler vdisk_fileio