0% found this document useful (0 votes)
122 views11 pages

CentOS6 To Install Xen

This document provides instructions for installing Eucalyptus 2.0.3 on CentOS 6 using Xen virtualization. It describes downloading required packages, compiling dependencies, installing Eucalyptus components, and configuring the Eucalyptus cloud controller, cluster controller, node controller and storage controller. Finally, it provides an example of bundling, uploading and registering a Ubuntu 9.04 image for use in the Eucalyptus cloud.

Uploaded by

SaravanaRaajaa
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
122 views11 pages

CentOS6 To Install Xen

This document provides instructions for installing Eucalyptus 2.0.3 on CentOS 6 using Xen virtualization. It describes downloading required packages, compiling dependencies, installing Eucalyptus components, and configuring the Eucalyptus cloud controller, cluster controller, node controller and storage controller. Finally, it provides an example of bundling, uploading and registering a Ubuntu 9.04 image for use in the Eucalyptus cloud.

Uploaded by

SaravanaRaajaa
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

CentOS6 to install Xen-based Eucalyptus 2.0.

Server role
o

Cloud controller (CLC), to control the scheduling of cloud resources, while providing a web interface as well as compatible with EC2 SOAP service

Walrus, bucket-based storage, at the same time compatible with S3's SOAP services and REST interface

o o o

Cluster controller (CC), scheduling cluster units Storage controller (SC), block-based storage controllers, EBS-style Node controller (NC), virtual nodes running xen virtual machine machine

Version

CentOS 6 Minimal install Xen 4.1.1 NC server above need to be fully installed, the rest of the servers need several compiled rpm, reference http://blog.csdn.net/phoenixie/article/details/6885313,

Eucalyptus 2.0.3, download offline source package, http://eucalyptussoftware.com/downloads/releases/eucalyptus-2.0.3-srcoffline.tar.gz dependent libraries http://eucalyptussoftware.com/downloads/releases / eucalyptus-2.0.3-src-deps.tar.gz

euca2ools 1.3.1, fedora, download http://eucalyptussoftware.com/downloads/releases/euca2ools-1.3.1-fedorax86_64.tar.gz

dhcpd 3.0.5, CC on the need to install and use the old version rhel5 eucalyptus 2.0.3 on slightly higher version the ISC dhcpd support of a problem, downloadhttp://ftp.redhat.com/redhat/linux/enterprise/5Server/ en/os/SRPMS/dhcp-3.0.529.el5_7.1.src.rpm

Preparatory work
Download various package 2 In addition to the NC server other than installing CentOS 6 Minimal

3. NC server configured in accordance with the installation of the reference documentation Xen environment, pay attention to the Xen kernel configuration inside add a max_loop = 256 Configured all the machines in the NTP, the clock to keep them in sync

Installation process
1 Create / etc / yum.repos.d / euca.repo
[Plain] view plaincopy

1. [Euca] 2. name = Eucalyptus 3. baseurl = http://www.eucalyptussoftware.com/downloads/repo/eucalyptus/2.0.3/yum/centos/x86_64 4. gpgcheck = 0

Yum install necessary packages (all machines)


[Plain] view plaincopy

1. yum-y install perl-Convert-ASN1.noarch scsi-target-utils httpd java-1.6.0-openjdk-devel ant ant-nodeps libvirt-devel curl-devel httpd-devel apr-devel openssl-devel libxml2 libxml2-devel gnutls gnutls-devel libgcrypt-devel zlib-devel perl-Convert-ASN1 perlCrypt-OpenSSL-RSA perl-Crypt-OpenSSL-Random chkfontpath fuse-libs swig gcc make patch compat-expat1 compat-db43 lzo2 vblade m2crypto lvm2 rsync ntp vconfig groff rpm-build

3 prior to installation of the rpm package compiled Xen (to the control server, the node server already installed xen do not need)
[Plain] view plaincopy

1. rpm-Uvh xen-licenses-*. x86_64.rpm xen-devel-*. x86_64.rpm xen-libs-*. x86_64.rpm

