Sie sind auf Seite 1von 14

Appendix-B

Setting up Eucalyptus on a Cluster of Machines


This guide provides instructions for a single-cluster deployment of Eucalyptus Open Source
release 2.0.3 on a two-machine system running CentOS 5.7.

Eucalyptus Overview
Eucalyptus is a Linux-based software architecture that implements scalable private and hybrid
clouds within your existing IT infrastructure. Eucalyptus allows you to provision your own
collections of resources (hardware, storage, and network) using a self-service interface on an as-
needed basis.

Eucalyptus Components
Eucalyptus consists of the following distributed components:
- CLC: Cloud Controller (EC2 functionality)
- Walrus (S3 functionality)
- CC: Cluster Controller (middle-tier cluster management service)
- SC: Storage Controller (EBS functionality)
- NC: Node Controller (controls VM instances)
Hardware Requirements
You will need a minimum of two machines to host Eucalyptus components. All the node machines
should have multicore processor with virtualization Technology (VT) enable.

Frontend/Base (CLC, Walrus, CC, SC): Minimum 100GB HDD and 4-8GB RAM
Node (NC): Minimum 100GB HDD and 4-8GB RAM
Be sure that all machines are running the latest release of CentOS 5.7. Test that all systems allow
ssh login, and that root access is available (sudo is OK)

Network Requirements
1. You must have a DHCP server available (installed but not running).
2. You must have a range of available public IP addresses. These will be assigned to Virtual
Machines (instances).
3. You must have a large range of available private IP addresses. These will be used by a virtual
subnet. They cannot overlap or contain any part of a physical network IP address space.
Software Requirements
74
You must have access to the following:
- CentOS 5.7 install CD
- Eucalyptus Fast Start media (the same can be download from eucalyptus web site
http://open.eucalyptus.com )

A) Operating System (OS) Installation

B) Node Configuration

C) Frontend Configuration

D) Getting Started Using Eucalyptus 2.0.3


1- SSH Key Management
2- Image Management
3- Virtual Machine (VM) Instance Management
4- Block Storage Management
5- How to rebuild or rebase the instance?

E) FAQ

For details visit the below URL:


http://open.eucalyptus.com
Last accessed: 21-March-2012

75
A) Install CentOS 5.7 on all machines

1- At the boot: prompt, press ENTER for the graphical installer. You can skip the media
verification if you like, then accept the defaults, with the following exceptions

1.1 For network interface configuration, select “Edit” and manually configure
I) IP address
II) Netmask
III) Hostname
IV) Gateway
V) DNS

For example:
IP address: 192.168.1.65
netmask: 255.255.255.0
hostname: node1.in
gateway: leave it blank
DNS: leave it blank

1.2 Package options


- Deselect “Desktop - Gnome”
- Select “Server”
- Select “Customize later”
- Click next

1.3 Choose install CentOS, click next choose select remove linux partitions on selected drives &
create default layout, click next

1.4 Choose region -> Asia/Kolkata


- Deselect "System Clock uses UTC"
After complete OS installation machine will be rebooted.

Tip: We recommend that you install your node controllers first so that you can register them with
the frontend/base server as part of that install.

76
B) Node Configuring

1- Now login as root on node machine insert the Eucalyptus Fast Start media (CD/DVD or
pendrive) and mount it for copy the cloud setup

mkdir /media/usb/
mount -t vfat /dev/sdb1 /media/usb

Note: the USB drive might appear as a device other than /dev/sdb1 depending on your hardware
configuration (i.e. /dev/sdc1, etc.). Use the command “fdisk –l” to see the devices.

2- Stop the firewall


/etc/init.d/iptables save
/etc/init.d/iptables stop
chkconfig iptables off

3- Install ntp to update date and time of the other machines of the network.

yum install ntp


Uncomment the below line in /etc/ntp.conf
“broadcast 192.168.1.255 key 42”

Edit the above line to “broadcast 192.168.1.255” save and exit


/etc/init.d/ntpd start

4- For NC Configuring

cd /root/faststartusb
chmod +x *.sh
./fastinstall.sh
Answer n to the first question (this is not the front-end server).

Note: After the install completes, the machine will reboot automatically and be ready to use.

77
C) Frontend Configuring

1- Now login as root on node machine insert the Eucalyptus Fast Start media (CD/DVD or
pendrive) and mount it for copy the cloud setup

mkdir /media/usb/
mount -t vfat /dev/sdb1 /media/usb

