此内容没有您所选择的语言版本。

4.6. The Metadata Daemon (lvmetad)


LVM can optionally use a central metadata cache, implemented through a daemon (lvmetad) and a udev rule. The metadata daemon has two main purposes: It improves performance of LVM commands and it allows udev to automatically activate logical volumes or entire volume groups as they become available to the system.

Note

The lvmetad daemon is not currently supported across the nodes of a cluster, and requires that the locking type be local file-based locking.
To take advantage of the daemon, you must do the following:
  • Start the daemon through the lvm2-lvmetad service. To start the daemon automatically at boot time, use the chkconfig lvm2-lvmetad on command. To start the daemon manually, use the service lvm2-lvmetad start command.
  • Configure LVM to make use of the daemon by setting the global/use_lvmetad variable to 1 in the lvm.conf configuration file. For information on the lvm.conf configuration file, see Appendix B, The LVM Configuration Files.
Normally, each LVM command issues a disk scan to find all relevant physical volumes and to read volume group metadata. However, if the metadata daemon is running and enabled, this expensive scan can be skipped. Instead, the lvmetad daemon scans each device only once, when it becomes available, by means of udev rules. This can save a significant amount of I/O and reduce the time required to complete LVM operations, particularly on systems with many disks. For information on the udev device manager and udev rules, see Section A.3, “Device Mapper Support for the udev Device Manager”.
When a new volume group is made available at runtime (for example, through hotplug or iSCSI), its logical volumes must be activated in order to be used. When the lvmetad daemon is enabled, the activation/auto_activation_volume_list option in the lvm.conf configuration file can be used to configure a list of volume groups and logical volumes that should be automatically activated. Without the lvmetad daemon, a manual activation is necessary. By default, this list is not defined, which means that all volumes are autoactivated once all of the physical volumes are in place. The autoactivation works recursively for LVM stacked on top of other devices, as it is event-based.

Note

When the lvmetad daemon is running, the filter = setting in the /etc/lvm/lvm.conf file does not apply when you execute the pvscan --cache device command. To filter devices, you need to use the global_filter = setting. Devices that fail the global filter are not opened by LVM and are never scanned. You may need to use a global filter, for example, when you use LVM devices in VMs and you do not want the contents of the devices in the VMs to be scanned by the physical host.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.