4. Install dhcpd
[Plain] view plaincopy

1. wget http://ftp.redhat.com/redhat/linux/enterprise/5Server/en/os/SRPMS/dhcp-3.0.529.el5_7.1.src.rpm 2. 3. rpm-i dhcp-3.0.5-29.el5_7.1.src.rpm 4. 5. cd ~ / rpmbuild / SPECS / 6. rpmbuild-bb dhcp.spec # If the compiler not to the past, may need to manually remove the-Werror compile option 7. 8. cd ~ / rpmbuild/RPMS/x86_64 / 9. rpm-Uvh dhcp-3.0.5-29.el6.1.x86_64.rpm # If you have installed a dhcp first manually delete the original

5 to install Eucalyptus dependence software (eucalyptus-2.0.3-src-deps.tar.gz)


[Plain] view plaincopy

1. export EUCALYPTUS = / home/public/eucalyptus-2.0.3 2. export APACHE_INCLUDES = / usr / include / httpd / 3. export APR_INCLUDES = / usr/include/apr-1 / 4. export AXIS2C_HOME = $ {EUCALYPTUS} / packages/axis2c-1.6.0 5. 6. mkdir-p $ {EUCALYPTUS} / packages / 7. 8. tar xzf eucalyptus-2.0.3-src-deps.tar.gz 9. cd eucalyptus-src-deps 10. 11. tar xzf axis2-1.4.tgz-C $ {EUCALYPTUS} / packages / 12. cd $ {EUCALYPTUS} / packages / 13. ln-sf axis2-1.4 axis2 14. cd 15. 16. tar xzf axis2c-src-1.6.0.tar.gz 17. cd axis2c-src-1.6.0 18. CFLAGS = "-w". / Configure - prefix = $ {AXIS2C_HOME}-with-apache2 = $ {APACHE_INCLUDES} - with-apr = $ {APR_INCLUDES} - enable-multi-thread = no 19. make 20. make install 21. cd 22. rm-rf axis2c-src-1.6.0 23. 24. export LD_LIBRARY_PATH = $ {AXIS2C_HOME} / lib 25. tar xzf rampartc-src-1.3.0-0euca2.tar.gz 26. cd rampartc-src-1.3.0 27. . / Configure - prefix = $ {AXIS2C_HOME} - enable-static = no - with-axis2 = $ {AXIS2C_HOME} / include/axis2-1.6.0 / 28. make 29. make install 30. rm-rf rampartc-src-1.3.0 31. 32. cd $ {EUCALYPTUS} / packages 33. ln-sf axis2c-1.6.0 axis2c 34. cd 35. sed-i "s; <\! - phase name = \" Security \ "/ ->; <phase name=\"Security\"/>; g" $ {AXIS2C_HOME} / axis2.xml 36. 37. cd .. 38. rm-rf eucalyptus-src-deps

6. Install Eucalyptus (eucalyptus-2.0.3-src-offline.tar.gz)


[Plain] view plaincopy

1. export EUCALYPTUS = / home/public/eucalyptus-2.0.3 2. export AXIS2_HOME = $ {EUCALYPTUS} / packages/axis2 3. export AXIS2C_HOME = $ {EUCALYPTUS} / packages/axis2c 4. export JAVA_HOME = "/ usr / lib / jvm / java-openjdk /" 5. export JAVA = "$ JAVA_HOME / JRE / bin / java" 6. 7. tar xzf eucalyptus-2.0.3-src-offline.tar.gz 8. cd eucalyptus-2.0.3-src-offline 9. . / Configure - with-axis2 = $ {AXIS2_HOME} - with-axis2c = $ {AXIS2C_HOME} - enabledebug - prefix = $ {EUCALYPTUS} 10. make 11. make install 12. cd 13. rm-rf eucalyptus-2.0.3-src-offline 14. 15. cd / home / public / 16. ln-sf eucalyptus-2.0.3 eucalyptus 17. 18. export EUCALYPTUS = / home / public / eucalyptus 19. ln-sf $ EUCALYPTUS / etc / init.d / eucalyptus-cloud / etc / init.d / eucalyptuscloud 20. ln-sf $ EUCALYPTUS / etc / init.d / eucalyptus-cc / etc / init.d / eucalyptus-cc 21. ln-sf $ EUCALYPTUS / etc / init.d / eucalyptus-nc / etc / init.d / eucalyptus-nc 22. 23. chkconfig eucalyptus-cloud off 24. chkconfig eucalyptus-cc off 25. chkconfig eucalyptus-nc off