Note: The USB drive might appear as a device other than /dev/sdb1 depending on your hardware
configuration (i.e. /dev/sdc1, etc.)

2- Stop the firewall


/etc/init.d/iptables save
/etc/init.d/iptables stop
chkconfig iptables off

3- Synchronize the machine with NTP server running to any machine in the cluster install ntp
first and update the date and time by using “ntpdate <NODE-IP>” command. (NODE-IP is IP-
address of the machine where NTP server running)

yum install ntp


ntpdate 192.168.1.65

4- Ensure from your front machine, node(s) should be accessible “ping NODE-IP” or “ssh
root@NODE-IP” (don't login only for testing weather it ask for password

5- For Frontend configuring

cd /root/faststartusb
chmod +x *.sh
./fastinstall.sh
Answer y to the first question (this is the front-end server)

Note: In the install process, you will be asked for

a. Public and private network interfaces (defaults should be fine)


b. Private subnet (address used by instances internal to the cloud)
c. Private netmask
d. DNS server address (used for name resolution in the cloud)
e. Available IP addresses for the instances (public address on your network that instances can
use)
78
For example:
The public ethernet interface [eth0] Press ENTER
The private ethernet interface [eth0] Press ENTER
Eucalyptus-only dedicated subnet [192.168.0.0] 192.168.1.0
Eucalyptus subnet netmask [255.255.255.0] 255.255.255.0
The DNS server address [?.?.?.?] Press ENTER
Based on the size of your private subnet, we recommend the next value be set to 16
How many addresses per net? [32] 16
The range of public IPs [?.?.?.?-?.?.?.?] 192.168.1.100-192.168.1.120

Services will now start and the script will wait for the CLC to run. The script registers components
(you will be asked about connecting to the server over ssh and to provide the root password).
As the last step on the frontend, you need to enter the IP address of each NC (you can have more
than one). Press ENTER (at the prompt) when you are done

In a web browser, go to the URL provided. It will be in this format


https://<your_frontend_IP_address>:8443/

6- Login as admin/admin

7- Enter a new admin password and your email address


e.g. passwd: admin123
email : admin@localhost

8- Configure dhcpd server to assign IP of virtual Machines copy below lines and paste in
dhcpd.conf save and exit. Start the dhcpd server
-------------------------------------------
option domain-name "lan.ltrc.org";
ddns-update-style none;
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;

subnet 192.168.1.0 netmask 255.255.255.0 {


authoritative;
range 192.168.1.100 192.168.1.120;
option routers 192.168.1.60;
}
-------------------------------------------
vi /etc/dhcpd.conf
copy & paste above lines then save and re-start dhcpd server
/etc/init.d/dhcpd start
Once your dhcpd server is started then your cloud cluster is ready to use.
79
D) Getting Started Using Eucalyptus 2.0.3
Euca2ools are command-line tools for interacting the Eucalyptus and also compatible with
Amazon EC2 and S3 services.
Login to front end machine and export the environment variables be executing the below
commands
source the eucarc file to use euca2ools
source /root/eucarc

Is our eucalyptus running properly?


You may run “euca-describe-availability-zones verbose” command to see the eucalyptus is
running.
euca-describe-availability-zones verbose
Above command output the available cloud resources. If you see the available resources properly
then ONLY you can use it.
For quick start the following steps

Create a keypair for ssh authentication


euca-add-keypair mykey | tee mykey.private
chmod 0600 mykey.private

Launch the instance


To launch the instance first see the available images in your cloud cluster by running “euca-
describe-images” command
euca-describe-images
"euca-run-instances" will allow you to deploy VM instances of images that have been previously
uploaded to the cloud.
For instance, to run an instance of the image with id "emi-53444344" with the kernel "eki-
34323333" the ramdisk "eri-33344234" and the keypair "mykey" you can use the following
command
euca-run-instances -k mykey --kernel eki-34323333 --ramdisk eri-33344234 emi-53444344

It will take some time to boot the instance, in the mean time run “euca-describe-instances”
command to see the status.
Once the status is running then you can login and work on the newly launched instance.
For more help, try,
euca-run-instances --help

Login to instance
ssh -i mykey.private root@<accessible-instance-ip>
80
1- SSH Key Management

1.1 Adding a keypair

euca-add-keypair <keypair-name>

e.g. euca-add-keypair mykey | tee mykey.private

