参考文档:
Udev rules are getting reloaded frequently and causing Oracle ASM outage - Red Hat Customer Portal
Resolution
-
There was a known issue with
inotify
watch events configured in the udev rules. Due to this, when a process opens a device for write operation, and then close it, then it could synthesise a change event. And this change event reloads the udev rules configured with ACTION=="add|change".The udev man page describes the
watch
andnowatch
options for 'inotify':$ man udev [...] watch Watch the device node with inotify, when closed after being opened for writing, a change uevent will be synthesised. nowatch Disable the watching of a device node with inotify. [...]
The 'inotify' watch and change event is turned on for most of the devices:
$ fgrep watch -r /lib/udev/rules.d/* | fgrep OPTIONS lib/udev/rules.d/10-dm.rules:OPTIONS:="nowatch" lib/udev/rules.d/11-dm-lvm.rules:OPTIONS:="nowatch" lib/udev/rules.d/13-dm-disk.rules:OPTIONS+="watch" lib/udev/rules.d/60-persistent-storage.rules:KERNEL!="xvd*|sr*", OPTIONS+="watch" lib/udev/rules.d/60-persistent-storage.rules:KERNEL=="xvd*", ENV{DEVTYPE}!="partition", ATTR{removable}!="1", OPTIONS+="watch" lib/udev/rules.d/60-persistent-storage.rules:KERNEL=="xvd*", ENV{DEVTYPE}=="partition", OPTIONS+="watch" lib/udev/rules.d/64-md-raid.rules:OPTIONS+="watch" lib/udev/rules.d/80-udisks.rules:# KERNEL=="dm-*", OPTIONS+="watch"
-
To suppress the false positive 'change' events, disable the 'inotify' watch for the devices used by Oracle ASM.
-
Before applying any changes, read through the following KCS documents to ensure you understand what Oracle ASM devices are being used in your environment:
-
Create a udev rule file
/etc/udev/rules.d/96-asm-device.rules
and setnowatch
option:ACTION=="add|change", KERNEL=="sd*", OPTIONS:="nowatch"
If you're using ASM on multipath devices, you'll need to change the "sd" to "dm" as shown in the following example:
ACTION=="add|change", KERNEL=="dm-*", OPTIONS:="nowatch"
-
Then use below commands to reload the udev rules configuration:
$ /sbin/udevadm control --reload-rules $ /sbin/udevadm trigger --type=devices --action=change
Note:
-
Above commands will reload the complete udev configuration and will trigger all the udev rules. On a busy production system this could disrupt the ongoing IO operations. So it would be recommended to please use the above commands during a scheduled maintenance window only.
-
The udev rule shown in above snip is provided as an example, there may be further change required to accommodate the devices used by Oracle ASM. Please get in touch with Red Hat support representative for assistance in setting up the udev rules to selectively disable the 'inotify' watch for the devices used by Oracle ASM.
-
The 'nowatch' option would only disable the 'inotify' watch events. The inotify API provides a mechanism for monitoring the filesystem events. It is used to monitor the individual files or to monitor directories. So, setting the 'nowatch' option for devices does not disable any existing device specific udev rules and any changes to underlying disk (e.g. add/remove/change) would still trigger the udev rules as expected.
-
详细内容,可以参考转载的文档。
END。