udev重新加载配置

在red hat 6.2以后使用udev时,当新加磁盘map或者权限时,使用start_udev时会导致vip进行漂移,这是因为udev管理了网卡特性.
看下例子
这里我增加了一个磁盘的map操作

使用start_udev

[root@rac02 ~]# start_udev
[root@rac02 ~]# ls -l /dev/asm*
brw-rw---- 1 grid asmadmin    252,  32 Apr 20 10:37 /dev/asm-acfs-disks  --这个为新增加
-rw-r--r-- 1 root root     24416772096 Apr 20 10:34 /dev/asm-acfs-disks-direct=1
brw-rw---- 1 grid asmadmin    252, 272 May 20 10:11 /dev/asm-fd-diskd
brw-rw---- 1 grid asmadmin    252, 256 May 20 10:11 /dev/asm-fd-diske
brw-rw---- 1 grid asmadmin    252, 240 May 20 10:11 /dev/asm-fd-diskf
brw-rw---- 1 grid asmadmin    252, 224 May 20 10:11 /dev/asm-fd-diskg
brw-rw---- 1 grid asmadmin    252, 208 May 20 10:11 /dev/asm-fd-diskh
brw-rw---- 1 grid asmadmin    252, 192 May 20 10:11 /dev/asm-fd-diski
brw-rw---- 1 grid asmadmin    252, 176 May 20 10:11 /dev/asm-fd-diskj
brw-rw---- 1 grid asmadmin    252, 160 May 20 10:11 /dev/asm-hd-diskk
brw-rw---- 1 grid asmadmin    252, 144 May 20 10:11 /dev/asm-hd-diskl
brw-rw---- 1 grid asmadmin    252, 128 May 20 10:11 /dev/asm-hd-diskm
brw-rw---- 1 grid asmadmin    252, 112 May 20 10:11 /dev/asm-hd-diskn
brw-rw---- 1 grid asmadmin    252,  96 May 20 10:11 /dev/asm-hd-disko
brw-rw---- 1 grid asmadmin    252,  80 May 20 10:11 /dev/asm-hd-diskp
brw-rw---- 1 grid asmadmin    252,  64 May 20 10:11 /dev/asm-hd-diskq
brw-rw---- 1 grid asmadmin    252,  48 May 20 10:11 /dev/asm-hd-diskr
brw-rw---- 1 grid asmadmin    252,  32 May 20 10:11 /dev/asm-hd-disks
brw-rw---- 1 grid asmadmin    252, 320 May 20 10:11 /dev/asm-ocr-diska
brw-rw---- 1 grid asmadmin    252, 304 May 20 10:11 /dev/asm-ocr-diskb
brw-rw---- 1 grid asmadmin    252, 288 May 20 10:11 /dev/asm-ocr-diskc
 
/dev/asm:
total 0
查看crs资源
[root@rac02 ~]# crsctl status res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATADG_FD.dg
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.DATADG_HD.dg
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac01
               ONLINE  OFFLINE      rac02
ora.OCR.dg
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.asm
               ONLINE  ONLINE       rac01                 Started
               ONLINE  ONLINE       rac02                 Started
ora.gsd
               OFFLINE OFFLINE      rac01
               OFFLINE OFFLINE      rac02
ora.net1.network
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.ons
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.registry.acfs
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac01
ora.cvu
      1        ONLINE  ONLINE       rac01
ora.rac01.vip
      1        ONLINE  ONLINE       rac01
ora.rac02.vip
      1        ONLINE  INTERMEDIATE rac01                 FAILED OVER  --已漂移
ora.ngstadb.db
      1        ONLINE  ONLINE       rac01                 Open
      2        ONLINE  ONLINE       rac02                 Open
ora.oc4j
      1        ONLINE  ONLINE       rac01
ora.scan1.vip
      1        ONLINE  ONLINE       rac01

上面看出使用udev发现vip进行了漂移

使用udevadm trigger

