Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3212393
  • 博文数量: 710
  • 博客积分: 14546
  • 博客等级: 上将
  • 技术积分: 6738
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-30 10:20
文章分类

全部博文(710)

文章存档

2016年(1)

2014年(7)

2013年(22)

2012年(227)

2011年(322)

2009年(119)

2008年(12)

分类: 虚拟化

2012-05-22 11:58:51

enucalyptus

doc
http://www.eucalyptus.com/eucalyptus-cloud/documentation

Eucalyptus组件:在逻辑上,Eucalyptus云包括4个组件:
存储控制器(walrus)
云控制器(简称CLC或者“cloud”)
集群控制器(cc)
节点控制器(nc)

the front end (clc,cc,walrs,sc)
10.50.121.101
the node (nc)
10.50.121.100

1.package install
yum install -y gcc ntp java-1.6.0-openjdk ant ant-nodeps  dhcp bridge-utils \  perl-Convert-ASN1.noarch  scsi-target-utils  httpd  xen*   kernel-xen*

2.configure xen
sed --in-place 's/#(xend-http-server no)/(xend-http-server yes)/' /etc/xen/xend-config.sxp
sed --in-place 's/#(xend-address localhost)/(xend-address localhost)/' /etc/xen/xend-config.sxp

3.
[root@xen100 ~]# uname  -r
2.6.18-194.el5xen

4.iptables,selinux off

5.Install RPMs on the Front End (xen101)
tar xf eucalyptus-2.0.3-centos-x86_64.tar.gz
cd /root/eucalyptus-2.0.3-centos-x86_64/eucalyptus-2.0.3-rpm-deps-x86_64
rpm -Uvh aoetools-21-1.el4.x86_64.rpm \
euca-axis2c-1.6.0-1.x86_64.rpm \
euca-rampartc-1.3.0-6.el5.x86_64.rpm \
vblade-14-1mdv2008.1.x86_64.rpm \
vtun-3.0.2-1.el5.rf.x86_64.rpm \
lzo2-2.02-3.el5.rf.x86_64.rpm \
perl-Crypt-OpenSSL-Random-0.04-1.el5.rf.x86_64.rpm \
perl-Crypt-OpenSSL-RSA-0.25-1.el5.rf.x86_64.rpm \
perl-Crypt-X509-0.32-1.el5.rf.noarch.rpm \
python25-2.5.1-bashton1.x86_64.rpm \
python25-devel-2.5.1-bashton1.x86_64.rpm \
python25-libs-2.5.1-bashton1.x86_64.rpm

cd ..

rpm -Uvh eucalyptus-2.0.3-0.1.el5.x86_64.rpm \
eucalyptus-common-java-2.0.3-0.1.el5.x86_64.rpm \
eucalyptus-cloud-2.0.3-0.1.el5.x86_64.rpm \
eucalyptus-walrus-2.0.3-0.1.el5.x86_64.rpm \
eucalyptus-sc-2.0.3-0.1.el5.x86_64.rpm \
eucalyptus-cc-2.0.3-0.1.el5.x86_64.rpm \
eucalyptus-gl-2.0.3-0.1.el5.x86_64.rpm

Error01
[root@xen101 eucalyptus-2.0.3-centos-x86_64]# rpm -Uvh eucalyptus-2.0.3-0.1.el5.x86_64.rpm eucalyptus-common-java-2.0.3-0.1.el5.x86_64.rpm eucalyptus-cloud-2.0.3-0.1.el5.x86_64.rpm eucalyptus-walrus-2.0.3-0.1.el5.x86_64.rpm eucalyptus-sc-2.0.3-0.1.el5.x86_64.rpm eucalyptus-cc-2.0.3-0.1.el5.x86_64.rpm eucalyptus-gl-2.0.3-0.1.el5.x86_64.rpm
error: Failed dependencies:
        libcurl.so.3()(64bit) is needed by eucalyptus-2.0.3-0.1.el5.x86_64
        vconfig is needed by eucalyptus-2.0.3-0.1.el5.x86_64
        libcurl.so.3()(64bit) is needed by eucalyptus-cc-2.0.3-0.1.el5.x86_64
