Tuesday, July 29, 2014

RAC 11.2 Migrating voting disks on different DG

This implementation was made using 2 KVM.



1. Check votedisk location

[grid@rac1 ~]$ crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   26f8032a6f6a4f28bfe642ea5b99da9c (ORCL:DISK1) [DATA]
Located 1 voting disk(s).


2. Add disks to the cluster and format partitions
 
[root@ images]# cd /var/lib/libvirt/images
[root@ images]# qemu-img create -f raw Virtual_Client_for_Linux_RHEL_6_RAC_DISK6.img 1G
Formatting 'Virtual_Client_for_Linux_RHEL_6_RAC_DISK6.img', fmt=raw size=1073741824 
[root@ images]# qemu-img create -f raw Virtual_Client_for_Linux_RHEL_6_RAC_DISK7.img 1G
Formatting 'Virtual_Client_for_Linux_RHEL_6_RAC_DISK7.img', fmt=raw size=1073741824 
[root@ images]# qemu-img create -f raw Virtual_Client_for_Linux_RHEL_6_RAC_DISK8.img 1G
Formatting 'Virtual_Client_for_Linux_RHEL_6_RAC_DISK8.img', fmt=raw size=1073741824 
[root@ images]# chown qemu:qemu Virtual_Client_for_Linux_RHEL_6_RAC_DISK6.img
[root@ images]# chown qemu:qemu Virtual_Client_for_Linux_RHEL_6_RAC_DISK7.img
[root@ images]# chown qemu:qemu Virtual_Client_for_Linux_RHEL_6_RAC_DISK8.img
[root@ images]# virsh attach-disk Virtual_Client_for_Linux_RHEL_6_RAC1-KVM --persistent /var/lib/libvirt/images/Virtual_Client_for_Linux_RHEL_6_RAC_DISK6.img sdf
Disk attached successfully

[root@ images]# virsh attach-disk Virtual_Client_for_Linux_RHEL_6_RAC2-KVM --persistent /var/lib/libvirt/images/Virtual_Client_for_Linux_RHEL_6_RAC_DISK6.img sdf
Disk attached successfully

[root@ images]# virsh attach-disk Virtual_Client_for_Linux_RHEL_6_RAC2-KVM --persistent /var/lib/libvirt/images/Virtual_Client_for_Linux_RHEL_6_RAC_DISK7.img sdg
Disk attached successfully

[root@ images]# virsh attach-disk Virtual_Client_for_Linux_RHEL_6_RAC1-KVM --persistent /var/lib/libvirt/images/Virtual_Client_for_Linux_RHEL_6_RAC_DISK7.img sdg
Disk attached successfully

[root@ images]# virsh attach-disk Virtual_Client_for_Linux_RHEL_6_RAC1-KVM --persistent /var/lib/libvirt/images/Virtual_Client_for_Linux_RHEL_6_RAC_DISK8.img sdh
Disk attached successfully

[root@ images]# virsh attach-disk Virtual_Client_for_Linux_RHEL_6_RAC2-KVM --persistent /var/lib/libvirt/images/Virtual_Client_for_Linux_RHEL_6_RAC_DISK8.img sdh
Disk attached successfully



-bash-4.1# fdisk –l

Disk /dev/sdf: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdg: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdh: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

-bash-4.1# fdisk /dev/sdf
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x1214349e.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1011, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1011, default 1011): 
Using default value 1011

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
-bash-4.1# fdisk /dev/sdg
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x268cbd64.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1011, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1011, default 1011): 
Using default value 1011

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
-bash-4.1# fdisk /dev/sdh
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x621c212d.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1011, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1011, default 1011): 
Using default value 1011

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.




3. Create ORACLEASM disks

-bash-4.1# oracleasm createdisk DISK6 /dev/sdf
Device "/dev/sdf" is not a partition
-bash-4.1# oracleasm createdisk DISK6 /dev/sdf1
Writing disk header: done
Instantiating disk: done
-bash-4.1# oracleasm createdisk DISK7 /dev/sdg1
Writing disk header: done
Instantiating disk: done
-bash-4.1# oracleasm createdisk DISK8 /dev/sdh1
Writing disk header: done
Instantiating disk: done
-bash-4.1# oracleasm listdisks
DISK1
DISK2
DISK3
DISK4
DISK5
DISK6
DISK7
DISK8
-bash-4.1#


-bash-4.1# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "DISK6"
Instantiating disk "DISK7"
Instantiating disk "DISK8"
-bash-4.1# oracleasm listdisks
DISK1
DISK2
DISK3
DISK4
DISK5
DISK6
DISK7
DISK8


4. Create ASM diskgroup


SQL> create diskgroup VOTE_TMP normal redundancy
failgroup DISK6 disk
'ORCL:DISK6' name DISK6
failgroup DISK7 disk
'ORCL:DISK7' name DISK7
failgroup DISK8 disk
'ORCL:DISK8' name DISK8
attribute
'au_size'='1M',
'compatible.asm'='11.2',
'compatible.rdbms'='10.1';    

Diskgroup created.

SQL> select group_number, name from v$asm_diskgroup;

GROUP_NUMBER NAME
------------ ------------------------------
       1 DATA
       2 FRA
       3 VOTE
       4 VOTE_TMP

SQL>

SQL> exit




5. Move votedisk to new diskgroup, that will have 3 copy of voting, because thiis disk group was created with normal redundancy on 3 disks.

[grid@rac1 ~]$ crsctl replace votedisk +VOTE_TMP
Successful addition of voting disk 01c0cd36cdff4faabfc4d59d7fda6599.
Successful addition of voting disk 819d4681343a4f56bf44f76f812000ba.
Successful addition of voting disk ab1b6ee43be14fe2bf91798868124614.
Successful deletion of voting disk 26f8032a6f6a4f28bfe642ea5b99da9c.
Successfully replaced voting disk group with +VOTE_TMP.
CRS-4266: Voting file(s) successfully replaced
[grid@rac1 ~]$
[grid@rac1 ~]$ crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   01c0cd36cdff4faabfc4d59d7fda6599 (ORCL:DISK6) [VOTE_TMP]
 2. ONLINE   819d4681343a4f56bf44f76f812000ba (ORCL:DISK7) [VOTE_TMP]
 3. ONLINE   ab1b6ee43be14fe2bf91798868124614 (ORCL:DISK8) [VOTE_TMP]
Located 3 voting disk(s).

No comments:

Post a Comment