CloudStack Installation - cra16/overcast GitHub Wiki

์ด ๋ฌธ์„œ๋Š” ์˜ค๋ž˜๋œ ๋‚ด์šฉ์„ ๋‹ค๋ฃจ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ตœ์‹  ๋‚ด์šฉ์œผ๋กœ ๊ฐฑ์‹ ํ•  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.

์ด ๋ฌธ์„œ๋Š” 2012๋…„ ๋‹น์‹œ์˜ CloudStack ์„ค์น˜ ๋ฐฉ๋ฒ•์„ ๋‹ค๋ฃจ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์‹ค์Šต์— ํ™œ์šฉํ•˜๊ธฐ์—๋Š” ๋ฌด๋ฆฌ๊ฐ€ ์žˆ์œผ๋‹ˆ ์„ค์น˜ ํ๋ฆ„์„ ๋ฐฐ์šฐ๋Š” ๋‹จ์ˆœ ์ฐธ๊ณ ์šฉ์œผ๋กœ ์‚ฌ์šฉํ•ด์ฃผ์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

CloudStack์€ ์ž˜ ํŒจํ‚ค์ง•๋๊ธฐ ๋•Œ๋ฌธ์—, ๋ฉ”๋‰ด์–ผ๋งŒ ๊ผผ๊ผผํžˆ ์ฝ์–ด๋ณธ๋‹ค๋ฉด ์–ด๋ ต์ง€ ์•Š๊ฒŒ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ๋‹ค.

์„ค์น˜ ํ™˜๊ฒฝ

์„ค์น˜ ํ™˜๊ฒฝ์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

  • ์„ค์น˜ ์šด์˜์ฒด์ œ : CentOS 5.7 x86_64
  • ๋‹ค์šด๋กœ๋“œ : http://cloudstack.apache.org/downloads.html
  • ํŒจํ‚ค์ง€์ด๋ฆ„ : CloudStack-2.2.13-1-rhel5.tar.gz
  • Secondary Storage : NFS
  • Primary Storage : NFS

๋‚ด๋ ค๋ฐ›๊ธฐ

๋‚ด๋ ค๋ฐ›์€ CloudStack ํŒจํ‚ค์ง€ ์••์ถ•์„ ํ‘ผ๋‹ค.

# tar -xvzf CloudStack-2.2.13-1-rhel5.tar.gz

์„ค์น˜ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ด์šฉํ•ด์„œ ๋ฉ”๋‰ด ๋ฐฉ์‹์œผ๋กœ ์‰ฝ๊ฒŒ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ๋‹ค.

# ./install.sh 
Setting up the temporary repository...
Cleaning Yum cache...
Loaded plugins: fastestmirror
0 metadata files removed
Welcome to the Cloud.com CloudStack Installer.  What would you like to do?

    M) Install the Management Server   
    A) Install the Agent
    B) Install BareMetal Agent
    S) Install the Usage Monitor
    D) Install the database server     
    Q) Quit

Management Server ์„ค์น˜

M ์„ ์ž…๋ ฅํ•ด์„œ Tomcat ๊ธฐ๋ฐ˜์˜ management ์„œ๋ฒ„๋ฅผ ์„ค์น˜ํ•œ๋‹ค.

๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์„ค์น˜

D ๋ฅผ ์ž…๋ ฅํ•ด์„œ CloudStack์ด ์‚ฌ์šฉํ•  MySQL ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ์„œ๋ฆฌํ•œ๋‹ค. ์„ค์น˜ ํ›„ ์„ค์ •์„ ์•„๋ž˜์™€ ๊ฐ™์ด ๋ณ€๊ฒฝํ•œ๋‹ค.

# cat /etc/my.cnf
[mysqld]
...
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=70
...

MySQL ์„œ๋ฒ„๋ฅผ ์žฌ์‹œ์ž‘ํ•œ๋‹ค.

# service mysqld restart

์ด์ œ ๊ด€๋ฆฌ๋ฅผ ์œ„ํ•œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์™€ ํ…Œ์ด๋ธ”์„ ๋งŒ๋“ ๋‹ค. ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ด์šฉํ•ด์„œ ๊ฐ„๋‹จํžˆ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค.

cloud-setup-databases cloud:password@localhost --deploy-as=root:rootpassword
  • cloud: ํด๋ผ์šฐ๋“œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์˜ ์ด๋ฆ„
  • dbpassword: ํด๋ผ์šฐ๋“œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ์ ‘๊ทผํ•˜๋Š” ๋น„๋ฐ€๋ฒˆํ˜ธ
  • deploy-as: ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ์„ค์น˜ํ•  ๊ณ„์ •๊ณผ ๋น„๋ฐ€๋ฒˆํ˜ธ ์„ค์น˜ํ•˜๋ฉด 2๊ฐœ์˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๊ฐ€ ๋งŒ๋“ค์–ด ์ง„๋‹ค.
+-------------------+
| Database (cloud%) |
+-------------------+
| cloud             | 
| cloud_usage       | 
+-------------------+

System Template ์„ค์น˜

CloudStack์€ ๋ช‡ ๊ฐœ์˜ system vm์„ ์ด์šฉํ•ด์„œ ํด๋ผ์šฐ๋“œ๋ฅผ ๊ด€๋ฆฌํ•œ๋‹ค.

  1. console proxy vm

๊ด€๋ฆฌ์ž๋Š” ์ฝ˜์†” vm์„ ์ด์šฉํ•ด์„œ, ์›น ์ƒ์—์„œ guest vm์— ์ง์ ‘ ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๋‹ค.

  1. router vm

