Различия
Здесь показаны различия между двумя версиями данной страницы.
Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия | ||
wiki:руководство_по_ubuntu_server:множественное_связывание_устройств:multipath_devices [2012/05/22 15:56] |
wiki:руководство_по_ubuntu_server:множественное_связывание_устройств:multipath_devices [2012/05/23 15:59] (текущий) |
||
---|---|---|---|
Строка 21: | Строка 21: | ||
====Согласованные имена множественных устройств в кластере==== | ====Согласованные имена множественных устройств в кластере==== | ||
- | When the user_friendly_names configuration option is set to yes, the name of the multipath device is unique to a node, but it is not guaranteed to be the same on all nodes using the multipath device. Similarly, if you set the alias option for a device in the multipaths section of the multipath.conf configuration file, the name is not automatically consistent across all nodes in the cluster. This should not cause any difficulties if you use LVM to create logical devices from the multipath device, but if you require that your multipath device names be consistent in every node it is recommended that you leave the user_friendly_names option set to no and that you not configure aliases for the devices. By default, if you do not set user_friendly_names to yes or configure an alias for a device, a device name will be the WWID for the device, which is always the same. If you want the system-defined user-friendly names to be consistent across all nodes in the cluster, however, you can follow this procedure: | + | Когда опция user_friendly_names установлена в yes, имя множественного устройства уникально для узла, но не гарантируется то же самое на всех узлах, использующих это устройство. Также, если вы установили опцию алиаса для устройства в секции multipaths конфигурационного файла multipath.conf, имя не будет автоматически согласовано со всеми узлами кластера. Это не вызовет сложностей при использовании LVM для создания логических устройств на множественном устройстве, но если вам требуется согласовать имена множественных устройств на всех узлах, рекомендуется оставить user_friendly_names значение no и не настраивать алиасы для устройств. По умолчанию, если у вас не установлено user_friendly_names в yes и не настроен алиас для устройства, имя для этого устройства будет совпадать с WWID, которое всегда одно и то же. Если же вы хотите согласованные дружественные имена, определяемые системой для всех узлов в кластере, следуйте данной процедуре: |
- | Set up all of the multipath devices on one machine. | + | ** Установите все множественные устройства на одной машине. |
+ | ** Заблокируйте все ваши множественные устройства на других машинах, выполнив команды: | ||
+ | <code># service multipath-tools stop | ||
+ | # multipath -F</code> | ||
+ | ** Скопируйте файл /etc/multipath/bindings с первой машины на все остальные в кластере. | ||
+ | ** Восстановите работу сервиса multipathd на всех остальных машинах командой: | ||
+ | <code># service multipath-tools start</code> | ||
- | Disable all of your multipath devices on your other machines by running the following commands: | + | Если вы добавляете новое устройство, вам потребуется повторить этот процесс. |
- | # service multipath-tools stop | + | Таким же образом, если вы настроили алиас для устройства, который хотите согласовать на всех узлах в кластере, вам надо убедиться, что файл /etc/multipath.conf один и тот же на всех узлах кластера, следуя такой же процедуре: |
- | # multipath -F | + | |
- | Copy the /etc/multipath/bindings file from the first machine to all the other machines in the cluster. | + | ** Настройте алиасы для множественных устройств в файле multipath.conf на одной машине. |
+ | ** Заблокируйте все ваши множественные устройства на других машинах, выполнив команды: | ||
+ | <code># service multipath-tools stop | ||
+ | # multipath -F</code> | ||
+ | ** Скопируйте файл multipath.conf с первой машины на все остальные в кластере. | ||
+ | ** Восстановите работу сервиса multipathd на всех остальных машинах командой: | ||
+ | <code># service multipath-tools start</code> | ||
- | Re-enable the multipathd daemon on all the other machines in the cluster by running the following command: | + | Если вы добавляете новое устройство , вам потребуется повторить процесс. |
- | # service multipath-tools start | + | ====Атрибуты множественных устройств==== |
- | If you add a new device, you will need to repeat this process. | + | В дополнение к опциям user_friendly_names и alias, множественные устройства имеют ряд атрибутов. Вы можете изменить эти атрибуты для определенных множественных устройств, создавая секции этих устройств в секции multipath конфигурационного файла. Для информации по секции multipath конфигурационного файла смотрите секцию [[wiki:руководство_по_ubuntu_server:множественное_связывание_устройств:configuration|Конфигурационный файл DM-Multipath]]. |
- | Similarly, if you configure an alias for a device that you would like to be consistent across the nodes in the cluster, you should ensure that the /etc/multipath.conf file is the same for each node in the cluster by following the same procedure: | + | ====Множественные устройства в логических томах==== |
- | Configure the aliases for the multipath devices in the in the multipath.conf file on one machine. | + | После создания множественных устройств вы можете использовать их имена так же как и имя физического устройства при создании физических томов LVM. Например, если /dev/mapper/mpatha имя множественного устройства, следующая команда пометит /dev/mapper/mpatha как физический том: |
+ | <code># pvcreate /dev/mapper/mpatha</code> | ||
- | Disable all of your multipath devices on your other machines by running the following commands: | + | Вы можете использовать полученный физический том LVM при создании группы томов LVM так же, как вы использовали бы другое физическое устройство. |
- | # service multipath-tools stop | + | <note>Если вы пытаетесь создать физический том LVM на все устройство, на котором у вас сконфигурированы разделы, команда pvcreate приведет к ошибке.</note> |
- | # multipath -F | + | |
- | Copy the multipath.conf file from the first machine to all the other machines in the cluster. | + | Когда вы создаете логический том LVM, который использует массив носителей как активно/пассивное множественное устройство в качестве зависимых физических устройств, вы должны включить фильтры в lvm.conf для исключения дисков, на которых основано множественное устройство. Это нужно для ситуации, когда массив автоматически меняет активный маршрут на пассивный при получении [ошибки] ввода/вывода и множественное устройство будет обходить ошибку и восстанавливаться после сбоя всякий раз как LVM сканирует пассивный маршрут, если устройство не отфильтровано. Для активно/пассивных массивов, которые требуют команду для перевода пассивного маршрута в активное состояние, LVM каждый раз выводит предупреждение. Для фильтрования всех SCSI устройств в конфигурационном файле LVM (lvm.conf), включите следующий фильтр в секцию devices файла: |
+ | <code>filter = [ "r/block/", "r/disk/", "r/sd.*/", "a/.*/" ]</code> | ||
- | Re-enable the multipathd daemon on all the other machines in the cluster by running the following command: | + | После изменений в /etc/lvm.conf необходимо обновить initrd так, чтобы этот файл был скопирован туда, где фильтры имеют максимальную важность, во время загрузки. Выполните: |
+ | <code>update-initramfs -u -k all</code> | ||
- | # service multipath-tools start | + | <note>Каждый раз, как меняется /etc/lvm.conf или /etc/multipath.conf, initrd должен быть создан заново для отражения этих изменений. Это обязательно когда "черные списки" и фильтры необходимы для поддержания стабильной настройки хранилища.</note> |
- | + | ||
- | When you add a new device you will need to repeat this process. | + | |
- | + | ||
- | ====Multipath Device attributes==== | + | |
- | + | ||
- | In addition to the user_friendly_names and alias options, a multipath device has numerous attributes. You can modify these attributes for a specific multipath device by creating an entry for that device in the multipaths section of the multipath configuration file. For information on the multipaths section of the multipath configuration file, see Section, "Configuration File Multipath Attributes". | + | |
- | + | ||
- | ====Multipath Devices in Logical Volumes==== | + | |
- | + | ||
- | After creating multipath devices, you can use the multipath device names just as you would use a physical device name when creating an LVM physical volume. For example, if /dev/mapper/mpatha is the name of a multipath device, the following command will mark /dev/mapper/mpatha as a physical volume. | + | |
- | + | ||
- | # pvcreate /dev/mapper/mpatha | + | |
- | + | ||
- | You can use the resulting LVM physical device when you create an LVM volume group just as you would use any other LVM physical device. | + | |
- | + | ||
- | If you attempt to create an LVM physical volume on a whole device on which you have configured partitions, the pvcreate command will fail. | + | |
- | + | ||
- | When you create an LVM logical volume that uses active/passive multipath arrays as the underlying physical devices, you should include filters in the lvm.conf to exclude the disks that underlie the multipath devices. This is because if the array automatically changes the active path to the passive path when it receives I/O, multipath will failover and failback whenever LVM scans the passive path if these devices are not filtered. For active/passive arrays that require a command to make the passive path active, LVM prints a warning message when this occurs. To filter all SCSI devices in the LVM configuration file (lvm.conf), include the following filter in the devices section of the file. | + | |
- | + | ||
- | filter = [ "r/block/", "r/disk/", "r/sd.*/", "a/.*/" ] | + | |
- | + | ||
- | After updating /etc/lvm.conf, it's necessary to update the initrd so that this file will be copied there, where the filter matters the most, during boot. Perform: | + | |
- | + | ||
- | update-initramfs -u -k all | + | |
- | + | ||
- | Every time either /etc/lvm.conf or /etc/multipath.conf is updated, the initrd should be rebuilt to reflect these changes. This is imperative when blacklists and filters are necessary to maintain a stable storage configuration. | + | |
---- | ---- |