Это старая версия документа.
Содержание
Администрирование DM-Multipath и устранение проблем
Изменение размера работающего множественного устройства
Если вам требуется изменить размер работающего множественного устройства, используйте следующую процедурру:
Измените разммер вашего физического устройства. Эта операция зависит от платформы хранилища.
Используйте следующую команду для поиска маршрутов для логического номера узла (LUN):
# multipath -l
Измените размер маршрутов. Для SCSI устройств, запись 1 в файл rescan для устройства заставляет SCSI драйвер обновить информацию, как в следующей команде:
# echo 1 > /sys/block/device_name/device/rescan
Изменить размер множественного устройства запуском команды multipathd:
# multipathd -k 'resize map mpatha'
Изменить размер файловой системы (предполагается, что не используется LVM и DOS разделы):
# resize2fs /dev/mapper/mpatha
Перенос корневой файловой системы с одиночного устройства на множественное
Это впечатляюще упрощено использованием UUID для идентификации устройств в качестве естественной метки. Просто установите multipath-tools-boot и перегрузитесь. Это перестроит изначальный ramdisk и предоставит multipath возможность построить маршруты до того как корневая система будет смонтирована по UUID.
Перенос файловой системы подкачки с одиночного устройства на множественное
Процедура в точности такая же, как приведена в предыдущей секции Перенос корневой файловой системы с одиночного устройства на множественное.
Сервис Multipath
Если вы испытываете трудности в настройке multipath, вам надо убелиться, что сервис multipath запущен как описано в Обзоре установки DM-Multipath. Сервис multipathd должен быть запущен для того, чтобы использовать multipathd устройства. Также смотрите секцию Решение проблем с помощью интерактивной консоли multipathd касательно взаимодействия с multipathd как со средством отладки.
Проблемы с queue_if_no_path
Если установлены свойства "1 queue_if_no_path" в файле /etc/multipath.conf, то любой процесс, использующий ввод-вывод, будет сбрасываться пока восстанавливаются один или несколько маршрутов. Для предотвращения этого установите параметр no_path_retry N в /etc/multipath.conf.
Когда вы установите no_path_retry параметр, удалите также опции "1 queue_if_no_path" из файла /etc/multipath.conf. Однако если вы используете множественное устройство, для которого опция "1 queue_if_no_path" скомпилирована по умолчанию, как для множества устройств SAN, вам придется добавить значение "0" для переопределения этого умолчания. Вы можете это сделать копированием существующей секции devices, и только этой секции (а не всего файла), из /usr/share/doc/multipath-tools/examples/multipath.conf.annotated.gz в /etc/multipath.conf и редактированием ее по вашим потребностям.
Если вам требуется использовать опцию "1 queue_if_no_path" и вы испытываете отмеченные здесь проблемы, используйте команду для редактирования политики в процессе работы с определенным LUN (т.е. для каждого недоступного маршрута). Например, если вы хотите изменить политику для множественного устройства mpathc с "queue_if_no_path" на "fail_if_no_path" выполните следующую команду:
# dmsetup message mpathc 0 "fail_if_no_path"
Вывод команды multipath
When you create, modify, or list a multipath device, you get a printout of the current device setup. The format is as follows. For each multipath device:
action_if_any: alias (wwid_if_different_from_alias) dm_device_name_if_known vendor,product size=size features='features' hwhandler='hardware_handler' wp=write_permission_if_known
For each path group:
- +- policy='scheduling_policy' prio=prio_if_known
status=path_group_status_if_known
For each path:
`- host:channel:id:lun devnode major:minor dm_status_if_known path_status online_status
For example, the output of a multipath command might appear as follows:
3600d0230000000000e13955cc3757800 dm-1 WINSYS,SF2372 size=269G features='0' hwhandler='0' wp=rw |-+- policy='round-robin 0' prio=1 status=active | `- 6:0:0:0 sdb 8:16 active ready running `-+- policy='round-robin 0' prio=1 status=enabled `- 7:0:0:0 sdf 8:80 active ready running
If the path is up and ready for I/O, the status of the path is ready or ghost. If the path is down, the status is faulty or shaky. The path status is updated periodically by the multipathd daemon based on the polling interval defined in the /etc/multipath.conf file.
The dm status is similar to the path status, but from the kernel's point of view. The dm status has two states: failed, which is analogous to faulty, and active which covers all other path states. Occasionally, the path state and the dm state of a device will temporarily not agree.
The possible values for online_status are running and offline. A status of offline means that the SCSI device has been disabled.
When a multipath device is being created or modified , the path group status, the dm device name, the write permissions, and the dm status are not known. Also, the features are not always correct
Получение информации через команду multipath
You can use the -l and -ll options of the multipath command to display the current multipath configuration. The -l option displays multipath topology gathered from information in sysfs and the device mapper. The -ll option displays the information the -l displays in addition to all other available components of the system.
When displaying the multipath configuration, there are three verbosity levels you can specify with the -v option of the multipath command. Specifying -v0 yields no output. Specifying -v1 outputs the created or updated multipath names only, which you can then feed to other tools such as kpartx. Specifying -v2 prints all detected paths, multipaths, and device maps.
The default verbosity level of multipath is 2 and can be globally modified by defining the verbosity attribute in the defaults section of multipath.conf.
The following example shows the output of a multipath -l command.
# multipath -l
3600d0230000000000e13955cc3757800 dm-1 WINSYS,SF2372 size=269G features='0' hwhandler='0' wp=rw |-+- policy='round-robin 0' prio=1 status=active | `- 6:0:0:0 sdb 8:16 active ready running `-+- policy='round-robin 0' prio=1 status=enabled `- 7:0:0:0 sdf 8:80 active ready running
The following example shows the output of a multipath -ll command.
# multipath -ll
3600d0230000000000e13955cc3757801 dm-10 WINSYS,SF2372 size=269G features='0' hwhandler='0' wp=rw |-+- policy='round-robin 0' prio=1 status=enabled | `- 19:0:0:1 sdc 8:32 active ready running `-+- policy='round-robin 0' prio=1 status=enabled `- 18:0:0:1 sdh 8:112 active ready running 3600d0230000000000e13955cc3757803 dm-2 WINSYS,SF2372 size=125G features='0' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active |- 19:0:0:3 sde 8:64 active ready running `- 18:0:0:3 sdj 8:144 active ready running
Опции команды multipath
Table Useful multipath Command Options describes some options of the multipath command that you might find useful. Useful multipath Command Options Option Description -l Display the current multipath configuration gathered from sysfs and the device mapper. -ll Display the current multipath configuration gathered from sysfs, the device mapper, and all other available components on the system. -f device Remove the named multipath device. -F Remove all unused multipath devices.
Определение меток маршрутизации устройств командой dmsetup
You can use the dmsetup command to find out which device mapper entries match the multipathed devices.
The following command displays all the device mapper devices and their major and minor numbers. The minor numbers determine the name of the dm device. For example, a minor number of 3 corresponds to the multipathed device /dev/dm-3.
# dmsetup ls mpathd (253, 4) mpathep1 (253, 12) mpathfp1 (253, 11) mpathb (253, 3) mpathgp1 (253, 14) mpathhp1 (253, 13) mpatha (253, 2) mpathh (253, 9) mpathg (253, 8) VolGroup00-LogVol01 (253, 1) mpathf (253, 7) VolGroup00-LogVol00 (253, 0) mpathe (253, 6) mpathbp1 (253, 10) mpathd (253, 5)
Решение проблем с помощью интерактивной консоли multipathd
The multipathd -k command is an interactive interface to the multipathd daemon. Entering this command brings up an interactive multipath console. After entering this command, you can enter help to get a list of available commands, you can enter a interactive command, or you can enter CTRL-D to quit.
The multipathd interactive console can be used to troubleshoot problems you may be having with your system. For example, the following command sequence displays the multipath configuration, including the defaults, before exiting the console. See the IBM article «Tricks with Multipathd» for more examples.
# multipathd -k
> > show config > > CTRL-D
The following command sequence ensures that multipath has picked up any changes to the multipath.conf,
# multipathd -k
> reconfigure
> CTRL-D
Use the following command sequence to ensure that the path checker is working properly.
# multipathd -k
> show paths
> CTRL-D
Commands can also be streamed into multipathd using stdin like so:
# echo 'show config' | multipathd -k