rvm์ด๋ผ๊ณ  ๋ถ€๋ฅด๊ธฐ๋„ ํ•œ๋‹ค. ํด๋ผ์šฐ๋“œ ๋„คํŠธ์›Œํฌ ์šด์˜์„ ์œ„ํ•˜ vm์œผ๋กœ L2 ์Šค์œ„์น˜, DHCP, load balancer์˜ ์—ญํ• ์„ ํ•œ๋‹ค.

  1. secondary vm

svm์ด๋ผ๊ณ  ๋ถ€๋ฅด๊ธฐ๋„ ํ•œ๋‹ค. svm์€ secondary storage๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” vm์ด๋‹ค. ๋ฐ˜๋“œ์‹œ CNODE์™€ ํ†ต์‹ ํ•  ์ˆ˜ ์žˆ๋Š” ๋„คํŠธ์›Œํฌ๋กœ ๋ฌถ์–ด์•ผ ํ•œ๋‹ค.

System template์€ CloudStack์—์„œ ์ œ๊ณตํ•˜๋Š” ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ด์šฉํ•ด์„œ secondary storage์— ์ง์ ‘ ์„ค์น˜ํ•ด์ค˜์•ผ ํ•œ๋‹ค. secondary storage๋ฅผ ๋งˆ์šดํŠธ ํ•œ๋‹ค์Œ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•˜์ž.

# mount 10.10.11.11:/srv/ss-01 /mnt/ss-0  
# /usr/lib64/cloud/agent/scripts/storage/secondary/cloud-install-sys-tmplt -m /mnt/ss-0 -u http://download.cloud.com/releases/2.2.0/systemvm.vhd.bz2 -h xenserver -F

ํŒŒ์ผ ํฌ๊ธฐ๊ฐ€ 200MB๋ฅผ ๋„˜๊ธฐ ๋•Œ๋ฌธ์— ๋„คํŠธ์›Œํฌ ์ƒํ™ฉ์— ๋”ฐ๋ผ ๊ฝค ๋งŽ์€ ์‹œ๊ฐ„์ด ๊ฑธ๋ฆด ์ˆ˜๋„ ์žˆ๋‹ค.

ํด๋ผ์šฐ๋“œ ์„œ๋ฒ„ ์‹คํ–‰

๋‹ค์Œ ๋ช…๋ น์–ด๋กœ CloudStack์„ ์‹คํ–‰ํ•œ๋‹ค.

# /etc/init.d/cloud-management restart

์ด์ œ 8080 port๋กœ ์ ‘๊ทผํ•˜๋ฉด CloudStack์— ์ ‘์†ํ•  ์ˆ˜ ์žˆ๋‹ค. ๊ธฐ๋ณธ ์‚ฌ์šฉ์ž/๋น„๋ฐ€๋ฒˆํ˜ธ๋Š” admin/password์ด๋‹ค.

์ด๊ฒƒ์œผ๋กœ ํด๋ผ์šฐ๋“œ๋ฅผ ์šด์˜ํ•  ์ค€๋น„๊ฐ€ ๋ชจ๋‘ ๋๋‚ฌ๋‹ค. ์ด์ œ zone, pod, clustor๋ฅผ ๋งŒ๋“ค๊ณ  cnode๋ฅผ ๋“ฑ๋กํ•ด์„œ vm์„ ๋งŒ๋“ค๋ฉด ๋œ๋‹ค.

vm์ด ๋งŒ๋“ค์–ด์ง€๋Š” ๋‚˜๋จธ์ง€ ๊ณผ์ •์„ ๋Œ€๋žต ์ •๋ฆฌํ•ด๋ณด์•˜๋‹ค.

  1. zone, pod, cluster๋ฅผ ๋งŒ๋“ ๋‹ค.
  2. cnode๋ฅผ ๋“ฑ๋กํ•œ๋‹ค.
  3. primary storage๋ฅผ ๋“ฑ๋กํ•œ๋‹ค.
  4. secondary storage๋ฅผ ๋“ฑ๋กํ•œ๋‹ค.
  5. storage์™€ cnode๊ฐ€ ๋“ฑ๋ก๋๋‹ค๋ฉด, cloudstack๋Š” centos default template๋ฅผ ์ž๋™์œผ๋กœ ๋‹ค์šด๋กœ๋“œ ํ•œ๋‹ค. ์ด ํ…œํ”Œ๋ฆฟ์„ ์ด์šฉํ•ด์„œ vm์„ ๋งŒ ๋“ค ์ˆ˜ ์žˆ๋‹ค.
  6. system template๋ฅผ ์ด์šฉํ•ด์„œ consol proxy vm๊ณผ secondary storage vm์„ ์‹คํ–‰ํ•œ๋‹ค. ์„ค์น˜ ์ค‘ ๋„คํŠธ์›Œํฌ ๊ตฌ์„ฑ๊ณผ storage ๊ตฌ์„ฑ์— ๋ฌธ์ œ๊ฐ€ ์žˆ๋‹ค๋ฉด ์ด๋“ค system vm์ด ์ƒ์„ฑ๋˜์ง€ ์•Š์„ ๊ฒƒ์ด๋‹ค.
  7. system vm๊ณผ default template๊ฐ€ ์ƒ์„ฑ๋๋‹ค๋ฉด, ๋น„๋กœ์†Œ vm์„ ์‹คํ–‰ํ•  ์ค€๋น„๊ฐ€ ๋๋‚œ ๊ฒƒ์ด๋‹ค.