5. CloudStack Installation on Ubuntu
一個 management sever (ubuntu-12.04.3 + CloudStack-4.0 )
一個 Hypervisor(XenServer 6.0.2)
4
6. CloudStack Installation on Ubuntu
三、安裝環境
CPU
Intel Core i3 M350 2.27GHz
RAM
4 GB * 2
HD
128 SSD
Network
100M/1000M bps Ethernet
OS
Windows7_64-bit
VM Platform
VMware® Workstation10.0.0 build-1295980
VM Guest OS
ubuntu-12.04.3-desktop-amd64
VMRAM
1.6GB
VM HD
20GB
5
7. CloudStack Installation on Ubuntu
四、CloudStack Installation on Ubuntu 步驟
1. 配置安裝源
(1) 設定安裝源
$ sudo gedit /etc/apt/sources.list
deb http://mirrors.sohu.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
或參考官網安裝 http://cloudstack.apache.org/downloads.html
(2) 配置 CloudStack 官方源
$ sudo vi /etc/apt/sources.list.d/cloudstack.list
加入下面內容
deb http://cloudstack.apt-get.eu/ubuntu precise 4.0
6
8. CloudStack Installation on Ubuntu
(3) 將 public key 加到 trusted keys
$ wget -O - http://cloudstack.apt-get.eu/release.asc|sudo apt-key add -
(4) 更新 local apt cache
$sudo apt-get update
DEB package repository 設定完成
7
13. CloudStack Installation on Ubuntu
修改 MySQL 配置文件參數
$ sudo vi /etc/mysql/my.cnf
在[mysqld]模塊中加入以下參數
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = 'ROW'
重啟 MySQL
$ sudo service mysql restart
12
23. CloudStack Installation on Ubuntu
3. 16509 (libvirt)
4. 5900 - 6100 (VNC consoles)
5. 49152 - 49216 (libvirt live migration)
Ubuntu 預設防火牆為 UFW(Uncomplicated FireWall),執行以下指令來開啟通訊
埠
sudo ufw allow proto tcp from any to any port 22
sudo ufw allow proto tcp from any to any port 80
sudo ufw allow proto tcp from any to any port 1798
sudo ufw allow proto tcp from any to any port 16509
sudo ufw allow proto tcp from any to any port 5900 : 6100
sudo ufw allow proto tcp from any to any port 49152 : 49216
(5) 啟動用戶界面
$ sudo /etc/init.d/tomcat6 stop
$ sudo update-rc.d -f tomcat6 remove
(6) 啟動 cloud-management
$ cd ~
$sudo /etc/init.d/cloud-management restart
通過下面的命令可以看到 8080 為 listen 狀態。
$ netstat -an | grep 8080
22
25. CloudStack Installation on Ubuntu
$ sudo apt-get install openssh-server
安裝完成後,再重新啟動 tomcat
$ sudo /etc/init.d/cloud-management restart
重啟後如果還不能登入,check log 錯誤訊息為
ERROR [cloud.servlet.CloudStartupServlet] (main:null) Exception starting
management server
com.cloud.utils.exception.CloudRuntimeException: Failed to inject generated public key into
systemvm iso sudo: no tty present and no askpass program specifiedSorry, try again.sudo: no
tty present and no askpass program specifiedSorry, try again.sudo: no tty present and no
askpass
program specifiedSorry, try again.sudo: 3 incorrect password attemptsmkdir
…
再執行下面指令
$ cloud-setup-management
應該就可以成功登入了
24