Installing OpenVZ on Amazon EC2
Check your /boot/grub/menu.lst
, it should look like following:
default=1 title centos5.6 root (hd0) kernel /boot/vmlinuz-2.6.18-238.5.1.el5xen root=/dev/sda1 initrd /boot/initrd-2.6.18-238.5.1.el5xen.img title CentOS-openvz-xen root (hd0) kernel /boot/vmlinuz-2.6.18-274.3.1.el5.028stab094.3xen root=/dev/sda1 initrd /boot/initrd-2.6.18-274.3.1.el5.028stab094.3xen.img
Reboot and then login again to check that you’re on OpenVZ kernel:
ssh -i ~/aws_ssh.key root@ec2-204-236-152-176.us-west-1.compute.amazonaws.com Last login: Tue Nov 29 05:34:50 2011 from 94.45.135.130 [root@ip-10-176-46-67 ~]# uname -a Linux ip-10-176-46-67 2.6.18-274.7.1.el5.028stab095.1xen #1 SMP Mon Oct 24 21:00:35 MSD 2011 x86_64 x86_64 x86_64 GNU/Linux
Download & install OpenVZ CentOS5 template:
wget http://download.openvz.org/template/precreated/centos-5-x86_64.tar.gz #Symlink OpenVZ CentOS template [ -d /vz/template/cache ] || mkdir -p /vz/template/cache ln -s /root/centos-5-x86_64.tar.gz /vz/template/cache
Create your first OpenVZ container(VM)
vzctl create 101 --ostemplate centos-5-x86_64 > /dev/null vzctl set 101 --ipadd 10.0.102.101 --save > /dev/null vzctl set 101 --nameserver 8.8.8.8 --save > /dev/null vzctl set 101 --name "APP1" --save > /dev/null vzctl set 101 --onboot yes --save > /dev/null
Try to login into APP1 shell:
vzctl enter 101
At this point, if you was able to create APP1 container, you can setup other components of your system — Database, Cache server, whatever you want.
Page 2 of 2 | Previous page