7 installation tool (euca2ools-1.3.1-fedora-x86_64.tar.gz)


[Plain] view plaincopy

1. tar xzf euca2ools-1.3.1-fedora-x86_64.tar.gz 2. cd euca2ools-1.3.1-fedora-x86_64 3. 4. rpm-Uvh euca2ools-1.3.1-1.x86_64.rpm 5. 6. cd 7. rm-rf euca2ools-1.3.1-fedora-x86_64

Configuration
Create a dedicated user
[Plain] view plaincopy

1. adduser eucalyptus

2 initialization
[Plain] view plaincopy

1. export EUCALYPTUS = / home / public / eucalyptus 2. $ EUCALYPTUS / usr / sbin / euca_conf \ 3. -D $ EUCALYPTUS \ 4. 5. 6. 7. - Hypervisor xen \ - Instances / home / eucalyptus / instances \ - User eucalyptus \ - Setup

8. #-D: Eucalyptus path 9. # - Hypervisor: the hypervisor type can kvm or xen 10. # - Instances: instance storage path 11. # - User: service user 12. # - Setup: initialization 13. 14. service eucalyptus-nc start 15. chkconfig eucalyptus-nc on

3. Editing / home / public / eucalyptus / etc / eucalyptus / eucalyptus.conf, modify according to their needs, which VNET_BRIDGE xen to use the name of the bridge, the rest of the VNET_MODE Please refer to the description of the configuration file, which is written in great detail . Copy eucalyptus installation directory to all machines on the establishment of the link init.d, add the services of the service, and then also need to run once initialization 5 start NC
[Plain] view plaincopy

1. service eucalyptus-nc start # NC Web service default port 8775 2. chkconfig eucalyptus-nc on

6. Starts CC
[Plain] view plaincopy

1. service eucalyptus-cc start # CC Web service default port 8774 2. chkconfig eucalyptus-cc on

7 start related services, different services can be deployed in different machines above
[Plain] view plaincopy

1. export EUCALYPTUS = / home / public / eucalyptus 2. $ EUCALYPTUS / usr / sbin / euca_conf-d $ EUCALYPTUS - enable cloud 3. $ EUCALYPTUS / usr / sbin / euca_conf-d $ EUCALYPTUS - enable walrus 4. $ EUCALYPTUS / usr / sbin / euca_conf-d $ EUCALYPTUS - enable sc 5. 6. service eucalyptus-cloud start # all three services by this script, http port 8080, https port 8443, Web service port 8773 7. chkconfig eucalyptus-cloud on

8. Registration services
[Plain] view plaincopy

1. $ EUCALYPTUS / usr / sbin / euca_conf - register-walrus $ IP 2. $ EUCALYPTUS / usr / sbin / euca_conf - register-cluster OurCloud $ IP # register a Cluster, named OurCloud, the default port 8774 3. $ EUCALYPTUS / usr / sbin / euca_conf - register-sc OurCloud $ IP # to Cluster to add a SC

9. Registered node
[Plain] view plaincopy

1. $ EUCALYPTUS / usr / sbin / euca_conf - register-nodes $ IP

10. Visit Cloud (CLC) where IP https:// $ IP: 8443 username admin, password admin, after the success of the first landing will be asked to immediately change the password 11. navigation bar to find the management interface Credentials, enter Click the button "Download Credentials", 12. spread to the zip file install the euca2ools server, create a directory and unzip go to download a zip file , need to execute the following command once before each subsequent use euca2ools
[Plain] view plaincopy

