Это старая версия документа.


Обзор установки DM-Multipath

Эта секция предоставляет пример пошаговыых процедур для настройки DM-Multipath. Она включает следующие процедуры:

  1. Общая настройка DM-Multipath

  2. Игнорирование локальных дисков

  3. Добавление дополнительных устройств в конфигурационный файл

Настройка DM-Multipath

До проведения настройки DM-Multipath на вашей системе убедитесь что система обновлена и содержит пакет multipath-tools. Если предусматривается загрузка с внешнего хранилища (SAN), также потребуется пакет multipath-tools-boot.

Базовый /etc/multipath.conf может быть даже не создан, когда multpath запускается без /etc/multipath.conf, он ищет в своей внутренней базе подходящую конфигурацию, а также копирует данные из внутреннего «черного списка». Если затем запустить multipath -ll без конфигурационного файла, не будет обнаружено ни одного множественного устройства. Кто-то может потребовать разъяснений почему не созданы множественные устройства. Принимая во внимание ссылки на документацию производителей внешних хранилищ, примеры конфигурационных файлов для multipath находятся в /usr/share/doc/multipath-tools/examples, а используемая база multipathd:

# echo 'show config' | multipathd -k > multipath.conf-live
В случае причудливой работы multipathd, без создания /etc/multipath.conf, предыдущая команда ничего не вернет, поскольку это будет результатом объединения /etc/multipath.conf с базой в памяти. Для исправления этого либо создайте пустой /etc/multipath.conf, используя touch, либо создайте его, переопределив значения по умолчанию:
defaults {
        user_friendly_names no
}

и перезапустив multipathd:

# service multipath-tools restart

Теперь «show config» будет возвращать актуаальную базу.

Installing with Multipath Support

To enable multipath support during installation use

install disk-detect/multipath/enable=true

at the installer prompt. If multipath devices are found these will show up as /dev/mapper/mpath<X> during installation.

Ignoring Local Disks When Generating Multipath Devices

Some machines have local SCSI cards for their internal disks. DM-Multipath is not recommended for these devices. The following procedure shows how to modify the multipath configuration file to ignore the local disks when configuring multipath.

  Determine which disks are the internal disks and mark them as the ones to blacklist. In this example, /dev/sda is the internal disk. Note that as originally configured in the default multipath configuration file, executing the multipath -v2 shows the local disk, /dev/sda, in the multipath map. For further information on the multipath command output, see Section “Multipath Command Output”.
  # multipath -v2
  create: SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1 undef WINSYS,SF2372
  size=33 GB features="0" hwhandler="0" wp=undef
  `-+- policy='round-robin 0' prio=1 status=undef
    |- 0:0:0:0 sda 8:0  [--------- 
  device-mapper ioctl cmd 9 failed: Invalid argument
  device-mapper ioctl cmd 14 failed: No such device or address
  create: 3600a0b80001327d80000006d43621677 undef WINSYS,SF2372
  size=12G features='0' hwhandler='0' wp=undef
  `-+- policy='round-robin 0' prio=1 status=undef
    |- 2:0:0:0 sdb 8:16  undef ready  running
      `- 3:0:0:0 sdf 8:80 undef ready  running
  create: 3600a0b80001327510000009a436215ec undef WINSYS,SF2372
  size=12G features='0' hwhandler='0' wp=undef
  `-+- policy='round-robin 0' prio=1 status=undef
    |- 2:0:0:1 sdc 8:32 undef ready  running
      `- 3:0:0:1 sdg 8:96 undef ready  running
  create: 3600a0b80001327d800000070436216b3 undef WINSYS,SF2372
  size=12G features='0' hwhandler='0' wp=undef
  `-+- policy='round-robin 0' prio=1 status=undef
    |- 2:0:0:2 sdd 8:48 undef ready  running
      `- 3:0:0:2 sdg 8:112 undef ready  running
  create: 3600a0b80001327510000009b4362163e undef WINSYS,SF2372
  size=12G features='0' hwhandler='0' wp=undef
  `-+- policy='round-robin 0' prio=1 status=undef
    |- 2:0:0:3 sdd 8:64 undef ready  running
      `- 3:0:0:3 sdg 8:128 undef ready  running
  In order to prevent the device mapper from mapping /dev/sda in its multipath maps, edit the blacklist section of the /etc/multipath.conf file to include this device. Although you could blacklist the sda device using a devnode type, that would not be safe procedure since /dev/sda is not guaranteed to be the same on reboot. To blacklist individual devices, you can blacklist using the WWID of that device. Note that in the output to the multipath -v2 command, the WWID of the /dev/sda device is SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1. To blacklist this device, include the following in the /etc/multipath.conf file.
  blacklist {
        wwid SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1
  }
  After you have updated the /etc/multipath.conf file, you must manually tell the multipathd daemon to reload the file. The following command reloads the updated /etc/multipath.conf file.
  # service multipath-tools reload
  Run the following command to remove the multipath device:
  # multipath -f SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1
  To check whether the device removal worked, you can run the multipath -ll command to display the current multipath configuration. For information on the multipath -ll command, see Section “Multipath Queries with multipath Command”. To check that the blacklisted device was not added back, you can run the multipath command, as in the following example. The multipath command defaults to a verbosity level of v2 if you do not specify a -v option.
  # multipath
  create: 3600a0b80001327d80000006d43621677 undef WINSYS,SF2372
  size=12G features='0' hwhandler='0' wp=undef
  `-+- policy='round-robin 0' prio=1 status=undef
    |- 2:0:0:0 sdb 8:16  undef ready  running
      `- 3:0:0:0 sdf 8:80 undef ready  running
  create: 3600a0b80001327510000009a436215ec undef WINSYS,SF2372
  size=12G features='0' hwhandler='0' wp=undef
  `-+- policy='round-robin 0' prio=1 status=undef
    |- 2:0:0:1 sdc 8:32 undef ready  running
      `- 3:0:0:1 sdg 8:96 undef ready  running
  create: 3600a0b80001327d800000070436216b3 undef WINSYS,SF2372
  size=12G features='0' hwhandler='0' wp=undef
  `-+- policy='round-robin 0' prio=1 status=undef
    |- 2:0:0:2 sdd 8:48 undef ready  running
      `- 3:0:0:2 sdg 8:112 undef ready  running
  create: 3600a0b80001327510000009b4362163e undef WINSYS,SF2372
  size=12G features='0' hwhandler='0' wp=undef
  `-+- policy='round-robin 0' prio=1 status=undef
    |- 2:0:0:3 sdd 8:64 undef ready  running
      `- 3:0:0:3 sdg 8:128 undef ready  running

Configuring Storage Devices

By default, DM-Multipath includes support for the most common storage arrays that support DM-Multipath. The default configuration values, including supported devices, can be found in the multipath.conf.defaults file.

If you need to add a storage device that is not supported by default as a known multipath device, edit the /etc/multipath.conf file and insert the appropriate device information.

For example, to add information about the HP Open-V series the entry looks like this, where %n is the device name:

devices {

   device {
          vendor "HP"
          product "OPEN-V."
          getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
   }

}

For more information on the devices section of the configuration file, see Section Configuration File Devices.