首页 > 代码库 > 源码编译安装CloudStack 4.2

源码编译安装CloudStack 4.2

基于CentOS 6.4安装CloudStack

环境配置

# yum -y update
# yum -y upgrade

安装NTP,jdk 1.7, tomcat 6, mysql,git等服务

# yum -y install ntp
# yum -y install java-1.7.0-openjdk-devel
# wget https://archive.apache.org/dist/tomcat/tomcat-6/v6.0.35/bin/apache-tomcat-6.0.35.tar.gz
# tar xzvf apache-tomcat-6.0.35.tar.gz -C /usr/local
# yum -y install mysql mysql-server
# yum -y install git

编辑/etc/profile.d/tomcat.sh,写入以下内容

export CATALINA_BASE=/usr/local/apache-tomcat-6.0.35
export CATALINA_HOME=/usr/local/apache-tomcat-6.0.35

安装maven 3.0.5

# wget http://mirror.cc.columbia.edu/pub/software/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
# tar xzf apache-maven-3.0.5-bin.tar.gz -C /usr/local
# cd /usr/local
# ln -s apache-maven-3.0.5 maven

配置maven服务,编辑/etc/profile.d/maven.sh 文件,写入以下内容

export M2_HOME=/usr/local/maven
export PATH=${M2_HOME}/bin:${PATH}

登出,再重新登入,查看maven版本

# mvn --version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 21:51:28+0800)
Maven home: /usr/local/maven
Java version: 1.7.0_71, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.71.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-358.el6.x86_64", arch: "amd64", family: "unix"

安装python管理工具

# yum -y install python-setuptools

安装epel 源

# cd /tmp
# wget http://mirror-fpt-telecom.fpt.net/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

更新源并安装python-pip

# yum update
# yum -y install python-pip

安装mkisofs

# yum -y install genisoimage

源码安装

git获取4.2源码

# git clone https://git-wip-us.apache.org/repos/asf/cloudstack.git
# git checkout 4.2

编译安装CloudStack

# mvn -Pdeveloper,systemvm clean install

提示:如果想要跳过单元测试,使用-DskipTests 而不要使用-Dmaven.test.skip=true,后者会中断编译。

设置utils/conf/db.properties,如果不需要修改DB配置,则默认即可

初始化DB并运行CloudStack

# mvn -P developer -pl developer -Ddeploydb
# mvn -pl :cloud-client-ui jetty:run

成功启动,可以在http://localhost:8080/client/中查看UI

如果启用了防火墙,则需要在防火墙上开启以下端口: 8080, 8250, 9090

 

 

源码编译安装CloudStack 4.2