CentOS5.5下搭建Eucalyptus1.6.2云平台环境(转)
From: http://pengtyao.javaeye.com/blog/747164
CentOS5.5下搭建Eucalyptus1.6.2云平台环境
Eucalyptus支持Ubuntu 、CentOS、Debian、openSUSE四个平台,以CentOS平台为例详细说明一下完整搭建过程。
1.安装CentOS操作系统
首先下载CentOS操作系统的镜像文件,有i386和x86_64两种版本之分,i386只适合在32位机器上安装,x86_64在32位64位机器都合适安装。这里选择最新版CentOS-5.5-x86_64。官方下载地址:http://mirrors.163.com/centos/5.5/isos/x86_64/ 总共有8个镜像文件,注意是CentOS-5.5-x86_64-bin系列而非LiveCD。最简安装的话下载前两个镜像就行了。
具体安装参考附件中:CentOS_5.5_图形安装教程(超详细)。
2.依赖软件安装
- yum install gcc
- yum intall ntp
- yum install -y java-1.6.0-openjdk ant ant-nodeps dhcp bridge-utils httpd
yum install gcc yum intall ntp yum install -y java-1.6.0-openjdk ant ant-nodeps dhcp bridge-utils httpd
在安装Centos过程中把虚拟化选上,这样可以自动安装Xen,比较方便点。
3.配置Xen
安装完毕,进入系统
vim /etc/xen/xend-config.sxp
修改以下字段:
- (xend-http-server yes)
- (xend-unix-server yes)
- (xend-unix-path /var/lib/xend/xend-socket)
- (xend-address localhost)
- (network- script network-bridge)
- (vif- script vif-bridge)
- (dom0-min-mem 196)
- (dom0-cpus 0)
- (vncpasswd '')
(xend-http-server yes) (xend-unix-server yes) (xend-unix-path /var/lib/xend/xend-socket) (xend-address localhost) (network- script network-bridge) (vif- script vif-bridge) (dom0-min-mem 196) (dom0-cpus 0) (vncpasswd '')
4.配置防火墙
推荐把防火墙和Selinux关了,如果不关的话需要在防火墙上打开指定的端口
5.下载eucalyptus安装包,和euca2ool 管理工具
http://open.eucalyptus.com/downloads
分别下安装包和euca2ool包,选择你的版本
6.安装第三方软件包
- rpm -ivh aoetools-21-1.el4.x86_32.rpm
- euca-axis2c-1.5.0-2.x86_32.rpm
- euca-rampartc-1.2.0-1.x86_32.rpm
- vblade-14-1mdv2008.1.x86_32.rpm
rpm -ivh aoetools-21-1.el4.x86_32.rpm euca-axis2c-1.5.0-2.x86_32.rpm euca-rampartc-1.2.0-1.x86_32.rpm vblade-14-1mdv2008.1.x86_32.rpm
7.Eucalyptus安装
7.1.安装前端节点CC,CLC,后端数据节点NC,这里只为测试一下,所以都装在192.168.34.195上了。生产环境中是用层次的。切勿安装在一起。
- rpm -ivh eucalyptus-1.6.2-1.x86_32.rpm
- eucalyptus-cloud-1.6.2-1.x86_32.rpm
- eucalyptus-gl-1.6.2-1.x86_32.rpm
- eucalyptus-cc-1.6.2-1.x86_32.rpm
- eucalyptus-wc-1.6.2-1.x86_32.rpm
- eucalyptus-sc-1.6.2-1.x86_32.rpm// 安装node controller
- rpm -ivh eucalyptus-1.6.2-1.x86_32.rpm
- eucalyptus-gl-1.6.2-1.x86_32.rpm
- eucalyptus-nc-1.6.2-1.x86_32.rpm
rpm -ivh eucalyptus-1.6.2-1.x86_32.rpm eucalyptus-cloud-1.6.2-1.x86_32.rpm eucalyptus-gl-1.6.2-1.x86_32.rpm eucalyptus-cc-1.6.2-1.x86_32.rpm eucalyptus-wc-1.6.2-1.x86_32.rpm eucalyptus-sc-1.6.2-1.x86_32.rpm// 安装node controller rpm -ivh eucalyptus-1.6.2-1.x86_32.rpm eucalyptus-gl-1.6.2-1.x86_32.rpm eucalyptus-nc-1.6.2-1.x86_32.rpm
7.2.配置BRIDGE
修改/etc/sysconfig/network-scripts/ifcfg-eth0文件,内容参考如下:
- DEVICE=xenbr0
- BOOTPROTO=static
- BROADCAST=192.168.34.255
- HWADDR=00:1A:64:E5:86:78
- IPADDR=192.168.34.195
- IPV6INIT=yes
- IPV6_AUTOCONF=yes
- NETMASK=255.255.255.0
- NETWORK=192.168.34.0
- GATEWAY=192.168.34.1
- TYPE=Bridge
- ONBOOT=yes
- DEVICE=eth0
- TYPE=Ethernet
- BRIDGE=xenbr0
DEVICE=xenbr0 BOOTPROTO=static BROADCAST=192.168.34.255 HWADDR=00:1A:64:E5:86:78 IPADDR=192.168.34.195 IPV6INIT=yes IPV6_AUTOCONF=yes NETMASK=255.255.255.0 NETWORK=192.168.34.0 GATEWAY=192.168.34.1 TYPE=Bridge ONBOOT=yes DEVICE=eth0 TYPE=Ethernet BRIDGE=xenbr0
7.3.启动eucalyptus
- /etc/init.d/eucalyptus-cloud start
- /etc/init.d/eucalytpsu-cc start
- /etc/rc.d/init.d/eucalyptus-nc start
- You should have at least 32 loop devices
- Starting Eucalyptus services:
- Enabling bridge netfiltering for eucalyptus.
- done.
- //出现done说明安装完成。
/etc/init.d/eucalyptus-cloud start /etc/init.d/eucalytpsu-cc start /etc/rc.d/init.d/eucalyptus-nc start You should have at least 32 loop devices Starting Eucalyptus services: Enabling bridge netfiltering for eucalyptus. done. //出现done说明安装完成。
7.4.查看Xen虚拟机连接
- su eucalyptus -c "virsh list"
- Id Name State
- ----------------------------------
- 0 Domain-0 running
su eucalyptus -c "virsh list" Id Name State ---------------------------------- 0 Domain-0 running
说明连接成功
7.5.修改网络配置
vim /etc/eucalyptus/eucalyptus.conf
模式VNET_MODE改为SYSTEM //默认应该是这个,不需要更改,如果不是,请修改,关于其他模式这里不做叙述
7.6.注册控制器和节点
- euca_conf --register-walrus 192.168.34.195
- euca_conf --register-cluster CloudTest 192.168.34.195 //IP地址前的是CLC名,自己取1个
- euca_conf --register-sc CloudTest 192.168.34.195
- Trying rsync to sync keys with "192.168.34.195"...The authenticity of host '192.168.34.195 (192.168.34.195)' can't be established.
- RSA key fingerprint is ed:a3:21:20:4c:c4.
- Are you sure you want to continue connecting (yes/no)? yes
- Warning: Permanently added '192.168.34.195' (RSA) to the list of known hosts.
- reverse mapping checking getaddrinfo for example.com failed - POSSIBLE BREAK-IN ATTEMPT!
- root@192.168.34.195's password:
- done.
- SUCCESS: new cluster 'CloudTest' on host '192.168.34.195' successfully registered.
euca_conf --register-walrus 192.168.34.195 euca_conf --register-cluster CloudTest 192.168.34.195 //IP地址前的是CLC名,自己取1个 euca_conf --register-sc CloudTest 192.168.34.195 Trying rsync to sync keys with "192.168.34.195"...The authenticity of host '192.168.34.195 (192.168.34.195)' can't be established. RSA key fingerprint is ed:a3:21:20:4c:c4. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.34.195' (RSA) to the list of known hosts. reverse mapping checking getaddrinfo for example.com failed - POSSIBLE BREAK-IN ATTEMPT! root@192.168.34.195's password: done. SUCCESS: new cluster 'CloudTest' on host '192.168.34.195' successfully registered.
前端控制器注册完成
7.7.注册验证
- /usr/sbin/euca_conf \--list-walruses
- registered walruses:
- walrus 192.168.34.195 //返回的IP地址是否为你注册的IP
- /usr/sbin/euca_conf \--list-clusters
- registered clusters:
- CloudServer 192.168.34.195
- /usr/sbin/euca_conf \--list-scs
- registered storage controllers:
/usr/sbin/euca_conf \--list-walruses registered walruses: walrus 192.168.34.195 //返回的IP地址是否为你注册的IP /usr/sbin/euca_conf \--list-clusters registered clusters: CloudServer 192.168.34.195 /usr/sbin/euca_conf \--list-scs registered storage controllers:
7.8.添加计算节点
- euca_conf -addnode 192.168.34.195
- Trying rsync to sync keys with "192.168.34.195"...reverse mapping checking getaddrinfo for example.com failed - POSSIBLE BREAK-IN ATTEMPT!
- root@192.168.34.195's password:
- done.
euca_conf -addnode 192.168.34.195 Trying rsync to sync keys with "192.168.34.195"...reverse mapping checking getaddrinfo for example.com failed - POSSIBLE BREAK-IN ATTEMPT! root@192.168.34.195's password: done.
7.9.验证节点
- euca_conf --list-nodes
- registered nodes:
- 192.168.34.195 CloudTest
euca_conf --list-nodes registered nodes: 192.168.34.195 CloudTest
7.10.登入web管理界面:
至此,Eucalyptus安装配置完毕虚拟开启云端之旅.登陆Eucalyptus控制台
https://192.168.34.195:8443
默认管理帐号admin,密码admin,第一次登陆需要强制修改
一定记得要先关闭了centOS的防火墙才可正常访问到Eucalyptus的web控制台 |