解决方法:
yum install curl  vconfig


6.Install RPMs on the Nodes(xen100)
rpm -Uvh aoetools-21-1.el4.x86_64.rpm \
euca-axis2c-1.6.0-1.x86_64.rpm \
euca-rampartc-1.3.0-6.el5.x86_64.rpm \
perl-Crypt-OpenSSL-Random-0.04-1.el5.rf.x86_64.rpm \
perl-Crypt-OpenSSL-RSA-0.25-1.el5.rf.x86_64.rpm \
perl-Crypt-X509-0.32-1.el5.rf.noarch.rpm \
python25-2.5.1-bashton1.x86_64.rpm \
python25-devel-2.5.1-bashton1.x86_64.rpm \
python25-libs-2.5.1-bashton1.x86_64.rpm

cd ..

rpm -Uvh eucalyptus-2.0.3-0.1.el5.x86_64.rpm \
eucalyptus-gl-2.0.3-0.1.el5.x86_64.rpm \
eucalyptus-nc-2.0.3-0.1.el5.x86_64.rpm

7.post-install steps
/etc/libvirt/libvirtd.conf
unix_sock_group = "libvirt"
unix_sock_ro_perms = "0777"
unix_sock_rw_perms = "0770"

reboot machine

8.Start up your Eucalyptus services.
On the front-end:
/etc/init.d/eucalyptus-cloud start
/etc/init.d/eucalyptus-cc start

On the node(s):
/etc/init.d/eucalyptus-nc start

9.add home
mkdir /home/eucalyptus
chown eucalyptus.  /home/eucalyptus
chmod 700 /home/eucalyptus/

10.test install
su eucalyptus -c "virsh list"

11注册控制机以及节点
a)注册frontend节点
a1)注册walrus所在节点
euca_conf --register-walrus 10.50.121.101
a2)IP前加上自定义的CLC的名字
euca_conf --register-cluster cluster101 10.50.121.101
a3)注册storage control
euca_conf --register-sc cluster101 10.50.121.101

b)注册node节点
euca_conf --register-nodes 10.50.121.100

c)验证注册是否成功
[root@xen101 ~]# euca_conf --list-walruses
registered walruses:
   walrus  10.50.121.101
[root@xen101 ~]# euca_conf --list-clusters
registered clusters:
   cluster101  10.50.121.101
[root@xen101 ~]# euca_conf --list-scs
registered storage controllers:
   cluster101  10.50.121.101
[root@xen101 ~]# euca_conf --list-nodes
registered nodes:
   10.50.121.100  cluster101  

11.
a)login

admin/bestvwin

b)download credentials to zoness29
unzip euca2-admin-x509.zip  -d euca
mv euca  .euca
cd .euca
chmod 755 *
echo "[ -r ~/.euca/eucarc ] && ~/.euca/eucarc" >>  ~/.bashrc

download Euca2ools

tar zxvf euca2ools-$VERSION-*.tar.gz
cd euca2ools-$VERSION-*
sudo -s
yum install -y swig
rpm -Uvh python25-2.5.1-bashton1.x86_64.rpm \
python25-libs-2.5.1-bashton1.x86_64.rpm \
euca2ools-1.3.1-1.x86_64.rpm

c)安装存储镜像
download

http://www.eucalyptus.com/download/images
tar xf euca-centos-5.3-x86_64.tar.gz

