Questo post aiuterà a configurare i dischi Oracleasm utilizzando le regole Udev in un cluster a 2 nodi.
Sul primo nodo
1. Elenca i dischi:
[root@node01 ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 2G 0 disk sdb 8:16 0 2G 0 diskNota :Crea partizioni per i dischi.
2. Trova l'ID del disco:
[root@node01 ~]# udevadm info --query=all --name=/dev/sda | egrep "WWN|SERIAL" E: ID_SCSI_SERIAL=[id] E: ID_SERIAL=0QEMU_QEMU_HARDDISK_AAAAAAAAA E: ID_SERIAL_SHORT=[id] E: SCSI_IDENT_SERIAL=[id]
[root@node01 ~]# udevadm info --query=all --name=/dev/sdb | egrep "WWN|SERIAL" E: ID_SCSI_SERIAL=[id] E: ID_SERIAL=0QEMU_QEMU_HARDDISK_BBBBBBBBB E: ID_SERIAL_SHORT=[id] E: SCSI_IDENT_SERIAL=[id]
3. Crea un nuovo file 96-asm.rules :
[root@node01 ~]# touch /etc/udev/rules.d/96-asm.rules
4. Aggiungi il file 96-asm.rules con le informazioni rilevate sull'ID disco:
[root@node01 ~]# vim /etc/udev/rules.d/96-asm.rules ## Disk /dev/sda KERNEL=="sd*", SUBSYSTEM=="block", ENV{ID_SERIAL}=="0QEMU_QEMU_HARDDISK_AAAAAAAAA", SYMLINK+="oracleasm/DATA1", OWNER="oracle", GROUP="dba", MODE="0660" ## Disk /dev/sdb KERNEL=="sd*", SUBSYSTEM=="block", ENV{ID_SERIAL}=="0QEMU_QEMU_HARDDISK_BBBBBBBBB", SYMLINK+="oracleasm/DATA2", OWNER="oracle", GROUP="dba", MODE="0660"
5. Ricarica udev/rules:
[root@node01 ~]# udevadm control --reload-rules
[root@node01 ~]# udevadm trigger --type=devices --action=change
6. Elenca il disco dell'oraclea:
[root@node01 ~]# ll /dev/oracleasm/DATA* lrwxrwxrwx. 1 root root 6 Sep 28 14:24 /dev/oracleasm/DATA1 -> ../sda lrwxrwxrwx. 1 root root 6 Sep 28 14:24 /dev/oracleasm/DATA2 -> ../sdb [root@node01 ~]#
Sul secondo nodo
1. Elenca i dischi:
[root@node02 ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 2G 0 disk sdb 8:16 0 2G 0 diskNota :/dev/sd* il nome dei dispositivi non persisterà dopo il riavvio, trova con l'id del disco.
2. Trova l'ID del disco:
[root@node02 ~]# udevadm info --query=all --name=/dev/sdb | egrep "WWN|SERIAL" E: ID_SCSI_SERIAL=[id] E: ID_SERIAL=0QEMU_QEMU_HARDDISK_AAAAAAAAA E: ID_SERIAL_SHORT=[id] E: SCSI_IDENT_SERIAL=[id]
[root@node02 ~]# udevadm info --query=all --name=/dev/sdc | egrep "WWN|SERIAL" E: ID_SCSI_SERIAL=[id] E: ID_SERIAL=0QEMU_QEMU_HARDDISK_BBBBBBBBB E: ID_SERIAL_SHORT=[id] E: SCSI_IDENT_SERIAL=[id]
3. Crea un nuovo file 96-asm.rules :
[root@node02 ~]# touch /etc/udev/rules.d/96-asm.rules
4. Copiare 96-asm.rules da un altro nodo o creare una nuova voce con le informazioni rilevate:
[root@node02 ~]# vim /etc/udev/rules.d/96-asm.rules ## Disk /dev/sdb KERNEL=="sd*", SUBSYSTEM=="block", ENV{ID_SERIAL}=="0QEMU_QEMU_HARDDISK_AAAAAAAAA", SYMLINK+="oracleasm/DATA1", OWNER="oracle", GROUP="dba", MODE="0660" ## Disk /dev/sdc KERNEL=="sd*", SUBSYSTEM=="block", ENV{ID_SERIAL}=="0QEMU_QEMU_HARDDISK_BBBBBBBBB", SYMLINK+="oracleasm/DATA2", OWNER="oracle", GROUP="dba", MODE="0660"
5. Ricarica udev/rules:
[root@node02 ~]# udevadm control --reload-rules
[root@node02 ~]# udevadm trigger --type=devices --action=change
6. Elenca il disco dell'oraclea:
[root@node02 ~]# ll /dev/oracleasm/DATA* lrwxrwxrwx. 1 root root 6 Sep 28 14:57 /dev/oracleasm/DATA1 -> ../sdb lrwxrwxrwx. 1 root root 6 Sep 28 14:57 /dev/oracleasm/DATA2 -> ../sdc [root@node02 ~]#Nota :Per il dispositivo multipath, utilizzare il nome del dispositivo di conseguenza.