当前位置:文档之家› 简易搭建一个私有云平台

简易搭建一个私有云平台

简易搭建一个私有云平台众说周知Amazon E2是一个公共云的计算平台,属于IaaS(基础设施即服务)这类.现在有一款开源的项目Eucalyptus(Elastic Utility Computing Architecture for Linking Your Programs To Useful Systems),同样实现了Amazon EC2的功能,由于其开源性,注定了搭建一个私有的云计算平台成为可能. 更方便的是Ubuntu9.10服务器版已经集成了Eucalyptus这个开源软件,使的搭建企业私有的云计算平台变得方便而简单.下面我们将一步步来搭建这个私有的云计算平台.一准备工作1) 至少准备两台机器, 当然我这里是用虚拟机软件(Sun VirtualBox)来虚拟出两台实际的机器(如果你也采用Sun VirtualBox,有些注意事项,可以参见后面的附录一)2) 底层操作系统: Ubuntu9.10 服务器版(/cloud)3) 云服务环境: Eucalyptus , ( Ubuntu9.10 服务器版内置) /4) Eucalyptus 命令行客户端5) Eucalyptus客户端: Elastic Fox ,这是一个firefox插件: /connect/entry.jspa?externalID=609--------------------------------------------------------------------------二云计算服务的搭建(使用Ubuntu自带的向导,十分简单的哦)1) 一台机器, 作为Cluster(Front End) , 命名为: ubuntu-cluster , 它包含了如下部分1.Cloud Controller (clc)2.Cluster Controller (cc)3.Walrus (the S3-like storage service)4.Storage Controller (sc)5.2) 至少一台机器作为Node, 命名为: ubuntu-node1,它包含了如下部分Node Controller (nc)3) 在作为Cluster的机器上(Front end),安装基本系统: Ubuntu9.10 服务器版1.安装引导时,要选择"Install Ubuntu Enterprise Cloud"2. 安装过程中,如果提示"Cluster" 还是"Node",一定要选择Cluster3.安装过程中,提示"Configure postfix" 时选择internet Site4. 安装过程中,提示"Name your cluster" 时,请取一个合适的名字,比如我取之为: cluster15. 安装过程中,提示"a list of available IP addresses on your network", 一定要选择一个可用的公共IP段. 例如:e.g. 192.168.1.200-192.168.1.2494) 在作为Node的机器上,也安装基本系统: Ubuntu9.10 服务器版Node安装很简单,但一定要保证此时的cluster正在运行,并且Node要和安装cluster 的机器联网,否则后面Node在cluster上不能注册成功1.安装引导时,要选择"Install Ubuntu Enterprise Cloud"2. 安装过程中,如果提示"Cluster" 还是"Node",一定要选择Node, (如果Cluster正在运行,这一步可能不会出现,自动会选择Node3.安装完一个节点后,,后续的节点可以采用克隆方法,参见后面的附录二如果使用UEC/PackageInstall安装,则需要执行下列操作。

(不过我们一般使用的不是Package安装,而是CD安装,所以下面的a到e通常可以直接略过。

)a. a. Public SSH keys have been exchanged properlyb.The services are configured properlyc.The services are publishing their existenced.The appropriate uec-component-listener is runninge.Verify Registration.a. Exchange Public SSH KeysThe Cloud Controller's eucalyptus user needs to have SSH access to the Walrus Controller, Cluster Controller, and Storage Controller as the eucalyptus user. Install the Cloud Controller's eucalyptus user's public ssh key by:∙On the target controller, temporarily set a password for the eucalyptus user:sudo passwd eucalyptus∙Then, on the Cloud Controller:sudo -u eucalyptus ssh-copy-id -i ~eucalyptus/.ssh/id_rsa.pub eucalyptus@<IP_OF_NODE>∙You can now remove the password of the eucalyptus account on the target controller, if you wish:∙sudo passwd -d eucalyptusb. Configure the ServicesOn the Cloud Controller:∙For the Cluster Controller Registration:o Define the shell variable CC_NAME in /etc/eucalyptus/eucalyptus-cc.confo Define the shell variable CC_IP_ADDR in /etc/eucalyptus/eucalyptus-ipaddr.conf, as a space separated list of one or more IP addresses.∙For the Walrus Controller Registration:o Define the shell variable WALRUS_IP_ADDR in /etc/eucalyptus/eucalyptus-ipaddr.conf, as a single IP address.On the Cluster Controller:∙For Storage Controller Registration:o Define the cluster name in the shell variable CC_NAME in /etc/eucalyptus/eucalyptus-cc.confo Define the shell variable SC_IP_ADDR in /etc/eucalyptus/eucalyptus-ipaddr.conf, as a space separated list of one or more IP addresses.c. PublishNow start the publication services.∙Walrus Controller:sudo start eucalyptus-walrus-publication∙Cluster Controller:sudo start eucalyptus-cc-publication∙Storage Controller:sudo start eucalyptus-sc-publication∙Node Controllersudo start eucalyptus-nc-publicationd. Start the ListenerOn the Cloud Controller and the Cluster Controller(s), run:sudo start uec-component-listenere. Verify Registrationcat /var/log/eucalyptus/registration.log2010-04-08 15:46:36-05:00 | 24243 -> Calling node cluster1 node 10.1.1.752010-04-08 15:46:36-05:00 | 24243 -> euca_conf --register-nodes returned 02010-04-08 15:48:47-05:00 | 25858 -> Calling walrus Walrus 10.1.1.712010-04-08 15:48:51-05:00 | 25858 -> euca_conf --register-walrus returned 02010-04-08 15:49:04-05:00 | 26237 -> Calling cluster cluster1 10.1.1.712010-04-08 15:49:08-05:00 | 26237 -> euca_conf --register-cluster returned 02010-04-08 15:49:17-05:00 | 26644 -> Calling storage cluster1 storage 10.1.1.712010-04-08 15:49:18-05:00 | 26644 -> euca_conf --register-sc returned 0sudo euca_conf --no-rsync --discover-nodes至此,一个私有的云计算平台已经搭建好了,下面就开始说,如何使用了.三云计算平台管理之命令行工具(Euca2ools)1)在https://YourIP:8443 中注册个人信息然后登录下载证书euca2-yourname-x509 .zip获得证书可以用两种方式,浏览器方式和命令行方式:浏览器方式:1.在浏览器窗口输入:https://<cloud-controller-ip-address>:8443/2.第一次登录的时候,用户名和密码是“admin”,“admin”。

相关主题