A pair of keys is created; one public key, stored in Eucalyptus, and one private key stored in the
file mykey.private and printed to standard output. The ssh client requires strict permissions on
private keys:
chmod 0600 mykey.private

For more options, type


euca-add-keypair --help

1.2 Listing the key pairs


You may use “euca-describe-keypairs” which display a list of available key pairs
euca-describe-keypairs

For more options, type


euca-describe-keypairs --help

1.3 Delete a keypair


You may use “euca-delete-keypair testkey” which delete testkey.

euca-delete-keypair <keypair-name>

For more options, type euca-delete-


keypair --help

81
2- Image Management

In order to use run instances from images that you have created (or downloaded), you need to
bundle the images with your cloud credentials, upload them and register them with the cloud.

2.1 Adding images into the cloud


The examples here assume that you have sourced the eucarc config file obtained when you
downloaded user credentials.
Add the kernel to Walrus, and register it with Eucalyptus (WARNING: your bucket names must
not end with a slash!)
euca-bundle-image -i <kernel file> --kernel true
euca-upload-bundle -b <kernel bucket> -m /tmp/<kernel file>.manifest.xml euca-
register <kernel-bucket>/<kernel file>.manifest.xml

Next, add the root file system image to Walrus euca-bundle-

image -i <vm image file>


euca-upload-bundle -b <image bucket> -m /tmp/<vm image file>.manifest.xml euca-
register <image bucket>/<vm image file>.manifest.xml
add the ramdisk to Walrus:
euca-bundle-image -i <initrd file> --ramdisk true
euca-upload-bundle -b <initrd bucket> -m /tmp/<initrd file>.manifest.xml euca-
register <initrd bucket>/<initrd file>.manifest.xml

Examples
Following is an example using the Ubuntu pre-packaged image that we provide using the included
KVM compatible kernel/ramdisk (a Xen compatible kernel/ramdisk is also included).

tar zxvf euca-ubuntu-9.04-x86_64.tar.gz


euca-bundle-image -i euca-ubuntu-9.04-x86_64/kvm-kernel/vmlinuz-2.6.28-11-generic --kernel
true
euca-upload-bundle -b ubuntu-kernel-bucket -m /tmp/vmlinuz-2.6.28-11-generic.manifest.xml
euca-register ubuntu-kernel-bucket/vmlinuz-2.6.28-11-generic.manifest.xml
(set the printed eki to $EKI)

euca-bundle-image -i euca-ubuntu-9.04-x86_64/kvm-kernel/initrd.img-2.6.28-11-generic --
ramdisk true
euca-upload-bundle -b ubuntu-ramdisk-bucket -m /tmp/initrd.img-2.6.28-11-
generic.manifest.xml
euca-register ubuntu-ramdisk-bucket/initrd.img-2.6.28-11-generic.manifest.xml
(set the printed eri to $ERI)

82
euca-bundle-image -i euca-ubuntu-9.04-x86_64/ubuntu.9-04.x86-64.img --kernel $EKI --ramdisk
$ERI
euca-upload-bundle -b ubuntu-image-bucket -m /tmp/ubuntu.9-04.x86-64.img.manifest.xml
euca-register ubuntu-image-bucket/ubuntu.9-04.x86-64.img.manifest.xml

2.2 Listing the images


You may use “euca-describe-images” which display a list of available images. euca-describe-
images

For more options, type


euca-describe-images --help

2.3 Deleting images

In order to delete an image, you must first de-register the image

euca-deregister <emi-XXXXXXXX>

Then, you can remove the files stored in your bucket. Assuming you have sourced your 'eucarc' to
set up EC2 client tools

euca-delete-bundle -a $EC2_ACCESS_KEY -s $EC2_SECRET_KEY --url $S3_URL -b <bucket> -p <file


prefix>

If you would like to remove the image and the bucket, add the '--clear' option

euca-delete-bundle -a $EC2_ACCESS_KEY -s $EC2_SECRET_KEY --url $S3_URL -b <bucket> -p <file


prefix> --clear

2.4 Downloading an image

Bundled images that have been uploaded may also be downloaded or deleted from the cloud.

For instance, to download the image(s) that have been uploaded to the bucket "image-bucket"
you may use the following command

euca-download-bundle -b image-bucket

For more options, type,

euca-download-bundle --help

83
3- Virtual Machine (VM) Instance Management

3.1 Running instances


"euca-run-instances" will allow you to deploy VM instances of images that have been previously
uploaded to the cloud.

