Saturday, May 05, 2007

Consolidate your web architecture -w- vmware

Good and Cheap Hardware
CPU: AMD64 Dual Core Processor 4400+
Clock: 2.2 GHz
Ram: 1 Gig

1) Select a CentOS 4.4 install (With 5 usable ip addresses)
2) Install vmware server (See last weeks post)
3) Download CentOS 5 virtual appliance and cp into /vm directory
http://www.vmware.com/vmtn/appliances/directory/820
4) Download MySQL Appliance and cp into /vm directory
5) Download memcached Appliance and cp into /vm directory

6) Edit /etc/sysconfig/network-scripts/ifcfg-eth0-range0 to free up 3 ip addresses
## START
#IPADDR_START=72.xxx.xxx.19
IPADDR_START=72.xxx.xxx.22
IPADDR_END=72.xxx.xxx.22
CLONENUM_START=0
##END

7) service network restart
New ifconfig wil show IP's up on eth0 and and one ethernet alias eth0:0

8) run vmware_config.pl
for networking, select vmnet0 to bridge on eth0
set vmware default appliance directory to /vm

9) From a pc start vmware client and connect to the remote server.
10) "Open existing virtual machine" and browse to each appliance to install.
11) Start up both vm appliances and setup networking.
ifconfig eth0 72.xxx.xxx.19
route add default gw [use the same gateway that is used on the host server]
make changes permanent

/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0c:22:32:s0:d4
IPADDR=72.xxx.xxx.19
NETMASK=255.255.55.248
ONBOOT=yes

# vi /etc/sysconfig/network
Append/modify configuration as follows:
NETWORKING=yes
HOSTNAME=www1.fubar.com
GATEWAY=72.xxx.xxx.xxx

Set the correct DNS server defined in /etc/resolv.conf file:
# vi /etc/resolv.conf
nameserver 72.yyy.yyy.yyy

service network restart
ping google.com

12) Assign DNS names to the new servers

13) Install vmware tools. This is not required if you will usually login to the server via ssh.
http://www.thoughtpolice.co.uk/vmware/howto/centos-5-vmware-tools-install.html

1 comment:

Unknown said...

I have since moved to Gentoo Linux for my server installs. I think there are still good uses for VMware and other virtualization systems but Gentoo has very low overhead and can be customized for anything. As a mass hosting platform, VMware is too time consuming to install and manage IMHO. Also, it ended up not being very easy to script.