Multipath

Zakladni prikazy:

  • zobrazeni aktivnich multipathu:
    multipath -ll
  • reload podle kofigurace:
    multipath -v2

Vzorova konfigurace

  • nastavuje failover nad storage pripojnou pomoci FC a iSCSI
  • blacklistuje vsechna zarizeni mimo tech s wwid uvedenym v blacklist exceptions
  • multipathy uvadime v sekci multipaths, aby dostali hezke jmeno :)
blacklist {
        wwid .*
}
blacklist_exceptions {
        property "(ID_WWN|SCSI_IDENT_.|ID_SERIAL)"
        wwid "26261353635663533|2317936357870636c"
}
 
defaults {
#                verbosity 6
                failback        manual
                path_grouping_policy  failover
                features "0"
                no_path_retry fail
}
multipaths {
       multipath {
              wwid              26261353635663533
              alias             backup
        }
       multipath {
              wwid              2317936357870636c
              alias             mach3
        }
}

Pridani noveho multipath zarizeni

  • pridavame zarizeni jehoz jedna z cest je /dev/sdh
  • zjistime si jeho scsi_id (wwid) nasledujicim prikazem:
    /lib/udev/scsi_id -u -g -v /dev/sdh
    2317936357870636c
  • pridame ho do konfigurace do sekce blacklist_exceptions (oddelovac je |):
    wwid "26261353635663533|2317936357870636c"
  • dale do sekce multipaths pridame jeho zaznam:
    multipath {
            wwid              2317936357870636c
            alias             mach3
    }
  • nacteme konfiguraci:
    multipath -v2
    create: mach3 (2317936357870636c) undef SCST_FIO,raid-disk
    size=9.1T features='0' hwhandler='0' wp=undef
    |-+- policy='service-time 0' prio=1 status=undef
    | `- 1:0:2:1  sdh  8:112  undef ready running
    `-+- policy='service-time 0' prio=1 status=undef
      `- 15:0:0:1 sdj  8:144  undef ready running
  • overime, ze multipath funguje:
    multipath -ll
    backup (26261353635663533) dm-0 SCST_FIO,raid-disk
    size=11T features='0' hwhandler='0' wp=rw
    |-+- policy='service-time 0' prio=1 status=active
    | `- 1:0:1:1  sddf 70:208 active ready running
    `-+- policy='service-time 0' prio=1 status=enabled
      `- 14:0:0:1 sdm  8:192  active ready running
    mach3 (2317936357870636c) dm-80 SCST_FIO,raid-disk
    size=9.1T features='0' hwhandler='0' wp=rw
    |-+- policy='service-time 0' prio=1 status=active
    | `- 1:0:2:1  sdh  8:112  active ready running
    `-+- policy='service-time 0' prio=1 status=enabled
      `- 15:0:0:1 sdj  8:144  active ready running
  • vzniklo nam zarizeni /dev/mapper/mach3, ktere pouzivame stejne jako jakekoli jine blokove zarizeni

Manual failover

1) vyradit jednu z cest

echo offline > /sys/block/ [device name] /device/state

2) cestu vratit zpet

echo running > /sys/block/ [device name] /device/state

Je to vhodne udelat po automatickem failover v pripade, ze se prepne cesta z fc na iscsi. Je nastaveno nevracet se zpet, takze zabitim aktivniho ISCSI donutime multipath zase zacit pouzivat FC

 
linux/multipath.txt · Last modified: 2017/03/13 17:24 by tomsa