This is my implementation of Eucalyptus Enterprise Edition 2 with Centos, ESXi4 and OpenEucalyptus. Okay so the NAO robot isn’t a part of the project but it was a nice addition don’ t ya think.
This is my implementation of Eucalyptus Enterprise Edition 2 with Centos, ESXi4 and OpenEucalyptus. Okay so the NAO robot isn’t a part of the project but it was a nice addition don’ t ya think.
So, weak on linux skills and you want to build a cloud. Well do I have the thing for you. Ubuntu x64 9.04 Jaunty/Eucalyptus v1.5.1x86_64 Cloud. see: http://www.ubuntu.com/products/whatisubuntu/serveredition/cloud/UEC
Here is another example of my development and deployment of a Cloud Computing Cluster with Jaunty. This is a Intel Core 2 Quad-Core HeadNode and Compute Nodes. Please read this entire tutorial first because you may just need to run a script that would handle some configurtions.
Requirements (for 1 headnode and 2 compute node environment)
Intel or AMD Hyper-V Compatible multicore Processors x86_64
4gb + RAM
100 gb harddrive (/export mount point and / (root) must be atleast 40 gb)
HeadNode: Must have 2 network interface card (preferably gigabit ethernet)
ComputeNode: At Least 1 gigabit ethernet card
Gigabit Ethernet Switch
Resources:
Components (some of these will be added as a part of the Rocks implementation)
Configurations
check if hyper-v or paravirtualization compatible if no output not compatible:
Check on Physical Address Extensions – grep pae /proc/cpuinfo
Check Intel-VT or AMD-V for hardware virtualization.
Intel
grep vmx /proc/cpuinfo
AMD
grep svm /proc/cpuinfo
open ports: Headnode = 22, 25, 80, 443, 5900, 5901,8443, 8773, 8774
ComputeNode = 8775
also 5900, 5901 if you want to use vncviewer/vncserver there is also a
remote desktop utility for Centos, I believe vino.
Be sure selinux is disabled.
Use SYSTEM managed or default Networking configuration.
Instructions assume that you understand how to use linux and text editors. Also assumes that you understand networking, virtual machines and system configuration. Please do the configurations logged in with a root account. Please connect eth0 on internal lan to switch plus the nodes and eth1 on public wan. Be sure that the compute nodes can boot from network cards (PXE boot).
Ubuntu 9.04 Setup with Eucalyptus
Thursday, June 04, 2009
Sun Ultra24
Intel Quad Core Q9300 @ 2.5GHz
4gb ram
250 gb sata HDD
1 embedded intel Gigabit NIC (eth0)
1 intel pro 100 100 Megabit NIC (eth1)
Materials:
Ubuntu 9.04 Server from http://www.ubuntu.com/getubuntu/download-server
Requirements:
Email server
DHCP Server
GUI (on frontend or headnode) – gnome no recommendations
Network Configuration
Private IP 10.1.1.1
Subnet 255.0.0.0
DNS 10.1.1.1
Gateway 10.1.1.1
SYSTEN (HOSTNAME): SPSUITCLOUD
DOMAIN : SPSU.EDU
username: spsucloud
password: temp
DHCP Server on Ubuntu http://www.unix-tutorials.com/go.php?id=3938
MAC Address
This method entails using DHCP to identify the unique hardware address of each network card connected to the network and then continually supplying a constant configuration each time the DHCP client makes a request to the DHCP server using that network device.
Install DHCP server in ubuntu
sudo apt-get install dhcp3-server
This will complete the installation.
Configuring DHCP server
If you have two network cards in your ubuntu server you need to select which interface you want to use for DHCP server listening.By default it listens to eth0.
You can change this by editing /etc/default/dhcp3-server file
sudo vi /etc/default/dhcp3-server
Find this line
INTERFACES=”eth0″
Replace with the following line
INTERFACES=”eth1″
Save and exit.This is optional.
Next you need to make a backup copy of /etc/dhcp3/dhcpd.conf file
cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf.back
Edit /etc/dhcp3/dhcpd.conf file using the following command
sudo vi /etc/dhcp3/dhcpd.conf
Using address pool method
You need to change the following sections in /etc/dhcp3/dhcpd.conf file
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.1, 192.168.1.2;
option domain-name “yourdomainname.com”;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.200;
}
save and exit the file
This will result in the DHCP server giving a client an IP address from the range 192.168.1.10-192.168.1.200 . It will lease an IP address for 600 seconds if the client doesn’t ask for a specific time frame. Otherwise the maximum (allowed) lease will be 7200 seconds. The server will also “advise” the client that it should use 255.255.255.0 as its subnet mask, 192.168.1.255 as its broadcast address, 192.168.1.254 as the router/gateway and 192.168.1.1 and 192.168.1.2 as its DNS servers.
Using MAC address method
This method is you can reserver some of the machines or all the machines with fixed ip address.In the following example i am using fixed ip address for server1,server2,printer1 and printer2
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.1, 192.168.1.2;
option domain-name “yourdomainname.com”;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.200;
}
host server1 {
hardware ethernet 00:1b:63:ef:db:54;
fixed-address 192.168.1.20;
}
host server2 {
hardware ethernet 00:0a:95:b4:d4:b0;
fixed-address 192.168.1.21;
}
host printer1 {
hardware ethernet 00:16:cb:aa:2a:cd;
fixed-address 192.168.1.22;
}
host printer2 {
hardware ethernet 00:0a:95:f5:8f:b3;
fixed-address 192.168.1.23;
}
Now you need to restart dhcp server using the following command
sudo /etc/init.d/dhcp3-server restart
Configure Ubuntu DHCP Client
If you want to configure your ubuntu desktop as DHCP client following this procedure
You need to open /etc/network/interfaces file
sudo vi /etc/network/interfaces
make sure you have the following lines (eth0 is an example)
auto lo eth0
iface eth0 inet dhcp
iface lo inet loopback
Save and exit the file
You need to restart networking services using the following command
sudo /etc/init.d/networking restart
How to find DHCP server IP address
You need to use the following commands
sudo dhclient
or
tail -n 15 /var/lib/dhcp3/dhclient.*.leases
Share internet connection on ubuntu. http://ubuntuforums.org/showthread.php?t=91370
Share internet connection through ubuntu. So that node machines can get access to internet through head node.
1. Start by configuring the network card that interfaces to the other computers on you network:
# ifconfig ethX ip
where ethX is the network card and ip is your desired server ip address (Usually 192.168.0.1 is used)
2. Then configure the NAT as follows:
# iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE
where ethX is the network card that the Internet is coming from
# echo 1 > /proc/sys/net/ipv4/ip_forward
3. Install dnsmasq and ipmasq using apt-get:
# apt-get install dnsmasq ipmasq
4. Restart dnsmasq:
# /etc/init.d/dnsmasq restart
5. Reconfigure ipmasq to start after networking has been started:
# dpkg-reconfigure ipmasq
6. Repeat steps 1 and 2.
7. Add the line “net.ipv4.ip_forward = 1″ to /etc/sysctl.conf
# gedit /etc/sysctl.conf
8. Reboot. (Optional)
I hope this helps.
Good luck!
Eucalyptus Installation on Ubuntu 9.04
https://help.ubuntu.com/community/Eucalyptus
Tips*
Configure dhcp on a nic.
In:
/etc/network/interfaces
auto eth1
iface eth1 inet dhcp
Restart network
sudo /etc/init.d/networking restart
GUI installation
Install Gui Interface http://www.ubuntugeek.com/install-gui-in-ubuntu-server.html
Enable universe and multiverse
/etc/apt/sources.list
Gnome
Weak of heart: sudo apt-get install ubuntu-desktop
Lion heart: sudo aptitude install --no-install-recommends ubuntu-desktop
Xfce
sudo apt-get install xubuntu-desktop
KDE
sudo apt-get install kubuntu-desktop
see also sudo apt-get install xserver-xorg-video-nv
sudo apt-get install gnome
How to get command line in Ubuntu
tty1 (ctrl+alt+F1)
FTP Sever Setup
http://www.cyberciti.biz/faq/ubuntu-vsftpd-ftp-service-server/
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch15_:_Linux_FTP_Server_Setup
Useful Command options
- CTRL+ALT+F1 (session)
- CTRL+ALT+F2 (free tty)
- CTRL+ALT+F7 (GUI)
- CTRL+ALT+F8 (control)
POSTFIX mail
https://help.ubuntu.com/community/PostfixBasicSetupHowto
Quadro FX 370 drivers
http://www.nvidia.com/object/linux_display_amd64_180.60.html
http://us.download.nvidia.com/XFree86/Linux-x86_64/180.60/NVIDIA-Linux-x86_64-180.60-pkg2.run
So, you want to build a Rocks/Centos(RedHat Enterprise)/Eucalyptus Cloud
Here is an example of my development and deployment of a Cloud Computing Cluster using Centos5.3x86_64, Rock V.Ix86_64 and Eucalyptus v1.5.1x86_64 on a AMD Opteron Dual x64 / HeadNode and Intel Core 2 Quad-Core / Compute Nodes. Please read this entire tutorial first because you may just need to run a script that would handle some configuration.
Requirements: (for 1 headnode and 2 compute node environment)
Intel or AMD Hyper-V Compatible multicore Processors x86_64
4gb + RAM
100 gb harddrive (/export mount point and / (root) must be atleast 40 gb)
HeadNode: Must have 2 network interface card (preferably gigabit ethernet)
ComputeNode: At Least 1 gigabit ethernet card
Gigabit Ethernet Switch
Resources:
Components (some of these will be added as a part of the Rocks implementation)
Configurations
check if hyper-v or paravirtualization compatible if no output not compatible:
Check on Physical Address Extensions – grep pae /proc/cpuinfo
Check Intel-VT or AMD-V for hardware virtualization.
Intel
grep vmx /proc/cpuinfo
AMD
grep svm /proc/cpuinfo
open ports: Headnode = 22, 25, 80, 443, 5900, 5901,8443, 8773, 8774
ComputeNode = 8775
also 5900, 5901 if you want to use vncviewer/vncserver there is also a
remote desktop utility for Centos, I believe vino.
Be sure selinux is disabled.
Use SYSTEM managed or default Networking configuration.
Instructions assume that you understand how to use linux and text editors. Also assumes that you understand networking, virtual machines and system configuration. Please do the configurations logged in with a root account. Please connect eth0 on internal lan to switch plus the nodes and eth1 on public wan. Be sure that the compute nodes can boot from network cards (PXE boot). * Don’t forget to turn off PXE Boot after you have installed a vm-container-X-X.
First: Install the headnode by using the rocks documentation (Please Read entirely). You will need to begin by inserting your boot/kernel roll. Then type <build> (omit any < > seen in this tutorial, unless stated otherwise) Follow Rocks Documentation however replace the OS Rolls with the entire CD set for CentOS 5.3 x86_64. Record your information but keep it secure, normally the defaults are sufficient.
Plan your network configuration: I put a 192.168.42.95 for my static ip on eth1 (public wan) because this is in my network configuration talk to your network admin and get your info you will need the dns and gateway. I put 10.1.1.1 on eth0 (cloud lan) because this is what I want. If it recommends a default use it.
Use manual partition for the system with atleast:
Use ext3 file system.
40 gb / (force primary)
Ram * 3 swap (force primary)
40 gb /export
the rest if necessary as you see fit. By followng rocks documentation install should go by smoothly. Reboot into Rocks/Centos.
Share internet on compute nodes through your head node. You can put the following in a shell script and run it change your configurations to match your own.
linux-network-share.sh
#!/bin/bash
# Created by nixCraft – www.cyberciti.biz
# Edited by Micah Rowland
IPT=”/sbin/iptables”
MOD=”/sbin/modprobe”
# set wan interface such as eth1 or ppp0
SHARE_IF=”eth1″
# clean old fw
echo “Clearing old firewall rules…”
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
# Get some kernel modules
echo “Loading kernel modules…”
$MOD ip_tables
$MOD iptable_filter
$MOD iptable_nat
$MOD ip_conntrack
$MOD ipt_MASQUERADE
$MOD ip_nat_ftp
$MOD ip_nat_irc
$MOD ip_conntrack_ftp
$MOD ip_conntrack_irc
# Clean old rules if any, rhel specific but above will take care of everything
# service iptables stop
# unlimited traffic via loopback device
$IPT -A INPUT -i lo -j ACCEPT
$IPT -A OUTPUT -o lo -j ACCEPT
echo “Setting ${SHARE_IF} as router interface…”
$IPT –table nat –append POSTROUTING –out-interface ${SHARE_IF} -j MASQUERADE
# Start other custom rules
#$IPT
# End other custom rules
echo “*** Instructions on TCP/IP On The Windows / Mac / Linux Masqueraded Client ***”
echo “1. Login to your other LAN node computers”
echo “2. Use a text editor to modify your network setting with the info below modified
for your network.”
echo “3. Set DNS (NS1 and NS2) to 192.168.43.80 and 192.168.43.81″
echo “4. Create a route-eth0 file in /etc/sysconfig/network-scripts with appropriate permissions”
echo “5. Enter $(ifconfig ${SHARE_IF} | grep ‘inet addr:’| grep -v ’127.0.0.1′ | cut -d: -f2 | awk ‘{ print $1}’) as the default gateway.”
This adds a router for each subnet.
It goes <subnet> via <gateway> dev <device>. Here is my route-eth0 file. change yours accordingly.
# Added by Micah 7/7/09
default 10.1.1.1 dev eth0
10.1.0.0/24 via 10.1.1.1 dev eth0
192.168.42.0/24 via 192.168.42.95 dev eth0
192.168.0.0/24 via 192.168.122.1 dev eth0
Second: Let’s begin by configuring our package managers. We will be adding apt support considering most of the documentation is written in hopes of using Ubuntu 9.04 Server
In your yum.conf file enter this:
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
#baseurl=http://ftp.riken.jp/Linux/dag/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
then run:
rpm –import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
Then get the following repo file and add them here: /etc/yum.repos.d
CentOS-GITCO.repo
CentOS-GITCO_TESTING.repo
Now, yum install apt
After installation update the os.list file for apt for your CentOS Distro found here: /etc/apt/sources.list.d
edit os.list and add:
### CENTOS
repomd http://mirror.centos.org/ centos/$(VERSION)/os/$(ARCH)
repomd http://mirror.centos.org/ centos/$(VERSION)/updates/$(ARCH)
repomd http://mirror.centos.org/ centos/$(VERSION)/extras/$(ARCH)
also, uncomment any centos or redhat enterprise lines within reason. Modification may be needed. Please google.
I don’t update, but if you don’t have the version I mentioned above please update til you do. Please review the update components also.
Third: Eucalyptus pre-requisites. Now I used java.sun binary install for java 6 and apache foundation for ant 1.7.1 but Euclyptus team feels you should do this if using rocks then remove the <-y> cause you may have conflicts:
yum install -y java-1.6.0-openjdk-devel ant ant-nodeps libvirt-devel curl-devel httpd httpd-devel apr-devel openssl-devel dhcp
This may not be necessary because you used rocks, but remember not to get rocks confused with what you are doing here which is a eucalyptus cloud, not rocks cluster, because you want the amazon tools. Try it couldn’t hurt.
Fourth: Installation of Eucalyptus
Verify all node clocks are synchronized with ntp. Verify all required ports previously mentioned are open, Headnode = 22, 25, 80, 443, 5900, 5901, 8443, 8773, 8774 ComputeNode = 8775. This can be done through iptables or use the utility in Centos unders: System > Administration > Security Level and Firewall. Since the Compute nodes have no gui then do the iptables commands. see iptables or google or try. Later we will do dns masquerading so that your compute nodes get internet access. So, you may want to revisit this later to add a new rule.
/etc/sysconfig/iptables (verify you iptables file it may be different than this one)
iptables -I INPUT -p tcp –dport 8775 –syn -j ACCEPT
/etc/rc.d/init.d/iptables restart
Verify Xen get’s network connectivity on the compute nodes by manual loading a xen image. Please see xen documentation or google.
All downloads should be in your /opt directory. Now run:
tar zxvf eucalyptus-1.5.1-*.tar.gz
cd eucalyptus-1.5.1-*
then
go into the created directory eucalyptus-1.5.1-* and go into deps
directory and run the rpms. Before running the deps or eucalyptus,
If you are upgrading or had a different version installed please see
the documentation at open.eucalyptus.com. Or is you installed a Eucalyptus roll.
Run your rpm’s in order such as dependencies then libraries. see eucalyptus documentation.
In your /opt directory run:
unzip ec2-api-tools-1.3-30349.zip
unzip ec2-ami-tools-1.3-26357.zip
Fifth: Add your System Paths for Eucalyptus to access resources. You add this to the end of the /etc/profile or /etc/bashrc file. Like so:
export JAVA_HOME=/usr/java/jdk1.6.0_14
export EC2_HOME=/opt/ec2-api-tools-1.3-30349
export EC2_AMITOOL_HOME=/opt/ec2-ami-tools-1.3-26357
export EUCALYPTUS=/opt/eucalyptus
export PATH=$PATH:$HOME/.euca:$EUCALYPTUS:$JAVA_HOME/bin:/opt/apache-ant-1.7.1/bin:$EC2_HOME/bin:$EC2_AMITOOL_HOME/bin
Reference Links:
Rocks Documentation – http://www.rocksclusters.org/wordpress/?page_id=4
LinuxStreet – http://www.linuxstreet.net/news/E/19987/Install-Xen-3-3-on-CentOS-5-2-via-http-www-gitco-de-repo-xen3-3-0.html
Eucalyptus Doc – http://open.eucalyptus.com/wiki/EucalyptusPrerequisites_v1.5
Field Commander Wieers – http://dag.wieers.com/blog/using-apt-in-an-rpm-world
Gitco – http://www.gitco.de/linux/x86_64/centos/5/
CentOS / Redhat Linux Internet Connection Sharing – http://www.cyberciti.biz/faq/rhel-fedora-linux-internet-connection-sharing-howto/
Trouble Shoot and Support – http://forum.eucalyptus.com/forum/ (must sign up)
Downloads for this tutorial only.
wget http://s3.amazonaws.com/ec2-downloads/ec2-api-tools-1.3-30349.zip
wget http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools-1.3-26357.zip
Eucalyptus v1.5.1x86_64 Centos 5.3 – http://open.eucalyptus.com/downloads/90
euca-ttylinux – http://open.eucalyptus.com/downloads/3
Go to Start >> Run >> Type cmd or command.com
Type from the windows shell.
java -version.
Should see something like…
C:\>java -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
This would tell us that java is on your machine.
Know let's see why the program can't compile.
type javac… you should see something like this.
C:\>javac
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are us
ed
-classpath <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-d <directory> Specify where to place generated class files
-encoding <encoding> Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-help Print a synopsis of standard options
If not then check the path of your environmental variables. And confirm that the path to your java resources are available. Like this …
C:\>path
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\J2SDK1~1.2_0\bin
;C:\PROGRA~1\MI6841~1\80\Tools\Binn\;C:\MySQL\bi
Note the path C:\J2SDK1~1.2_0\bin which is the location of my java resources.
You can do this for your current windows shell by doing the following command. **Note: this will remove other resources from the path but we are just trying to compile java. You can set this permanently by doing it through system properties. I will tell you how when I figure how to put images up on wordpress. **
C:\>set Path=C:\J2SDK1~1.2_0\bin
C:\>
Then type java -version …
C:\>java -version
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
Then type javac …
C:\>javac
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are us
ed
-classpath <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-d <directory> Specify where to place generated class files
-encoding <encoding> Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-help Print a synopsis of standard options
Your ready to compile and run java code.