Centos 6.5 安装CloudStack4.3(完善更新)

CentOS 部署CloudStack 4.3 其实在官方文档上有说明(http://www.imycloud.com/CSInstallation/index.html#document-qig),整理了部署方式

 

CloudStack Server 和KVM 主机都设置为静态Ip,这个不再描述

HostName

1、 hostname --fqdn 

  如果显示不正确,修改/etc/hosts文件 (修改主机名为cloudstack.test.cn)

SELinux

1、 setenforce 0

2、修改/etc/selinux/config 文件

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

NTP

1、

yum -y install ntp
2、
# chkconfig ntpd on
# service ntpd start

配置CloudStack 源

1、增加文件/etc/yum.repos.d/cloudstack.repo

[cloudstack]
name=cloudstack
baseurl=http://cloudstack.apt-get.eu/rhel/4.3/
enabled=1
gpgcheck=0

NFS

nfs server 配置,nfs server可以是单独的服务器,也可以是与cs management server 在一起,但是这个时候需要cs management 需要很大的存储,本文使用单独的nfs server

1、

yum install nfs-utils

2、vi /etc/exports

/export/secondary *(rw,async,no_root_squash)
/export/primary *(rw,async,no_root_squash)
3、
# mkdir /export/primary
# mkdir /export/secondary

4、CentOS 6.x releases use NFSv4 by default. NFSv4 requires that domain setting matches on all clients. In our case, thedomain is cloud.priv, so ensure that the domain setting in /etc/idmapd.conf is uncommented and set as follows:Domain = cloud.priv

5、vi /etc/sysconfig/nfs

LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020
6、关闭防火墙

 service iptables stop

7、

# service rpcbind start
# service nfs start
# chkconfig rpcbind on
# chkconfig nfs on

 

为了验证nfs server 部署成功,可以在hypersior host 进行测试,测试方法:

  1. Log in to the hypervisor host.
  2. Be sure NFS and rpcbind are running. The commands might be different depending on your OS. For example:
    # service rpcbind start
    # service nfs start
    # chkconfig nfs on
    # chkconfig rpcbind on
    # reboot                        
    
  3. Log back in to the hypervisor host and try to mount the /export directories. For example (substitute your own management server name):
    # mkdir /primarymount
    # mount -t nfs <management-server-name>:/export/primary /primarymount
    # umount /primarymount
    # mkdir /secondarymount
    # mount -t nfs <management-server-name>:/export/secondary /secondarymount
    # umount /secondarymount     

8、在CS management server上 创建二级存储挂载点: (如果使用cs management server,不需要进行下面的操作

                

      mkdir -p /mnt/secondary

      将nfs server 的二级存储目录挂载到这个目录

      mount -t nfs nfsservername:/export/secondary /mnt/secondary

安装配置CloudStack ManageMent

1、

yum -y install mysql-server

2、vi /etc/my.cnf  在mysqld部分添加

innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = 'ROW'
3、
# service mysqld start
# chkconfig mysqld on
4、yum install cloudstack-management

5、初始化数据库

cloudstack-setup-databases cloud:password@localhost --deploy-as=root:password
6、cloudstack-setup-management
7、准备系统模板

官方的方式:

/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m \
/mnt/secondary -u http://jenkins.buildacloud.org/view/4.3/job/cloudstack-4.3-systemvm/lastSuccessfulBuild/artifact/tools/appliance/dist/systemvmtemplate-2014-04-14-master-kvm.qcow2.bz2 \
-h kvm -F

也可以使用下载工具将 系统模板下载,再执行

/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /mnt/secondary/ -f /var/acton-systemvm-02062012.qcow2.bz2 -h kvm -F

红色字体部分为cs management server 中创建的目录,将下载的SSVM 模板放到该目录

本文使用的是单的nfs server ,需要执行下面的命令:(如果使用cs management server 作为nfs server,禁止执行这个命令

    umount /mnt/secondary

    rmdir /mnt/secondary

KVM 主机配置

 同样需要配置cloudstack 源,ntp,hostname,selinux

1、主机安装KVM

yum install -y kvm kmod-kvm kvm-qemu-img libvirt python-virtinst virt-manager virt-viewer bridge-utils

2、配置KVM 主机网桥,增加一个网桥

vi /etc/sysconfig/network-scripts/ifcfg-cloudbr0

DEVICE="cloudbr0"
TYPE="Bridge"
ONBOOT="yes"
BOOTPROTO=static
IPADDR=192.168.26.134
PREFIX=24
GATEWAY=192.168.26.2
DNS1=8.8.4.4
DNS2=8.8.8.8

vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
BOOTPROTO="static"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
BOOTPROTO=none
BRIDGE="cloudbr0"

4、QEMU 配置   vi /etc/libvirt/qemu.conf

vnc_listen=0.0.0.0

5、Libwirt配置

  5.1 /etc/libvirt/libvirtd.conf

listen_tls = 0
listen_tcp = 1
tcp_port = "16059"
auth_tcp = "none"
mdns_adv = 0
5.2 /etc/sysconfig/libvirtd

LIBVIRTD_ARGS="--listen"

5.3

service libvirtd restart

        配置完成

 启动agent : service cloudstack-agent restart

启动cloudstack management :

/etc/init.d/tomcat6 stop
 /etc/init.d/cloudstack-management restart


附录:

 1、上传iso 一直失败?

  需要修改配置

secstorage.allowed.internal.sites
 设置网段为 管理网段,包含 存放iso的地址IP



 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值