Thursday, June 07, 2007

A test bed, or how to install Linux fast!

How do you prepare for Oracle testing? Or anything else, for that matter, based on Linux? Here's how:

Preparation:
  1. Hardware. Of course, you should have the hardware. I have.
  2. Download the CentOS 4.4 Server CD; it can be found here.
  3. Burn the .iso on a CD - any burning program can do that, many recognize the downloaded file as an image.
The next steps take about twenty minutes, even less on a modern CPU.
  1. Boot the designated system from newly created CD, some systems may require fiddling the boot options in the BIOS to allow for CD-drives to be searched for bootable products. Consult your motherboard manual if your system will not boot from the CD.
    Once it booted, you will see a startup screen, type:
  2. linux text
  3. Skip the CD test
  4. Choose English for a language, and a US Keyboard (or your own favourite, of course!)
  5. Choose to Auto Partition the disks, and remove any partitions (if applicable).
  6. OK the default partitioning offered (this is not about optimal Linux, but Oracle installations)
  7. Use Grub as bootloader, no password, no special config options
  8. Allow the Master Boot Record to boot from.
  9. Use a fixed IP-address: I used 192.168.1.210. Servers should always have fixed IP-addresses.
  10. As for Default gateway and DNS servers: use your own network settings. You could type:
    ipconfig/all
    on a windows PC, connected to the internet to find out your settings (assuming you have both a server, which now is cleaned out, and a workstation).
  11. Hostname: anything.home.local (no, choose your own, but do not use a domain, that might exist now or in the future - the domain home.local will never exist)
  12. Choose to use No firewall (yes, sure about that). Not that you cannot get Oracle installations to work with a firewall, but not having to bother with ports and firewall configurations while installing Oracle stuff makes the install process so much easier. Besides - you do have a central firewall in your network, don't you? If you don't: disconnect the RJ45 Ethernet connector NOW!
  13. SE Linux level: select to warn
  14. No additional languages (or: what you want)
  15. Indicate correct timezone
  16. Package install: select Customize.Leave the defaults for the following parts as is, uless otherwise mentioned. Deselect any other!
  • X-Windows
  • Gnome
  • Server Config Tools: add Samba (unless you want FTP - then add that)
  • Windows File Server (unless you like FTP)
  • Admin tools
Wait for 8 minutes or so, then the server will reboot. You have now completed your CentOS 4.4 install - congratulations!

Next step - upgrade.
The time, next step will take heavily depends on the type of network connection your have; it took me about half an hour to complete, with a 4Mbps downstream connection.
See if you can ssh into your server - I like TeraTerm. There seem to be new versions out, just search the net. You may have to use the ip-address you used (I used 192.168.1.210, remember?) until changes are made to your local hosts file.
Log on as root, and issue:

[root@oidhost ~]# uname -a
Linux oidhost.home.local 2.6.9-42.EL #1 Sat Aug 12 09:17:58 CDT 2006 i686 athlon i386 GNU/Linux
[root@oidhost ~]# yum upgrade

This will take some time, but when asked, answer Y - it will replace 155 of the installed packages (and upgrade to CentOS 4.5 - that distro does not have a Server Only iso, though...)
When you get the warning:

rpmts_HdrFromFdno: V3 DSA signature: NOKEY, key ID 443e1821
Public key for net-tools-1.60-37.EL4.9.i386.rpm is not installed
Retrieving GPG key from http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
Importing GPG key 0x443E1821 "CentOS-4 key "
it is OK: type 'Y' and continue.
When yum finally has completed:

[root@oidhost ~]# reboot -n

After the boot, we'll have a new kernel:

[root@oidhost ~]# uname -a
Linux oidhost.home.local 2.6.9-55.EL #1 Wed May 2 13:52:16 EDT 2007 i686 athlon i386 GNU/Linux


That's it! You now run CentOS 4.5 - congratulations!

Additions:
1. maintenance

There's a neat, web based administrative package, I'm rather fond of: webmin. Installing is easy as 1-2-3:
Visit the webmin site, and find the url of the download mirror nearest to you - I actually needed to start the download, in order to get the url copied. Using the url, that is under "Download" will do redirects, and the rpm installer does not understand them.
I use the Amsterdam mirror (By the way: that is one line you need to feed rpm with):