[root@rac02 ~]# udevadm trigger
[root@rac02 ~]# ls -l /dev/asm*
brw-rw---- 1 grid asmadmin    252,  32 Apr 20 10:37 /dev/asm-acfs-disks --新加
-rw-r--r-- 1 root root     24416772096 Apr 20 10:34 /dev/asm-acfs-disks-direct=1
brw-rw---- 1 grid asmadmin    252, 272 May 20 10:11 /dev/asm-fd-diskd
brw-rw---- 1 grid asmadmin    252, 256 May 20 10:11 /dev/asm-fd-diske
brw-rw---- 1 grid asmadmin    252, 240 May 20 10:11 /dev/asm-fd-diskf
brw-rw---- 1 grid asmadmin    252, 224 May 20 10:11 /dev/asm-fd-diskg
brw-rw---- 1 grid asmadmin    252, 208 May 20 10:11 /dev/asm-fd-diskh
brw-rw---- 1 grid asmadmin    252, 192 May 20 10:11 /dev/asm-fd-diski
brw-rw---- 1 grid asmadmin    252, 176 May 20 10:11 /dev/asm-fd-diskj
brw-rw---- 1 grid asmadmin    252, 160 May 20 10:11 /dev/asm-hd-diskk
brw-rw---- 1 grid asmadmin    252, 144 May 20 10:11 /dev/asm-hd-diskl
brw-rw---- 1 grid asmadmin    252, 128 May 20 10:11 /dev/asm-hd-diskm
brw-rw---- 1 grid asmadmin    252, 112 May 20 10:11 /dev/asm-hd-diskn
brw-rw---- 1 grid asmadmin    252,  96 May 20 10:11 /dev/asm-hd-disko
brw-rw---- 1 grid asmadmin    252,  80 May 20 10:11 /dev/asm-hd-diskp
brw-rw---- 1 grid asmadmin    252,  64 May 20 10:11 /dev/asm-hd-diskq
brw-rw---- 1 grid asmadmin    252,  48 May 20 10:11 /dev/asm-hd-diskr
brw-rw---- 1 grid asmadmin    252,  32 May 20 10:11 /dev/asm-hd-disks
brw-rw---- 1 grid asmadmin    252, 320 May 20 10:11 /dev/asm-ocr-diska
brw-rw---- 1 grid asmadmin    252, 304 May 20 10:11 /dev/asm-ocr-diskb
brw-rw---- 1 grid asmadmin    252, 288 May 20 10:11 /dev/asm-ocr-diskc
 
/dev/asm:
total 0
[root@rac02 ~]# crsctl status res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATADG_FD.dg
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.DATADG_HD.dg
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac01
               ONLINE  OFFLINE      rac02
ora.OCR.dg
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.asm
               ONLINE  ONLINE       rac01                 Started
               ONLINE  ONLINE       rac02                 Started
ora.gsd
               OFFLINE OFFLINE      rac01
               OFFLINE OFFLINE      rac02
ora.net1.network
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.ons
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.registry.acfs
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac01
ora.cvu
      1        ONLINE  ONLINE       rac01
ora.rac01.vip
      1        ONLINE  ONLINE       rac01
ora.rac02.vip
      1        ONLINE  INTERMEDIATE rac01                 FAILED OVER  --漂移
ora.ngstadb.db
      1        ONLINE  ONLINE       rac01                 Open
      2        ONLINE  ONLINE       rac02                 Open
ora.oc4j
      1        ONLINE  ONLINE       rac01
ora.scan1.vip
      1        ONLINE  ONLINE       rac01

查看udevadm参数

udevadm trigger [options]
    接收内核发送来的设备事件。主要用于重放coldplug事件信息
(译者补充:内核在启动时已经检测到了系统的硬件设备,并把硬件设备信息通过sysfs内核虚拟文件系统导出。udev扫描sysfs文件系统,根据硬件设备信息生成热插拔(hotplug)事件,udev再读取这些事件,生成对应的硬件设备文件。由于没有实际的硬件插拔动作,所以这一过程被称为coldplug。)
 
    --verbose 输出将要被触发的设备列表。
    --dry-run 不真的触发事件
    --type=type 触发一个特殊的设备。合法的类型:devices,subsystem,failed.默认是devices
    --action=action
    被触发的事件,默认是change
    --subsystem-match=subsystem
    触发匹配子系统的设备事件。这个选项可以被多次指定,并且支持shell模式匹配。
    --attr-match=attribute=value
    触发匹配sysfs属性的设备事件。如果属性值和属性一起指定,属性的值可以使用shell模式匹配。如果没有指定值,会重新确认现有属性。这个选项可以被多次指定。
    --attr-nomatch=attribute=value
    不要触发匹配属性的设备事件。如果可以使用模式匹配。也可以多次指定
    --property-match=property=value
    匹配属性吻合的设备。可以多次指定支持模式匹配
    --tag-match=property
    匹配标签吻合的设备。可以多次指定。
    --sysname-match=name

测试udevadm trigger –subsystem-match=subsystem

[root@rac02 ~]# crsctl status res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATADG_FD.dg
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.DATADG_HD.dg
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.OCR.dg
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.asm
               ONLINE  ONLINE       rac01                 Started
               ONLINE  ONLINE       rac02                 Started