1. source eucarc

13. Installation is complete

Example 1: use the official website of the Ubuntu image


1 download the address http://open.eucalyptus.com/wiki/EucalyptusUserImageCreatorGuide 2 Add (euca-ubuntu-9.04-x86_64.tar.gz)
[Plain] view plaincopy

1. tar xzf euca-ubuntu-9.04-x86_64.tar.gz 2. cd euca-ubuntu-9.04-x86_64 3. 4. # Into the operating environment 5. source ~ / .euca / eucarc 6. 7. # Upload kernel, a eki-XXXXXXXX 8. euca-bundle-image-d. / tmp /-i xen-kernel/vmlinuz-2.6.27.21-0.1-xen - kernel true

9. euca-upload-bundle-b ubuntu9-bucket-m ./tmp/vmlinuz-2.6.27.21-0.1-xen.manifest.xml 10. euca-register ubuntu9-bucket/vmlinuz-2.6.27.21-0.1-xen.manifest.xml 11. 12. # Upload ramdisk, an eri-XXXXXXXX 13. euca-bundle-image-d. / tmp /-i xen-kernel/initrd-2.6.27.21-0.1-xen - ramdisk true 14. euca-upload-bundle-b ubuntu9-bucket-m ./tmp/initrd-2.6.27.21-0.1-xen.manifest.xml 15. euca-register ubuntu9-bucket/initrd-2.6.27.21-0.1-xen.manifest.xml 16. 17. # Upload the root partition, the digital implementation of the above two commands 18. euca-bundle-image-d. / tmp /-i ubuntu.9-04.x86-64.img - kernel eki-XXXXXXXX - ramdisk eri-XXXXXXXX 19. euca-upload-bundle-b ubuntu9-bucket-m ./tmp/ubuntu.9-04.x86-64.img.manifest.xml 20. euca-register ubuntu9-bucket/ubuntu.9-04.x86-64.img.manifest.xml

Create a virtual machine with a login key


[Plain] view plaincopy

1. euca-add-keypair euca-key> ~ / euca-key.private 2. chmod 0600 ~ / euca-key.private

The emi value. Use just upload the virtual machine when starting a virtual machine instance
[Plain] view plaincopy

1. euca-run-instances-k euca-key-n 1 emi-XXXXXXXX

View running status, no dhcpd, then can not get IP


[Plain] view plaincopy

1. > Euca-describe-instances 2. 3. RESERVATION r-4F030A57 admin default 4. INSTANCE i-35C505C3 emi-XXXXXXXX 0.0.0.0 0.0.0.0 running euca-key 0 m1.small 2011-1101T10: 48:56.831 Z OurCloud eki-XXXXXXXX eri-XXXXXXXX

Example 2: Use the dhcpd assign IP


CC server IP eth3, 192.168.11.3/24; NC server, IP eth3, 192.168.11.4/24, Xen bridge the xenbr0; virtual machine can run from NC network access to the outside through the CC . configuration of CC / home / public / eucalyptus / etc / eucalyptus / eucalyptus.conf
[Plain] view plaincopy

1. VNET_PUBINTERFACE = "eth3" 2. VNET_PRIVINTERFACE = "eth3" 3. 4. VNET_DHCPDAEMON = "/ usr / sbin / dhcpd" 5. VNET_DHCPUSER = "eucalyptus"

6. 7. VNET_MODE = "MANAGED-NOVLAN" 8. VNET_SUBNET = "192.168.101.0" 9. VNET_NETMASK = "255.255.255.0" 10. VNET_DNS = "192.168.11.2" 11. VNET_ADDRSPERNET = "16" # This figure is too not be able to create a virtual machine 12. VNET_PUBLICIPS = "192.168.11.80-192.168.11.120" 13. VNET_CLOUDIP = "192.168.11.3" 14. # VNET_MODE = "SYSTEM"

