注册Eucalyputs组件
//front-end
euca_conf --register-walrus <front-end IP address> //如笔者的euca_conf --register-walrus 10.10.x.9
euca_conf --register-cluster <clustername> <front-end IP address> //clustername 为自定义的名字
euca_conf --register-sc <clustername> <front-end IP address>
//在front-end上注册nodes
euca_conf --register-nodes <Node 0 IP address> <Node 1 IP address> ... <Node N IP address>
如笔者:euca_conf --register-nodes 10.10.x.10 10.10.x.11
初始配置
登陆管理主页:8443
默认用户名密码为admin
登陆后修改密码
设置管理员邮箱
确认CC的IP地址
在Credentials主页点击Download Credentials按钮下载
创建目录存储下载的文件并解压
mkdir $HOME/.euca
unzip euca2-admin-x509.zip -d $HOME/.euca
. $HOME/.euca/eucarc //注册eucarc环境
安装Euca2ools
创建/etc/yum.repos.d/euca.repo文件
[euca2ools]
name=Euca2ools
baseurl=http://www.eucalyptussoftware.com/downloads/repo/euca2ools/$VERSION/yum/CentOS/
enabled=1其中$VERSION为版本号,如1.2
yum install euca2ools.$ARCH --nogpgcheck
上传镜像文件
//增加镜像<查看可下载镜像>
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.xmleuca-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.xmleuca-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//关联kernels和ramdisks到instances
euca-bundle-image -i <vm image file> --kernel <eki-XXXXXXXX> --ramdisk <eri-XXXXXXXX>eki-XXXXXXXX eri-XXXXXXXX均为上面步骤产生,请注意记录,也可以通过web管理页面进行查看下面是一个传镜像实例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)
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创建自己的密钥文件euca-add-keypair mykey | tee mykey.privchmod 0600 mykey.priv通过euca-describe-images查看有哪些镜像
运行实例euca-run-instances -k mykey <emi-id> -t <type> -n <number of instances to start>其中mykey和mykey.priv可以命名为自己的文件,emi-id为可查看到的镜像如euca-run-instances -k mykey emi-39E1892可以过euca-describe-instances查看instances运行状态运行状态由pending变为running后即可登录如RESERVATION r-38390699 admin default
INSTANCE i-3BC30777 emi-1C88159B 10.10.103.33 10.10.103.33 running key 0 m1.small 2011-02-18T12:07:14.623Z mycluster eki-8DAF16EB eri-882616CD
RESERVATION r-3C9007FC admin default
INSTANCE i-3BDD0719 emi-1C88159B 10.10.103.32 10.10.103.32 running key 0 m1.small 2011-02-18T08:59:33.67Z mycluster eki-8DAF16EB eri-882616CD//登录
ssh -k mykey root@10.10.103.32
注意这里登录时提示需要输入passphase,这里需要自己修改一下,改变RSA passphase:ssh-keygen -fid_rsa -p
至此我们登上instances开始我们的云端之旅了