source ~/.euca/eucarc
####生成EKI,以上长传并注册kernel
1# euca-bundle-image -i euca-centos-5.3-x86_64/xen-kernel/vmlinuz-2.6.27.21-0.1-xen --kernel true
.......
Generating manifest /tmp/vmlinuz-2.6.27.21-0.1-xen.manifest.xml
2# euca-upload-bundle -b centos-kernel-bucket -m /tmp/vmlinuz-2.6.27.21-0.1-xen.manifest.xml
.......
Uploaded image as centos-kernel-bucket/vmlinuz-2.6.27.21-0.1-xen.manifest.xml
3# euca-register centos-kernel-bucket/vmlinuz-2.6.27.21-0.1-xen.manifest.xml
IMAGE   eki-8E591708
####生成ERI,以上长传并注册ramdisk(非必须)
1# euca-bundle-image  -i euca-centos-5.3-x86_64/xen-kernel/initrd-2.6.27.21-0.1-xen  --ramdisk true
.........
Generating manifest /tmp/initrd-2.6.27.21-0.1-xen.manifest.xml
2# euca-upload-bundle -b centos-ramdisk-bucket -m /tmp/initrd-2.6.27.21-0.1-xen.manifest.xml
.........
Uploaded image as centos-ramdisk-bucket/initrd-2.6.27.21-0.1-xen.manifest.xml
3# euca-register centos-ramdisk-bucket/initrd-2.6.27.21-0.1-xen.manifest.xml
IMAGE   eri-885816D3
####生成EMI,长传并注册img
1# euca-bundle-image  -i euca-centos-5.3-x86_64/centos.5-3.x86-64.img  --kernel eki-8E591708 --ramdisk eri-885816D3
.........
Generating manifest /tmp/centos.5-3.x86-64.img.manifest.xml
2# euca-upload-bundle -b centos-image-bucket -m /tmp/centos.5-3.x86-64.img.manifest.xml
.........
Uploaded image as centos-image-bucket/centos.5-3.x86-64.img.manifest.xml
3# euca-register centos-image-bucket/centos.5-3.x86-64.img.manifest.xml
IMAGE   emi-1CF215AE

####查看镜像文件
web页面下/image就可以看到!这个镜像
# euca-describe-images
IMAGE   eri-885816D3    centos-ramdisk-bucket/initrd-2.6.27.21-0.1-xen.manifest.xml     admin   available       public          x86_64  ramdisk        instance-store
IMAGE   eri-884F16D2    centos-ramdisk-bucket/initrd-2.6.27.21-0.1-xen.manifest.xml     admin   available       public          x86_64  ramdisk        instance-store
IMAGE   emi-1CF215AE    centos-image-bucket/centos.5-3.x86-64.img.manifest.xml  admin   available       public          x86_64  machine eki-8E591708   eri-885816D3     instance-store
IMAGE   eki-8E591708    centos-kernel-bucket/vmlinuz-2.6.27.21-0.1-xen.manifest.xml     admin   available       public          x86_64  kernel         instance-store

####创建VM
首先创建密钥文件
[root@bestvpuppet ~]# euca-add-keypair mykey > mykey.private
[root@bestvpuppet ~]# chmod 0600 mykey.private
接着运行创建实例命令
euca-run-instances -k mykey emi-1CF215AE
RESERVATION     r-3F9A07D2      admin   admin-default
INSTANCE        i-574F095E      emi-1CF215AE    0.0.0.0 0.0.0.0 pending       mykey   2012-05-21T11:27:12.88Z eki-8E591708    eri-885816D3

euca-run-instances -k mykey -t m1.xlarge  emi-1CF215AE

#查看instance
euca-describe-instances
#关闭instance
euca-terminate-instances  i-4182084F


/etc/eucalyptus/eucalyptus.conf
VNET_BRIDGE="xenbr0" 选项可以修改为br0
br0配置
# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
BRIDGE=br0        ##
# cat ifcfg-br0
DEVICE=br0        ##
BOOTPROTO=static
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=10.50.121.100
GATEWAY=10.50.121.1
TYPE=Bridge       ##








阅读(1824) | 评论(0) | 转发(0) |
0

上一篇:成长

下一篇:英雄-岳飞

给主人留下些什么吧!~~