zhouandtao 发表于 2015-10-13 13:30:05

cloudstack安装和管理

GEIcloudstack
一.背景说明
  GEI 私有云环境采用apache开源项目cloudstack4.0.1在centos6.3上进行搭建 和使用。现有三台戴尔机器作为云环境的服务器,三台机器的登陆用户名和密码均为root/geikrp .
  IP为192.168.7.33的机器作为cloudstack的管理服务器,IP地址为192.168.7.31和192.168.7.32作为计算资源结点,Hypervisor选择为KVM。
  
二.Installation
   (一)管理服务器上的安装步骤
  1.hostname –fqdn hostname --fqdn 确定检查主机名是否符合格式要求
  eg:managament1.lab.example.org 否则就操作如下
  设置方法:vi /etc/hosts最面一行添加 IP hostname 即可保存退出
  
  2. 设置SElinux
  查看selinux的值 cat /etc/selinux/enforce会显示1
  Setenforce0 (系统重启之后该设置无效)
  通过vi /etc/selinux/config--à 设置SELINUX=permissive
  3.安装机器同步时钟ntp服务
  yum install ntp
  vi /etc/ntp.conf--à 更改Server 127.0.0.1 # local clock去掉#
  service ntpd restart
  4.配置防火墙(暂且讨论禁用还是开放为好)
           service iptables stop
           chkconfig iptables off(永久关闭防火墙)
  5.安装NFS server
yum install ntf-utils
mkdir -p /export/secondary
vi /etc/exports
添加下面的下面的一行
/export*(rw,async,no_root_squash)
exportfs -a
更改nfs的文件配置
vi /etc/sysconfig/nfs
Un-comment thefollowing lines :
MOUNTD_NFS_V3=”yes”
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020

然后设置为开机启动这些服务
chkconfig rpcbind on
chkconfig nfs on
service rpcbind start
service nfs start
  
7 将你下载好的cloudstack4.0.1(下载地址 http://jenkins.cloudstack.org/view/4.0.1/)文件为CloudStack-non-OSS-140.tar.bz2上传到管理服务器主机上,然后解压执行安装
在目录下执行 ./install.sh
选择 cloudmanagementserver和database server
首先选择M之后,进行按章cloudstack
需要设置开机启动一些其他服务
chkconfigrpcbind on
chkconfignfs on
service rpcbind start
service nfs start

接下来继续执行./install.sh安装mysql 选择D
安装完成之后,需要修改my.cnf文件
vi/etc/my.cnf
add onthe first line of the file

innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = ‘ROW’

service mysqld restart

8.初始化数据库
cloud-setup-databasescloud:<dbpassword>@localhost –deploy-as=root:<password> (example:cloud-setup-databases cloud:cloud@localhost –deploy-as=root:Password1)



9.启动cloud-management服务
cloud-setup-management
10.准备系统VM模版
先下载好,然后再本地上传较好下载地址http://download.cloud.com/templates/acton/acton-systemvm-02062012.qcow2.bz2
下载到文件acton-systemvm-02062012.qcow2.bz2
mkdircloudstackinpkg
copy {acton-systemvm-02062012.qcow2.bz2} 到cloudstackinpkg中
上传该模版到二级存储
先作为一个mount挂载点
mkdir/secondarymount
mount -t nfs 192.168.7.33:/export/secondary/secondarymount
/usr/lib64/cloud/common/scripts/storage/secondary/cloud-install-sys-tmplt-m /secondarymount -f /cloudstackinpkg/acton-systemvm-02062012.qcow2.bz2 -h kvm–F
上传成功之后记得umount /secondarymount

11. 重启动服务cloudstack management
    service cloud-management restart
12启动成功之后我们就可以同浏览器去使用cloudstack了。


(二)计算资源结点上的安装步骤
  
  1---4步骤跟上面的管理服务器一样。
  5.安装NFS之后,只需要创建一个主存储的共享目录即可
  例如:mkdir –p /export/primary
   vi /etc/exports
添加下面的下面的一行
/export *(rw,async,no_root_squash)
exportfs -a
      6.安装kvm
             rpm –qa | grep kvm没有显示信息就需要安装kvm
             yum install kvm
      7.安装libvirt
             rpm –qa | grep libvirt没有显示信息就需要安装libvirt
             yum install libvirt
             配置libvirtvi /etc/libvirt/qemu.conf确保vnc_listen=0.0.0.0没有被注释掉
             vi/etc/libvirt/libvirtd.conf设置如下信息
             listen_tls=0
             listen_tcp=1
             auth_tcp=16059
             mdns_adv=0
            
            service libvirtrestart
      8 安装cloudstack agent
          从管理服务器上装下载的CloudStack-non-OSS-140.tar.bz2拷贝到机器上,然后执行解压之后,在目录下执行./install.sh
         选择A安装cloud-agent
         启动cloud-agentservice cloud-agent start

   至此所有的安装全部结束。
            
三.admin管理cloudstack
      最后使用firefox浏览器,IE和googlechrome兼容性不是很好。
   在浏览器地址栏输入:http://192.168.7.33:8080/client/进入cloudstack界面(用户名和密码均是admin/admin)
1.    全局设置
Management ----àmanagement.network.cidr 设置为192.168.7.0/24
Site ---àsecstorage.allowed.internal.sites   设置为192.168.7.0/24
需要重启service cloud-management restart
2.    基础架构-àZone-àpods--àhost--à主存储--à二级存储-----Launch Zone
3.    如今已成熟的环境,只需要操作创建vm即可
点击实例-à添加实例--à选择IOS模版-à按照需求选择所需要的IOS模版-à选择一个服务方案,然后启动开始安装系统

Cloudstack的详细说明参见官方文档:http://cloudstack.apache.org/

  

  
         版权声明:本文为博主原创文章,未经博主允许不得转载。
页: [1]
查看完整版本: cloudstack安装和管理