Tuesday, June 30, 2009

Tips and tricks on installing CentOS 5.3 x86_64, Vmware 2.0.1, eRPTS on an IBM X3400.

I was in Binalonan last weekends to help my friend Bryan setup his electronic Real Property System on his brand new server. This is to share what we basically did...

Specs: Intel Quad Core 2.0 with Intel VT, 3 x 250 SATA HDD (hot swappable), 8Gb RAM DDR2

For RAID configuration, please refer to documentation as provided by the IBM supplier.

In our case, we did a RAID 1 on the first 2 HD, while the remaining HD was configure as a hot spare.

Get CentOS 5.3 x86_64 from http://centos.org. Best download speed is via Torrent. Make sure you get the x86_64 to maximize your machine.

Install CentOS. For best results, allocate partitions for the following /boot, /, swap, /tmp, /usr, /var, /home, and a separate partition for the vmware machines (e.g. /vmware).

On selecting packages to install, make sure you check on the Development Libraries and Development Tools and try to prune other packages that you may not need at all (e.g. openoffice, gimp, etc.). As a server, you may also opt to put a password on your boatloader.

Upon installation, configure network first to a static IP (e.g. 192.168.10.200) and make sure it will connect to the Internet.

Update your CentOS installation
$ yum update
Reboot after update.

Edit /etc/fstab. On the options concerning ext3 partitions, put noatime after defaults as an optimization.
/dev/sda1 /boot ext3 defaults,noatime 1 1
Then edit /etc/sysctl.conf to add the following lines at the bottom:
vm.swappiness = 0
vm.overcommit_memory = 1
vm.dirty_background_ratio = 5
vm.dirty_ratio = 10
vm.dirty_expire_centisecs = 1000
dev.rtc.max-user-freq = 1024
You must also turn off some services that your host server won't need during boottime like cups, etc.

Reboot for the new optimizations to take effect.

Install VMWare 2.0.1. Check documentation for installation instructions. Actually you can accept almost all the defaults except for the location of the virtual machine which you must set to the partition you intended solely for erpts (e.g. /vmware).

After installation, edit /etc/vmware/config:

If your CPU was 2.0 then its
host.cpukHz=2000000
Then add the following lines
host.noTSC = TRUE
ptsc.noTSC = TRUE
Access Vmware with your web browser via http://localhost:8222, with root as admin user.

Edit host configuration as desired.

We may now create a virtual machine where we will install eRPTS.

Tips: When adding a virtual disk, put a check on Allocate Disk Space Now and Split into 2Gb files. Under policies, select Optimize for Performance. We allocated 40 Gb of disk space for this VM.

Allocate at least 2Gb of RAM and use only single processor. No need to add floppy disk and USB controller. Configure NIC to Bridged.

You may now proceed with the installation of erpts. You may also partition your drive into /boot, /, swap, /tmp, /usr, /home, and /var. Take note that /var should have the biggest allocation, perhaps not lower than 20Gb for it will store the database files. Partitioning on this case will ease down I/O traffic.

Configure network to a static ip that is in range with the static IP of the host machine. (e.g. 192.168.10.100). Apply erpts patches as instructed during the trainings. Update the database into 57 tables.

Time again for some optimizations in the eRPTS Guest Machine...

Edit /etc/fstab and add noatime on /var line...
/dev/sda5 /var ext3 defaults,noatime 1 2
Download the following kernel packages (optimized kernels for vm guests)
http://people.centos.org/tru/kernel-vm/4/RPMS/i386/kernel-vm-2.6.9-78.0.22.EL.i686.rpm
http://people.centos.org/tru/kernel-vm/4/RPMS/i386/kernel-vm-devel-2.6.9-78.0.22.EL.i686.rpm
Install the kernel and development libraries with the –-nodeps option
rpm -ivh -–nodeps kernel-vm-2.6.9-78.0.22.EL.i686.rpm
rpm -ivh –-nodeps kernel-vm-devel-2.6.9-78.0.22.EL.i686.rpm
Edit /boot/grub/menu.list. Make sure the default is set to 0.

And add the following at the end of the kernel line of kernel-vm-xxxx
noapic nolapic acpi=off clocksource=acpi_pm elevator=noop
Save and exit.

Edit /etc/sysctl.conf to add the following lines
vm.swappiness = 0
vm.overcommit_memory = 1
Then remove unnecessary services during boot time like cups, smb, etc. YMMV

Reboot guest machine for settings to take effect.

On the host machine, edit the .vmx file of the just created virtual machine. Its located where you put the virtual machine itself.

Add the following lines at the bottom
MemTrimRate = “0″
sched.mem.pshare.enable = “FALSE”
MemAllowAutoScaleDown = “FALSE”
Optional!

It is possible to install the latest phpmyadmin on eRPTS. Get phpmyadmin on their website.

You may also install the mysql 4.1 package from eBPLS with instructions to be posted here soon.

Use with caution though and as always, YMMV. :)

Wait! No USB? Well now that you are a linux sysad, try using the scp command to transfer files from your host machine to the guest machine. Syntax is as follows:
scp sourcefiles root@ipaddressofguestmachine:/specific/path/of/target/folder
And how did this installation fare? We chose a certain page at eRPTS where it usually takes them around 60 to 80 seconds to open. With this setup, it now opens in only about 3 to 8 seconds.

Not bad, aye?

That's all for now, I hope this helps!

3 comments:

Anonymous said...

Here is an addition to this great guide:

This is a complete guide to install prepare and install CentOS 5.3 correctly to run VMware 2.01 without a glitch...

http://www.sertec.ca/EN-Howtos.html

Hopefully this will help,
Pete

Anonymous said...

This document I used alot whenever I need to configure VMware Server 2 on some type of Installation. However the last part could be a typo.

It should be something similar to x86_64 bit rpms. But I guess those who already used document have figured that out before hand. Excellent work.

Highly recommended read.
Ron

Beta said...

I want to install CentOS, thanks already to guide how to install.