2 The Configuration NC / home / public / eucalyptus / etc / eucalyptus / eucalyptus.conf,


[Plain] view plaincopy

1. VNET_PUBINTERFACE = "xenbr0" 2. VNET_PRIVINTERFACE = "xenbr0" 3. VNET_BRIDGE = "xenbr0" 4. VNET_MODE = "MANAGED_NOVLAN" 5. # VNET_MODE = "SYSTEM"

Restart the CC.


[Plain] view plaincopy

1. service eucalyptus-cc cleanrestart

Create a virtual machine and see


[Plain] view plaincopy

1. > Euca-run-instances-k euca-key-n 1 emi-XXXXXXXX 2. RESERVATION r-502007DA admin admin-default 3. INSTANCE i-440907AE emi-XXXXXXXX 0.0.0.0 0.0.0.0 pending euca-key 2011-11-04T11: 01:17.656 Z eki-XXXXXXXX eri-XXXXXXXX 4. 5. > Euca-describe-instances 6. RESERVATION r-502007DA admin default 7. INSTANCE i-440907AE emi-XXXXXXXX 192.168.11.101 192.168.101.131 running euca-key 0 m1.small 2011-11-04T11: 01:17.656 Z OurCloud eki-XXXXXXXX eri-XXXXXXXX 8. 9. > Ssh-i ~ / euca-key.private 192.168.11.101 10. root @ ubuntu: ~ # 11. 12. > Ip addr show eth0 13. UNKNOWN qlen 1000 14. link / ether d0: 0d: 44:09:07: ae brd ff: ff: ff: ff: ff: ff 15. 16. 17. 18. inet 192.168.101.131/28 brd 192.168.101.143 scope global eth0 inet6 fe80 :: d20d: 44ff: fe09: 7ae/64 scope link valid_lft forever preferred_lft forever

19. > Ping-c 1 192.168.11.2 20. PING 192.168.11.2 (192.168.11.2) 56 (84) bytes of data. 21. 64 bytes from 192.168.11.2: icmp_seq = 1 ttl = 63 time = 1.26 ms 22. 23. --- 192.168.11.2 ping statistics --24. 1 packets transmitted, 1 received, 0% packet loss, time 0ms 25. rtt min / avg / max / mdev = 1.264/1.264/1.264/0.000 ms

Example 3: establish CentOS6 virtual machine