ora.gsd
               OFFLINE OFFLINE      rac01
               OFFLINE OFFLINE      rac02
ora.net1.network
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.ons
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.registry.acfs
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac01
ora.cvu
      1        ONLINE  ONLINE       rac01
ora.rac01.vip
      1        ONLINE  ONLINE       rac01
ora.rac02.vip
      1        ONLINE  ONLINE       rac02
ora.ngstadb.db
      1        ONLINE  ONLINE       rac01                 Open
      2        ONLINE  ONLINE       rac02                 Open
ora.oc4j
      1        ONLINE  ONLINE       rac01
ora.scan1.vip
      1        ONLINE  ONLINE       rac01
[root@rac02 ~]# udevadm trigger  subsystem-match=block
[root@rac02 ~]# ls -l /dev/asm*
brw-rw---- 1 grid asmadmin    252,  32 Apr 20 10:37 /dev/asm-acfs-disks --新加
-rw-r--r-- 1 root root     24416772096 Apr 20 10:34 /dev/asm-acfs-disks-direct=1
brw-rw---- 1 grid asmadmin    252, 272 May 20 10:11 /dev/asm-fd-diskd
brw-rw---- 1 grid asmadmin    252, 256 May 20 10:11 /dev/asm-fd-diske
brw-rw---- 1 grid asmadmin    252, 240 May 20 10:11 /dev/asm-fd-diskf
brw-rw---- 1 grid asmadmin    252, 224 May 20 10:11 /dev/asm-fd-diskg
brw-rw---- 1 grid asmadmin    252, 208 May 20 10:11 /dev/asm-fd-diskh
brw-rw---- 1 grid asmadmin    252, 192 May 20 10:11 /dev/asm-fd-diski
brw-rw---- 1 grid asmadmin    252, 176 May 20 10:11 /dev/asm-fd-diskj
brw-rw---- 1 grid asmadmin    252, 160 May 20 10:11 /dev/asm-hd-diskk
brw-rw---- 1 grid asmadmin    252, 144 May 20 10:11 /dev/asm-hd-diskl
brw-rw---- 1 grid asmadmin    252, 128 May 20 10:11 /dev/asm-hd-diskm
brw-rw---- 1 grid asmadmin    252, 112 May 20 10:11 /dev/asm-hd-diskn
brw-rw---- 1 grid asmadmin    252,  96 May 20 10:11 /dev/asm-hd-disko
brw-rw---- 1 grid asmadmin    252,  80 May 20 10:11 /dev/asm-hd-diskp
brw-rw---- 1 grid asmadmin    252,  64 May 20 10:11 /dev/asm-hd-diskq
brw-rw---- 1 grid asmadmin    252,  48 May 20 10:11 /dev/asm-hd-diskr
brw-rw---- 1 grid asmadmin    252,  32 May 20 10:11 /dev/asm-hd-disks
brw-rw---- 1 grid asmadmin    252, 320 May 20 10:11 /dev/asm-ocr-diska
brw-rw---- 1 grid asmadmin    252, 304 May 20 10:11 /dev/asm-ocr-diskb
brw-rw---- 1 grid asmadmin    252, 288 May 20 10:11 /dev/asm-ocr-diskc
[root@rac02 ~]# crsctl status res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATADG_FD.dg
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.DATADG_HD.dg
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02                 STOPPING
ora.OCR.dg
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.asm
               ONLINE  ONLINE       rac01                 Started
               ONLINE  ONLINE       rac02                 Started
ora.gsd
               OFFLINE OFFLINE      rac01
               OFFLINE OFFLINE      rac02
ora.net1.network
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.ons
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
ora.registry.acfs
               ONLINE  ONLINE       rac01
               ONLINE  ONLINE       rac02
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac01
ora.cvu
      1        ONLINE  ONLINE       rac01
ora.rac01.vip
      1        ONLINE  ONLINE       rac01
ora.rac02.vip
      1        ONLINE  OFFLINE
ora.ngstadb.db
      1        ONLINE  ONLINE       rac01                 Open
      2        ONLINE  ONLINE       rac02                 Open
ora.oc4j
      1        ONLINE  ONLINE       rac01
ora.scan1.vip
      1        ONLINE  ONLINE       rac01

以上看出网络正常,没有出现vip漂移

加载udev配置权限命令

 udevadm trigger  subsystem-nomatch=net
此条目发表在 Linux 分类目录。将固定链接加入收藏夹。

评论功能已关闭。