Installing Eucalyptus On Centos: Setup
Installing Eucalyptus On Centos: Setup
nl/installing-eucalyptus-on-centos/
062009
Setup Eucalyptus is software that enables you to run your own cloud. It aims to be API compatible with Amazons EC2, which means you can use most of the tools that are written for that system with Eucalyptus too. This articles describes my successful attempt at installing Eucalyptus 1.4 on CentOS 5.2 with managed network mode. The installation is performed on two different types of machines:
The front-end, which is the machine controlling the cloud The compute nodes, which run the virtual machines
Front-end
The front-end has two network interfaces. One (eth0) is connected to the compute nodes and has IP address 192.168.1.254. The other (eth1) is connected to the LAN and has IP address 172.16.0.254.
SELINUX=disabled
net.ipv4.ip_forward = 1
sysctl -p /etc/sysctl.conf
iptables --flush iptables --table nat --flush iptables --delete-chain iptables --table nat --delete-chain iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE iptables --append FORWARD --in-interface eth0 -j ACCEPT
/etc/init.d/iptables save
Download the Sun Java Development Kit version 6 and install it:
chmod +x jdk-6u13-linux-i586-rpm.bin
./jdk-6u13-linux-i586-rpm.bin
Some environment variables need to be present for Eucalyptus to work. Edit the file /etc/profile and add the following:
Download the Eucalyptus files and extract the RPM dependencies file:
The configuration file /opt/eucalyptus/etc/eucalyptus/eucalyptus.conf contains the following for our setup:
START_NC="N" ENABLE_WS_SECURITY="Y" LOGLEVEL="DEBUG" CLOUD_PORT="8773" CLOUD_SSL_PORT="8443" CC_PORT="8774" SCHEDPOLICY="GREEDY" NODES="192.168.1.1 192.168.1.2 192.168.1.3" NC_SERVICE="axis2/services/EucalyptusNC" NC_PORT="8775" VNET_INTERFACE="eth0" VNET_DHCPDAEMON="/usr/sbin/dhcpd" VNET_MODE="MANAGED" VNET_SUBNET="10.0.0.0" VNET_NETMASK="255.0.0.0" VNET_DNS="172.16.0.1" VNET_ADDRSPERNET="64"
Compute nodes
The compute nodes have one network interface (eth0) which is connected to the front-end and they have IP addresses ranging from 192.168.1.1 to 192.168.1.3 (for three compute nodes).
SELINUX=disabled
iptables --flush iptables --table nat --flush iptables --delete-chain iptables --table nat --delete-chain
/etc/init.d/iptables save
Install Xen:
Make sure the correct kernel with xen enabled is started at boot by editing the file /boot/grub/menu.lst:
default=0
And reboot.
Download the Eucalyptus files and extract the RPM dependencies file:
eucalyptus-nc-1.4-2.i386.rpm
mkdir -p /usr/local/instances
The configuration file /opt/eucalyptus/etc/eucalyptus/eucalyptus.conf contains the following for our setup:
EUCALYPTUS="/opt/eucalyptus" START_CLOUD="N" START_CC="N" START_NC="Y" ENABLE_WS_SECURITY="Y" LOGLEVEL="DEBUG" NC_PORT="8775" INSTANCE_PATH="/usr/local/instances" VNET_INTERFACE="peth0" VNET_BRIDGE="xenbr0" VNET_MODE="MANAGED"
/etc/init.d/eucalyptus start
/etc/init.d/eucalyptus start
If all went according to plan, the following website should be viewable: https://172.16.0.254:8443. Login with username admin and password admin. Add a cluster with a name you like, e.g. my_cluster, and the IP address of the front-end, in our case 172.16.0.254.
Now download the x509 certificate to be able to connect to the Eucalyptus setup. Unzip the contents of this file:
There is a file containing aliases for several commands you run that needs to be sourced every time you login. It is easier to do this automatically, so edit the file ~/.bash_profile and add this line to the end:
source /root/.euca/eucarc
/opt/eucalyptus/usr/sbin/euca_sync_key -c /opt/eucalyptus/etc/eucalyptus/eucalyptus.conf
You can now see if the EC2 command line tools and Eucalyptus are working:
ec2-describe-availability-zones verbose
This should give you an overview of the running system, with a listing of the compute nodes and the capacity of them in terms of number of running instances they can hold.
ec2-bundle-image --image /root/ttylinux/vmlinuz-2.6.16.33-xen --kernel true ec2-upload-bundle --bucket kernel-bucket --manifest /tmp/vmlinuz2.6.16.33-xen.manifest.xml ec2-register kernel-bucket/vmlinuz-2.6.16.33-xen.manifest.xml
ec2-bundle-image --image /root/ttylinux/ttylinux.img ec2-upload-bundle --bucket image-bucket --manifest /tmp/ttylinux.img.manifest.xml ec2-register image-bucket/ttylinux.img.manifest.xml
If all went well, you can list the images just uploaded:
ec2-describe-images
ec2-describe-instances
To see the console output of the running instance (change i-3F170798 with the instance-identifier returned by ec2-describe-instances):
ec2-get-console-output i-3F170798