1. Use virtinst to the minimal mode to install a CentOS6 virtual machine, get a hard drive partition on the trip, other partitions can be provincial, installed inside the virtual machine configuration software you need to turn off the virtual machine (installation parameters refer to http:// blog.csdn.net/phoenixie/article/details/6885313 ) Extraction of virtual machine / partition, it is assumed that the hard disk file named sda.img, 2GB
[Plain] view plaincopy

1. > Parted sda.img 2. GNU Parted 2.1 3. Using / home/vms/centos6/sda.img 4. Welcome to GNU Parted! Type 'help' to view a list of commands. 5. (Parted) U 6. Unit? [Compact]? <span Style="color:#ff0000;"> b </ span> 7. (Parted) p 8. Model: (file) 9. Disk / home/vms/centos6/sda.img: 2147483648B 10. Sector size (logical / physical): 512B/512B 11. Partition Table: msdos 12. 13. Number Start End Size Type File system Flags 14. 1 1048576B 2147483647B 2146435072B primary ext3 boot 15. 16. (Parted) quit 17. > Dd if = sda.img of = rootfs.img bs = 1M skip = 1 count = 2047 18. 2047 +0 records in 19. 2047 +0 records out 20. 2146435072 bytes (2.1 GB) copied, 37.3425 s, 57.5 MB / s

3. Configuration root partition file


[Plain] view plaincopy

1. # Load the root partition 2. mkdir / mnt / rootfs 3. mount-o loop rootfs.img / mnt / rootfs / 4.

5. # Copy the kernel and initramfs 6. cp / mnt/rootfs/boot/vmlinuz- *. / kernel 7. cp / mnt/rootfs/boot/initramfs- *. / ramdisk 8. 9. # Configure the card 10. rm udev/rules.d/70-persistent-net.rules 11. vi / mnt/rootfs/etc/udev/rules.d/60-net.rules 12. ACTION == "add", SUBSYSTEM == "net", IMPORT {program} = "/ lib / udev / rename_device" 13. SUBSYSTEM == "net", RUN + = "/ etc / sysconfig / network-scripts / net.hotplug" 14. 15. vi / mnt/rootfs/etc/sysconfig/network-scripts/ifcfg-eth0 16. DEVICE = eth0 17. BOOTPROTO = dhcp 18. ONBOOT = yes 19. TYPE = Ethernet 20. 21. # Turn off selinux 22. vi / mnt / rootfs / etc / sysconfig / selinux 23. SELINUX = disabled 24. 25. # Modify fstab, remove all the UUID 26. vi / mnt / rootfs / etc / fstab 27. / Dev/xvda1 / ext3 defaults, errors = remount-ro 0 0 28. / Dev/xvda2 / mnt ext3 defaults 0 0 29. / Dev/xvda3 swap swap defaults 0 0 30. tmpfs / dev / shm tmpfs defaults 0 0 31. devpts / dev / pts devpts gid = 5, mode = 620 0 0 32. sysfs / sys sysfs defaults 0 0 33. proc / proc proc defaults 0 0 34. 35. vi / mnt / rootfs / etc / mtab 36. / Dev/sda1 / ext3 rw, errors = remount-ro 0 0 37. proc / proc proc rw 0 0 38. sysfs / sys sysfs rw 0 0 39. 40. # Startup automatically download login ssh-rsa public key 41. vi / mnt / rootfs / etc / rc.local 42. # Simple attempt to get the user ssh key using the meta-data service 43. mkdir-p / root / .ssh 44. echo >> / root / .ssh / authorized_keys 45. curl-m 10-s http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key | grep 'ssh-rsa' >> / root / .ssh / authorized_keys 46. echo "AUTHORIZED_KEYS:" 47. echo "************************" 48. cat / root / .ssh / authorized_keys 49. echo "************************" 50.

51. # Remove the password 52. vi / mnt / rootfs / etc / shadow 53. root:!: 15280:0:99999:7 ::: 54. 55. # Uninstall 56. umount / mnt / rootfs

/ Home / public / eucalyptus / usr / share / eucalyptus / gen_libvirt_xml, modify the NC above all sda instead xvda, this modification, the official website will provide the image can not be used Finally, upload
[Plain] view plaincopy

1. source ~ / .euca / eucarc 2. # Upload kernel eki-KKKKKKKK 3. euca-bundle-image-d. / tmp /-i. / kernel - kernel true 4. euca-upload-bundle-b centos6-bucket-m. / tmp / kernel.manifest.xml 5. euca-register centos6-bucket/kernel.manifest.xml 6. # Upload ramdisk, an eri-RRRRRRRR 7. euca-bundle-image-d. / tmp /-i. / ramdisk - ramdisk true 8. euca-upload-bundle-b centos6-bucket-m. / tmp / ramdisk.manifest.xml 9. euca-register centos6-bucket/ramdisk.manifest.xml 10. # Upload the root partition 11. euca-bundle-image-d. / tmp /-i. / rootfs.img - kernel eki-KKKKKKKK - ramdisk eriRRRRRRRR 12. euca-upload-bundle-b centos6-bucket-m. / tmp / rootfs.img.manifest.xml 13. euca-register centos6-bucket/rootfs.img.manifest.xml

6 Now you can try, and the need to pay attention to the upcoming virtual machine disk created, can not be less than the number of bytes of the file of the root partition, otherwise it can not create a virtual machine; and set the virtual machine's memory, can not be less than the kernel minimum needs; these two parameters can be adjusted inside the management interface

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy