Oracle 10g Laptop/nodeless RAC Howto
This procedure is only for experimaental purpose for testing RAC features.
I tried it on a Desktop it works
=====================
Oracle's model of clustering involves multiple instances (software processes)talking to a single database (physical datafiles). .
Let's get started, what will we need to do? Here's a quick outline of thesteps involved:
1. setup ip addresses of the virtual servers
2. setup ssh and rsh with autologin configured
3. setup the raw devices Oracle's ASM software will use
4. install the clusterware softare, and then Oracle's 10g software
5. setup the listener and an ASM instance
6. create an instance, start it, and register with srvct
7. create a second instance & undo tablespace, & register it
1. Setup IP Addresses
----------------------
Oracle wants to have a few interfaces available to it. To follow our analogyof a hitchhiker traveling across America, we'll name our server route66.
So add that name to your /etc/hosts/ file along with the private and vipnames:
192.168.0.19 route66
192.168.0.75 route66-priv
#192.168.0.76 route66-vip
Notice that we've commented out route66-vip. We'll explain more aboutthis later, but suffice it to say now that the clusterware installeris very finicky about this.
In order for these two additional names to be reachable, we needethernet devices to associate with those IPs.
It's a fairly straightforwardthing to create with ifconfig as follows:
$ /sbin/ifconfig eth0:1 192.168.0.75 netmask 255.255.255.0 broadcast 192.168.0.255$ /sbin/ifconfig eth0:2 192.168.0.76 netmask 255.255.255.0 broadcast 192.168.0.255
If your IPs, or network is configured differently, adjust the IP or broadcastaddress accordingly.
2. setup ssh and rsh with autologin
------------------------------------
Most modern Linux systems do *NOT* come with rsh installed. That's forgood reason, because it's completely insecure, and shouldn't be used atall. Why Oracle's installer requires it is beyond me, but you'll needit. You can probably disable it once the clusterware is installed.
Head over to http://rpmfind.net and see if you can find a copy foryour distro. You might also have luck using up2date or yumm if youalready have those configured, as they handle dependencies, and alwaysdownload the *right* version. With rpm, install this way:
$ rpm Uvh rsh-server-0.17-34.1.i386.rpm$ rpm Uvh rsh-0.17-34.1.i386.rpm
Next enable autologin by adding names to your /home/oracle/.rhosts file.After starting rsh, you should be able to login as follows:
$ rsh route66-priv
Once that works, move on the the sshd part. Most likely ssh is already onyour system, so just start it (as root):
$ /etc/rc.d/init.d/sshd start
Next, as the "oracle" user, generate the keys:
$ ssh-keygen -t dsa
Normally you would copy id_dsa.pub to a remote system, but for us wejust want to login to self. So copy as follows:
$ cd .ssh
$ cp id_dsa.pub authorized_keys
$ chmod 644 authorized_keys
Verify that you can login now:
$ ssh route66-priv
3. setup the raw devices
-------------------------
Most of the time when you think of files on a Unix system, you'rethinking of files as represented through a filesystem. A filesystemprovides you a way to interact with the underlying disk hardwarethrough the use of files. A filesystem provides buffering, toimprove I/O performance automatically. However in the case of adatabase like Oracle, it already has a sophisticated mechanism forbuffering which is smart in that it knows everything about it'sfiles, and how it wants to read and write to them. So for anapplication like Oracle unbuffered I/O is ideal. It bypasses awhole layer of software, making your overall throughput faster!You achieve this feat of magic using raw devices. We're going tohand them over to Oracle's Automatic Storage Manager in a minutebut first let's get to work creating the device files for ourRAC setup.
Create three 2G disks. These will be used as general storage spacefor our ASM instance:
$ mkdir /asmdisks
$ dd if=/dev/zero of=/asmdisks/disk1 bs=1024k count=2000
$ dd if=/dev/zero of=/asmdisks/disk2 bs=1024k count=2000
$ dd if=/dev/zero of=/asmdisks/disk3 bs=1024k count=2000
Create two more smaller disks, one for the Oracle Cluster Registry,and another for the voting disk:
$ dd if=/dev/zero of=/asmdisks/disk4 bs=1024k count=100
$ dd if=/dev/zero of=/asmdisks/disk5 bs=1024k count=20
Now we use a loopback device to make Linux treat these FILES asraw devices.
$ /sbin/losetup /dev/loop1 /asmdisks/disk1
$ raw /dev/raw/raw1 /dev/loop1
$ chown oracle.dba /dev/raw/raw1
You'll want to run those same three commands on disk2 through disk5 now.
4. Install the Clusterware & Oracle's 10g Software
--------------------------------------------------
Finally we're done with the Operating System setup, and we can move onto Oracle. The first step will be to install the clusterware. I'lltell you in advance that this was the most difficult step in the entireRAC on a laptop saga. Oracle's installer tries to *HELP* you all alongthe way, which really means standing in front of you!
First let's make a couple of symlinks to our OCR and voting disks:
$ ln -sf /dev/raw/raw4 /home/oracle/product/disk_ocr
$ ln -sf /dev/raw/raw5 /home/oracle/product/disk_vot
As with any Oracle install, you'll need a user, and group alreadycreated, and you'll want to set the usual environment variables suchas ORACLE_HOME, ORACLE_SID, etc. Remember that previous to this pointyou already have ssh and rsh autologin working. If you're not surego back and test again. That will certainly hold you up here, andgive you all sorts of confusing error messages.
If you're running on an uncertified version of Linux, you may wantto fire up the clusterware installer as follows:
$ ./runInstaller -ignoreSysPrereqs
If your Linux distro is still giving you trouble, you might trydownloading from centos.org where you can find complete ISOs forRHEL, various versions. You can also safely ignore memory warningsduring startup. If you're short on memory, it will certainly slow thingsdown, but we're hitchhikers right?
You'll be asked to specify the cluster configuration details. You'llwant route66-vip to be commented out, so if you haven't done that andget an error to the affect of route66-vip already in use go ahead and edit your /etc/hosts file.
I also got messages saying "route66-priv not reachable". Check againthat sshd is running, and possibly disable your firewall rules:
$ /etc/rc.d/init.d/iptables stop
Also verify that eth0:1, and eth0:2 are created. Have you rebootedsince you created them? Be sure they're still there with:
$ /sbin/ifconfig -a
Specify the network interface. This defaults to PRIVATE, just editand specify PUBLIC.
The next two steps ask for the OCR disk and voting disk. Be sure tospecify external redundancy. This is your way of telling Oracle thatyou'll take care of mirroring these important disks yourself, as lossof either of them will get you in deep doodoo. Of course we'rehitchhikers so we're not trying to build a system that is never goingto breakdown, but rather we want to get the feeling of the wind blowingin our hair. Click through to install and you should be in good shape.At the completion, the installer will ask you to run the root.shscript. I found this worked fine up until the vipca (virtual ipconfiguration assistant). I then ran this one manually. You'll needto uncomment route66-vip from your /etc/hosts file as well. Onceall configuration assistants have completed successfully, return tothe installer and click continue, and it will do various other sanitychecks of your cluster configuration.
Since the clusterware install is rather testy, you'll probably be doingit a few times before you get it right.