close

CloudStack安裝步驟:

(請參考官方安裝說明手冊)

安裝Management Server:

1. 安裝CentOS-6.2 (參考網路資源)

2. 設定網路、檢查網路配置,請參考

鳥哥 《4.2.1 手動設定固定 IP 參數 (適用學術網路、ADSL 固定制) + 五大檢查步驟》

3. 重開機

   # reboot

4. 更新套件

   # yum update

5. 重開機

   # reboot

6. 使用RPM套件安裝Cloudstack

1. 新增cloudstack.repo檔案

   # vi /etc/yum.repos.d/cloudstack.repo

2. 內容填入

[cloudstack]

name=cloudstack

baseurl=http://cloudstack.apt-get.eu/rhel/4.0/

enabled=1

gpgcheck=0

3. 存檔

7. 檢查完整 hostname

   # hostname --fqdn

(如果出現 unknow host 請參考鳥哥 《4.2.1 手動設定固定 IP 參數 (適用學術網路、ADSL 固定制) + 五大檢查步驟》)

8. 安裝 NTP

   # yum install ntp

9. 安裝 wget

   # yum install wget

10.下載 vhd-util

   # wget http://download.cloud.com.s3.amazonaws.com/tools/vhd-util

11.複製 vhd-util 到指定資料夾

   # mkdir -p /usr/lib64/cloud/common/scripts/vm/hypervisor/xenserver

   # cp vhd-util /usr/lib64/cloud/common/scripts/vm/hypervisor/xenserver

12.安裝cloudstack

   # yum install cloud-client

13.安裝MySQL資料庫

   # yum install mysql-server

14.修改 MySQL 設定

1. # vi /etc/my.cnf

2. 加入以下內容於 [mysqld] 後

innodb_rollback_on_timeout=1

innodb_lock_wait_timeout=600

max_connections=350

log-bin=mysql-bin

binlog-format = 'ROW'

3. 儲存

15. 啟動 MySQL

   # service mysqld start

16. MySQL 安全設定

   # mysql_secure_installation

1. 輸入現在root的密碼 (沒有的話就按[Enter]) [Enter]

2. 是否要設定root密碼? Y

   請輸入密碼: ncyu7738

   再次輸入密碼: ncyu7738

3. 移除匿名使用者? Y

4. 禁止root遠端登入? N

5. 刪除預設的test資料庫? Y

5. 重新載入table? Y

17.設定MySQL防火牆

1. 修改防火牆設定

   # vi /etc/sysconfig/iptables

2. 加入以下內容於 :INPUT ACCEPT [0:0]

-A INPUT -p tcp --dport 3306 -j ACCEPT

3. 重新啟動防火牆

   # service iptables restart

 18.設定cloudstack資料庫

1. 修改selinux設定

   # vi /etc/selinux/config

2. SELINUX=enforcing 改成 SELINUX=permissive

3. 儲存

4. 重開機

   # reboot

5. # setenforce Permissive

6. 啟動 MySQL

   # service mysqld start

   # chkconfig mysqld on

7. 設定cloudstack資料庫

# cloud-setup-databases cloud:ncyu7738@localhost --deploy-as=root:ncyu7738

補充 # cloud-setup-databases cloud:<資料庫中cloud 這個使用者的密碼>@localhost --deploy-as=root:<CentOSroot的密碼>

 

8. 啟動cloudstack Management Server

# cloud-setup-management

19.安裝NFSManagement Sever

1. 建立資料夾

   # mkdir -p /export/primary

   # mkdir -p /export/secondary

2.

   # vi /etc/exports

3. 加入以下內容

/export *(rw,async,no_root_squash)

4. 儲存

5. 啟動NFS的共享資料夾

   # exportfs -a

6. 修改 NFS設定

   # vi /etc/sysconfig/nfs

   以下內容去掉註解

LOCKD_TCPPORT=32803

LOCKD_UDPPORT=32769

MOUNTD_PORT=892

RQUOTAD_PORT=875

STATD_PORT=662

STATD_OUTGOING_PORT=2020

7. 儲存

8. 修改防火牆設定

   # vi /etc/sysconfig/iptables

9. 加入以下內容於 :INPUT ACCEPT [0:0] 後

-A INPUT -m state --state NEW -p udp --dport 111 -j ACCEPT

-A INPUT -m state --state NEW -p tcp --dport 111 -j ACCEPT

-A INPUT -m state --state NEW -p tcp --dport 2049 -j ACCEPT

-A INPUT -m state --state NEW -p tcp --dport 32803 -j ACCEPT

-A INPUT -m state --state NEW -p udp --dport 32769 -j ACCEPT

-A INPUT -m state --state NEW -p tcp --dport 892 -j ACCEPT

-A INPUT -m state --state NEW -p udp --dport 892 -j ACCEPT

-A INPUT -m state --state NEW -p tcp --dport 875 -j ACCEPT

-A INPUT -m state --state NEW -p udp --dport 875 -j ACCEPT

-A INPUT -m state --state NEW -p tcp --dport 662 -j ACCEPT

-A INPUT -m state --state NEW -p udp --dport 662 -j ACCEPT

10.儲存

11.重新啟動防火牆

   # service iptables restart

12.儲存防火牆設定

   # service iptables save

20.重新啟動Management Server

# service rpcbind start

# service nfs start

# chkconfig nfs on

# chkconfig rpcbind on

# reboot

21.準備System VM Template (For XenServer)

# /usr/lib64/cloud/common/scripts/storage/secondary/cloud-install-sys-tmplt -m /export/secondary -u http://download.cloud.com/templates/acton/acton-systemvm-02062012.vhd.bz2 -h xenserver -F

arrow
arrow

    GiMi 發表在 痞客邦 留言(3) 人氣()