For instance, to run an instance of the image with id "emi-53444344" with the kernel "eki-
34323333" the ramdisk "eri-33344234" and the keypair "mykey" you can use the following
command,

euca-run-instances -k mykey --kernel eki-34323333 --ramdisk eri-33344234 emi-53444344

To run more than one instances, you may use the "-n" or "--instance-count" option.

For more help, try,


euca-run-instances --help

3.2 Displaying instances currently running


You may use "euca-describe-instances" which will display a list of currently running instances.
euca-describe-instances

To get information about a specific instance, you can use the instance id as an argument to euca-
describe-instances. For example,

euca-describe-instances i-43035890

For more options, type,


euca-describe-instances --help

3.3 Logging into a VM Instance


You can now log into it with the SSH key that you created
ssh -i mykey.private root@<accessible-instance-ip>

3.4 Shutting down or terminating instances


You may shutdown running instances using the "euca-terminate-instances" command. For
example, to terminate an instance "i-34523332"
euca-terminate-instances i-34523332
For more options, type,
euca-terminate-instances --help
84
4 Block Storage Management

You can create dynamic block volumes, attach volumes to instances, detach volumes, deletes
volumes, create snapshots from volumes and create volumes from snapshots with your cloud.
Volumes are raw block devices. You can create a file system on top of an attached volume and
mount the volume inside a VM instance as a block device. You can also create instantaneous
snapshots from volumes and create volumes from snapshots.

4.1 Creating a volume


To create a dynamic block volume, use "euca-create-volume"
For instance, to create a volume that is 1GB in size in the availability zone "myzone" you may use
the following command,
euca-create-volume --size 1 -z myzone

To list availability zones, you may use "euca-describe-availability-zones"

You may also create a volume from an existing snapshot. For example, to create a volume from
the snapshot "snap-33453345" in the zone "myzone" tries the following command

euca-create-volume --snapshot snap-33453345 -z myzone

For more options, type,

euca-create-volume --help

4.2 Attaching a volume to an instance

You may attach block volumes to instances using "euca-attach-volume." You will need to specify
the local block device name (this will be used inside the instance) and the instance identified. For
instance, to attach a volume "vol-33534456" to the instance "i-99838888" at "/dev/sdb" use the
following command

euca-attach-volume -i i-99838888 -d /dev/sdb vol-33534456

You can attach a volume to only one instance at a given time.

4.3 Detaching a volume

To detach a previously attached volume, use "euca-detach-volume" For example, to detach the
volume "vol-33534456"
euca-detach-volume vol-33534456
85
You must detach a volume before terminating an instance or deleting a volume. If you fail to
detach a volume, it may leave the volume in an inconsistent state and you risk losing data.

4.4 Delete a volume

To delete a volume, use "euca-delete-volume." For example, to delete the volume "vol-
33534456" use the following command

euca-delete-volume vol-33534456

You may only delete volumes that are not currently attached to instances.

4.5 Creating a snapshot

You may create an instantaneous snapshot of a volume. A volume could be attached and in use
during a snapshot operation. For example, to create a snapshot of the volume "vol-33534456"
use the following command

euca-create-snapshot vol-33534456

4.6 Deleting a snapshot

To delete a snapshot, use "euca-delete-snapshot" for example, to delete the snapshot snap-
33453345, use the following command,

euca-delete-snapshot snap-33453345

86
5 How to rebuild or rebase the instance?

Login the Virtual Machine to which you want rebuild/rebase for future use. Ensure that
euca2tools should be installed on the instance and synchronize the clock with NTP server running
in your private network.

Copy cloud credential to the instance and sourced the eucarc file. Before do the following ensure
“euca-describe-availability-zone verbose” command should run properly?

5.1 Bundle the instance


euca-bundle-vol -c ${EC2_CERT} -k ${EC2_PRIVATE_KEY} -u ${EC2_USER_ID} --ec2cert
${EUCALYPTUS_CERT} --no-inherit --kernel eki-8D9B16EA --ramdisk eri-87F516CA -d /mnt -p
demo-image -s 2048 -e /mnt,/root/.ssh/authorized_keys

5.2 Upload the image


euca-upload-bundle -b centos_sampark_dependency -m /mnt/sampark-
dependency.manifest.xml

5.6 Register the image


euca-register centos_sampark_dependency/sampark-dependency.manifest.xml

87

Das könnte Ihnen auch gefallen