1、Oracle 11gR2 2node RAC on VMWare Workstation 8 Part 8Oracle 11gR2 2-node RAC on VMWare Workstation 8 PartVIIIPosted on October 27, 2012 by oraclejedi Posted in Hacking, Linux, RAC, VMware Tagged linux, oracle, rac, redhat, shared disk, vmware, workstation 8 Comments Time Required: 60 minutesClass Ma
2、terials: 5GB of disk space an ASCII text editorNext we are going to add some shared disk to our new freshly minted VMsVMWare Workstation makes the allocation of shared disk to VMs very simple. Shared disk has been the biggest obstacle to create Oracle RAC clusters at home, but now VMWare gives us a
3、reliable and portable solution that does not require fire-wire hacks, your own NFS server or a SCSI disk array.Best of all this whole solution can exist on a single laptop, so you can take your RAC on the road.Make sure both VMs are shut down. If you want to make a clone of your progress then now is
4、 your last chance to do so without the complication of shared external disk.We will add a new disk to Orpheus first, and then add the same disk into Eurydice.Using the VMWare Workstation menu, right click on Orpheus and select Settings.This will bring up the Virtual Machine Settings menu. Click on t
5、he Add button.At the Add Hardware Wizard menu, select Hard Disk and click Next.Select Create a new virtual disk and click Next.When the Select a Disk Type menu appears, select SCSI (Recommended) and for mode check Indepenent and the radio button Persistent.When the Specify Disk Capacity menu appear,
6、 set the new disk size at 5GB. This should be just enough to support our demo RAC database. If you have an abundance of disk space then by all means set the disk size much larger.Check the All all disk space now. button and Store virtual disk as a single fileNOTE: These last two options are very imp
7、ortant for our RAC. Trying to create a shared disk with VMWare Workstation using thin-provisioning will result in disk corruption.Next VMWare Workstation will ask where you want to store your new disk and what you want to call it. By default it will want to place the virtual disk in the same directo
8、ry as the rest of the Orpheus VM. However this new disk is to be shared, so I prefer to place it in a separate directory.VMWare Workstation stores its VMs by default in the users Documents directory under a sub-directory called Virtual Machines. In this directory you will find sub-directories for bo
9、th our VMs Orpheus and Eurydice. I suggest creating a new sub-directory here called Shared Disk and storing our new virtual disk in the Shared Disk directory with the name asm disk 1.vmdk.VMWare will ask you confirm your selection. Press Finish to confirm.Now we need to move our new disk to a differ
10、ent virtual SCSI device within the VM. In order to avoid all manner of cluster disk issues, we need to place the shared disks on a different SCSI controller to the local disks.Highlight the Orpheus VM in the VMWare Workstation menu and select Settings. When the Virtual Machine Settings menu appears,
11、 highlight Hard Disk 2 and select the Advanced button on the right hand side.The Hard Disk Advanced Settings menu allows to modify the Virtual device node. By default this will be set to SCSI 0:1, but we need to change this to SCSI 1:0. This will move our new disk to SCSI controller 1, device 0.Next
12、 we will have to resort to a little hacking to make our shared disk really sharable. We are now leveraging VM functionality that is not really supported in VMWare Workstation 8, but does appear to work, at least for demo purposes.Navigate to the directory where the Orpheus VM files are stored, in mo
13、st cases this will be Documents/Virtual Machines/Orpheus. In there you will find a file called Orpehus.vmxThe VMX file contains the hardware profile of the VMs we have created. Before we do anything else, make a copy of it so we have something to go back to if we make a mess.Open the VMX file with a
14、n ASCII editor. Make sure you have an editor able to open and save in ASCII format. Word Processors are a poor choice here as they are more likely to add symbols that will corrupt the file.The VMX file is a unsorted mess. Why VMWare doesnt perform a simple sort on the file before saving it to disk i
15、s a mystery. Still at least it isnt some gigantic XML monstrosity. I recommend that if your editor allows it, you perform a sort on the entire file and save it back to disk before making any changes.This is where the magic happens, and I have to acknowledge it was Dan Norris who figured this out, no
16、t me. In order to make our new disk fully clusterable, we are going to add the following directives to the VMX file:disk.locking = FALSEdiskLib.dataCacheMaxSize = 0diskLib.dataCacheMaxReadAheadSize = 0 diskLib.dataCacheMinReadAheadSize = 0 diskLib.dataCachePageSize = 4096 diskLib.maxUnsyncedWrites =
17、 0 scsi1.sharedBus = virtualThese changes force the VMs to not try to buffer reads and writes to the disk, which would result in block corruption to the shared database. The new directives can be added anywhere in the VMX file, although I tend to add them immediately above the SCSI settings.The foll
18、owing is a sub-section taken from the VMX file of my Orpheus VM. I have not dumped the entire file for the sake of clarity.replay.supported = FALSEdisk.locking = FALSEdiskLib.dataCacheMaxSize = 0diskLib.dataCacheMaxReadAheadSize = 0 diskLib.dataCacheMinReadAheadSize = 0 diskLib.dataCachePageSize = 4
19、096 diskLib.maxUnsyncedWrites = 0 scsi1.sharedBus = virtualscsi0.pciSlotNumber = 16scsi0.present = TRUEscsi0.virtualDev = lsilogicscsi0:0.fileName = local disk 1-cl2.vmdkscsi0:0.present = TRUEscsi0:0.redo = scsi0:1.present = FALSEscsi1.present = TRUEscsi1.virtualDev = lsilogicscsi1:0.fileName = C:Us
20、ersthorng1.CORPDocumentsVirtual MachinesShared Diskasm disk 1.vmdkscsi1:0.mode = independent-persistentscsi1:0.present = TRUEserial0.fileType = thinprintserial0.present = TRUEsound.autodetect = TRUENow navigate to the VMX file for Eurydice and add the same directives for diskLib and scsi1. You do NO
21、T need to use the VMWare interface to make these changes. Editing the VMX file directly is the better option.The following is taken from the VMX file of my Eurydice VM. Again I have not dumped the entire file for the sake of clarity. As you can see it should match Orpheus exactly.replay.supported =
22、FALSEdisk.locking = FALSEdiskLib.dataCacheMaxSize = 0diskLib.dataCacheMaxReadAheadSize = 0 diskLib.dataCacheMinReadAheadSize = 0 diskLib.dataCachePageSize = 4096 diskLib.maxUnsyncedWrites = 0 scsi1.sharedBus = virtualscsi0.pciSlotNumber = 16scsi0.present = TRUEscsi0.virtualDev = lsilogicscsi0:0.file
23、Name = local disk 1-cl2.vmdkscsi0:0.present = TRUEscsi0:0.redo = scsi1.present = TRUEscsi1.virtualDev = lsilogicscsi1:0.fileName = C:Usersthorng1.CORPDocumentsVirtual MachinesShared Diskasm disk 1.vmdkscsi1:0.mode = independent-persistentscsi1:0.present = TRUEserial0.fileType = thinprintserial0.pres
24、ent = TRUEsound.autodetect = TRUENow you can start up both Orpheus and Eurydice. As you do so, you might notice a small warning in the bottom right hand corner of the VMWare window that states:Clustering is not supported for WMware Workstation this setting will be ignoredDont worry about this. This
25、is expected behavior.When Orpheus is full booted up, we should be able to create a partition table on the new shared disk, which will be presented to Linux as /dev/sdb.In the following example we create a partition at the 1MB offset.rootorpheus # fdisk /dev/sdbDevice contains neither a valid DOS par
26、tition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel. Changes will remain in memory only,until you decide to write them. After that, of course, the previouscontent wont be recoverable.Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)Command (m for help
27、): uChanging display/entry units to sectorsCommand (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 1First sector (63-10485759, default 63): 2048Last sector or +size or +sizeM or +sizeK (2048-10485759, default 10485759): Using default value 10485759Command (
28、m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.Okay cool. We have created a partition on the new shared disk. Now we can stamp it for use by ASM by using the ASMLib we installed back in Part V.rootorpheus # oracleasm createdisk DATA /dev/s
29、db1Writing disk header: doneInstantiating disk: doneTo verify the operation worked as expected, we can list the ASM disks as follows:rootorpheus # oracleasm listdisksDATANow we need to see if the changes we just did are visible to Eurydice. Log into Eurydice as root and start the fdisk command. Now
30、if we list the partition table we should see that one already exists, as we just created it on Orpheus.rooteurydice # fdisk /dev/sdbThe number of cylinders for this disk is set to 1448.There is nothing wrong with that, but this is larger than 1024,and could in certain setups cause problems with:1) s
31、oftware that runs at boot time (e.g., old versions of LILO)2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)Command (m for help): pDisk /dev/sdb: 5368 MB, 5368709120 bytes181 heads, 40 sectors/track, 1448 cylindersUnits = cylinders of 7240 * 512 = 3706880 bytes Device Boot Start End Blocks Id System/dev/sdb1 1 1449 5241856 83 LinuxCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.Note: It is important to re-write the partition head
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1