|
| 1 | +This document describes how to set up and configure a single server CloudStack |
| 2 | +development environment. If you aren't looking for a development environment, |
| 3 | +the easiest way to deploy CloudStack is by using RPM or DEB packages from: |
| 4 | + |
| 5 | + - http://cloudstack.org/download.html |
| 6 | + - http://jenkins.cloudstack.org (CI/Build server) |
| 7 | + - http://cloudstack.apt-get.eu (Debian repository) |
| 8 | + |
| 9 | +CloudStack developers use various platforms for development, this guide will |
| 10 | +focus on CentOS and was tested against a CentOS 6.2 x86_64 setup. |
| 11 | + |
| 12 | +Refer to the [wiki](http://cwiki.apache.org/confluence/display/CLOUDSTACK/Index) |
| 13 | +for the latest information, especially: |
| 14 | + |
| 15 | + - [Setting up development environment](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Setting+up+CloudStack+Development+Environment) for CloudStack. |
| 16 | + - [Building](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Building+with+Maven) CloudStack. |
| 17 | + |
| 18 | +## Setting up Development Environment |
| 19 | + |
| 20 | +### Installing Tools and Dependencies |
| 21 | + |
| 22 | +Install tools and dependencies used for development: |
| 23 | + |
| 24 | + $ yum install git ant ant-devel java-1.6.0-openjdk java-1.6.0-openjdk-devel |
| 25 | + mysql mysql-server tomcat6 mkisofs gcc python MySQL-python openssh-clients wget |
| 26 | + |
| 27 | +Set up Maven (3.0.4): |
| 28 | + |
| 29 | + $ wget http://www.us.apache.org/dist/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz |
| 30 | + $ cd /usr/local/ # or any path |
| 31 | + $ tar -zxvf apache-maven-3.0.4-bin.tar.gz |
| 32 | + $ echo export M2_HOME=/usr/local/apache-maven-3.0.4 >> ~/.bashrc # or .zshrc or .profile |
| 33 | + $ echo export PATH=${M2_HOME}/bin:${PATH} >> ~/.bashrc # or .zshrc or .profile |
| 34 | + |
| 35 | +Note: Tomcat 6.0.35 has some known issue with CloudStack, please use Tomcat |
| 36 | +6.0.33 from http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.33/bin |
| 37 | + |
| 38 | +### Configure Environment |
| 39 | + |
| 40 | +Set CATALINA_HOME to path where you extract/install tomcat, put them in your |
| 41 | +.bashrc or .zshrc or .profile: |
| 42 | + |
| 43 | + $ echo export CATALINA_HOME=/usr/share/tomcat6/ >> ~/.bashrc |
| 44 | + |
| 45 | +Fix permissions on CATALINA_HOME: |
| 46 | + |
| 47 | + $ chown -R <you>:<your-group> $CATALINA_HOME |
| 48 | + |
| 49 | +Generate you ssh keys, useful for ssh-ing to your hosts and vm etc.: |
| 50 | + |
| 51 | + $ ssh-keygen -t rsa -q |
| 52 | + |
| 53 | +CloudStack uses some ports, make sure at least those used by the management |
| 54 | +server are available and not blocked by any local firewall. Following ports are |
| 55 | +used by CloudStack and its entities: |
| 56 | + |
| 57 | +8787: CloudStack (Tomcat) debug socket |
| 58 | +9090, 8250: CloudStack Management Server, User/Client API |
| 59 | +8096: User/Client to CloudStack Management Server (unauthenticated) |
| 60 | +3306: MySQL Server |
| 61 | +3922, 8250, 80/443, 111/2049, 53: Secondary Storage VM |
| 62 | +3922, 8250, 53: Console Proxy VM |
| 63 | +3922, 8250, 53: Virtual Router |
| 64 | +22, 80, 443: XenServer, XAPI |
| 65 | +22: KVM |
| 66 | +443: vCenter |
| 67 | +DNS: 53 |
| 68 | +NFS: 111/2049 |
| 69 | + |
| 70 | +### Configuring MySQL Server |
| 71 | + |
| 72 | +Start the MySQL service: |
| 73 | + |
| 74 | + $ service mysqld start |
| 75 | + |
| 76 | +### Getting the Source Code |
| 77 | + |
| 78 | +You may get the source code from the repository hosted on Apache: |
| 79 | + |
| 80 | + $ git clone https://git-wip-us.apache.org/repos/asf/incubator-cloudstack.git |
| 81 | + |
| 82 | +Or, you may fork a repository from the official Apache CloudStack mirror by |
| 83 | +Apache on [Github](https://github.com/apache/incubator-cloudstack) |
| 84 | + |
| 85 | +To keep yourself updated on a branch, do: |
| 86 | + |
| 87 | + $ git pull <origin> <branch> |
| 88 | + |
| 89 | +For example, for master: |
| 90 | + |
| 91 | + $ git pull origin master |
| 92 | + |
| 93 | +## Building |
| 94 | + |
| 95 | +Populate the dependencies using Maven: |
| 96 | + |
| 97 | + $ mvn -P deps |
| 98 | + |
| 99 | +Clean previous build, if needed: |
| 100 | + |
| 101 | + $ mvn clean |
| 102 | + $ ant clean-all |
| 103 | + $ ant clean-tomcat |
| 104 | + |
| 105 | +Build all sub-modules: |
| 106 | + |
| 107 | + $ ant build-all |
| 108 | + |
| 109 | +Deploy the built project on tomcat: |
| 110 | + |
| 111 | + $ ant deploy-server |
| 112 | + |
| 113 | +Clear old database (if any) and deploy the database schema: |
| 114 | + |
| 115 | + $ ant deploydb |
| 116 | + |
| 117 | +Start the management server in debug mode: |
| 118 | + |
| 119 | + $ ant debug |
| 120 | + |
| 121 | +If this works, you've successfully setup a single server CloudStack installation. |
| 122 | + |
| 123 | +Open the following URL on your browser to access the Management Server UI: |
| 124 | + |
| 125 | + http://localhost:8080/client/ |
| 126 | + |
| 127 | +Or, |
| 128 | + |
| 129 | + http://management-server-ip-address:8080/client |
| 130 | + |
| 131 | +The default credentials are; user: admin, password: password and the domain |
| 132 | +field should be left blank which is defaulted to the ROOT domain. |
| 133 | + |
| 134 | +## Packaging |
| 135 | + |
| 136 | +To create rpms: |
| 137 | + |
| 138 | + $ mvn -P deps && ./waf rpm |
| 139 | + |
| 140 | +To create debs: |
| 141 | + |
| 142 | + $ mvn -P deps && dpkg-buildpackage |
| 143 | + |
0 commit comments