[root@oidhost ~]# rpm -iv http://surfnet.dl.sourceforge.net/sourceforge/webadmin/webmin-1.340-1.noarch.rpm
Retrieving http://surfnet.dl.sourceforge.net/sourceforge/webadmin/webmin-1.340-1.noarch.rpm
warning: /var/tmp/rpm-xfer.cxUGCI: V3 DSA signature: NOKEY, key ID 11f63c51
Preparing packages for installation...
Operating system is CentOS Linux
webmin-1.340-1
Webmin install complete. You can now login to http://oidhost.home.local:10000/
as root with your root password.

Yeah - right, not until I changed my Windows hosts file... which, by the way, has the following contents:
127.0.0.1       localhost
192.168.1.210 oidhost.home.local oidhost
192.168.1.220 idmhost.home.local idmhost
192.168.1.104 infradbhost.home.local infradbhost
The first entry is default, and best left alone (your loopback connector needs this!)
The second and third are my application server layers to be, and the last entry is my workstation, where the databases reside. Runs XP, and has 3GB memory available.

OK, after the alteration you can actually log in to webmin (and TeraTerm) using the hostname, not the IP-address.
Locate the Bootup and Shutdown section (under System), and stop and disable:
sendmail, cups, kudzu, pcmcia, xinetd.
Of course, you could have entered:
chkconfig sendmail off
chkconfig cups off
chkconfig kudzu off
chkconfig pcmcia off
chkconfig xinetd off
from your SSH session... followed by
service sendmail stop
service cups stop
service xinetd stop

2. Allowing copies from your workstation
Now, I installed Samba, you may have chosen FTP Server. If so, configure it. I'l do the Samba Windows thing, from WebMin:
  1. select Servers, Samba Windows file sharing.
  2. open the Windows Networking options, and alter:
  3. Workgroup - to whatever you use, the Windows default is WORKGROUP. You may leave it at WORKGROUP.
  4. You may alter the Server Description and Server name, leaving them default will cause misunderstanding with the second server in use...
    I used the hostname, oidhost and for the second machine: idmhost.
  5. Chance security to Share
  6. SAVE.
Under the shares, Create a New one, and call it install. Directory: /install.
Now click on the 'Start Samba Server' button, and browse your network - you should be able to see the install share from your windows client.
You will be asked for a password (and a user), whcih we still need to setup:
[root@oidhost ~]# useradd frank
Now - in WebMin, click on the 'Convert Unix users to Samba users', leave everything default,
and verify that frank is added after clicking the 'Convert' button. Then setup the
password that will be used for the share:
[root@oidhost ~]# smbpasswd frank
New SMB password:
Retype new SMB password:

You should now be able to map \\oidhost\install to a drive, using frank as user (select 'Connect as a different user'), and using the supplied password.
You still can't do a thing, as security prohibits.
For the sake of speed (again: we're in it for Oracle, not Linux):
chown frank /install
You now own the bloody thing!
Copy over any .cpio files and patches.

You are now ready to install Oracle - congratulations!
Addition: Not quite... some extra packages are required, better install these now:
[root@oidhost ~]# yum install xorg-x11-deprecated-libs.i386
[root@oidhost ~]# yum install gcc gcc-c++ openmotif21 sysstat gnome-libs libstdc++-devel compat-libstdc++-296 compat-db-4
After installing these, I noticed I had to set the kernel params; here's how:
edit /etc/security/limits.conf, and add this line:
*       hard    nofile  65536
Edit /etc/sysctl.conf, and add:
# Oracle specifics:
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 256 32000 100 142
fs.file-max = 131072
net.ipv4.ip_local_port_range = 10000 65000
kernel.msgmni = 2878
kernel.msgmax = 8192
kernel.msgmnb = 65535

A reboot is required...

2 comments:

Niall said...

nice post - I still think vmware/xen/insert virtualisation software of your choice is the way to go though, build yourself a base machine once, use it many times.

Frank said...

Niall, thanks for the comment. Two thoughts on that:
1) I may not be the most patient guy, but I once used 2 VM based Linux/iAS installs under XP (2GB laptop), and it was sloowwww. And I have the hardware (which may not be true for everyone).
2) Of course nothing stops you to install your VM based "host" with this how-to, too. Better stop now, and save the image at this point, then

And there is the sequel - yet to come...