[[CloudStack/概要]]

* CloudStack の構成 [#v3299ae7]
CloudStack はManagement Server とComputing Node の2種類から構成されます.~
そのため,Management Server となるノードとComputing Node となるノードでインストールするパッケージが異なります.~
以下では,それぞれのパッケージのインストール方法を説明します.~
なお,ここではUbuntu Server 10.04 を用いてインストール作業を進めるとします.~

** Management Server [#w10a7098]
Management Serverは,システム内のリソース管理を行います.
Management Serverが管理するリソースは,クラスタ環境内のComputing Node上で動作する仮想マシンとストレージ,仮想マシンに割り当てるIPアドレスなどがあります.

** Computing Node [#bd461005]
Computing Nodeは,仮想マシンを実行するノードになります.
Computing Nodeは,ZoneとPodsと呼ばれるグループに分けられます,
最初の初期化作業時に1Zone,1Podをそれぞれ設定する必要があります.


* Management Server の設定 [#y2e1b345]
Management Serverの設定方法を解説します.

** iptablesの設定 [#i2b0ea6c]
iptablesの設定を行います.
 $ sudo ufw allow 80
 $ sudo ufw allow 8080
 $ sudo ufw allow 8096
 $ sudo ufw allow 8250

** MySQLサーバのインストール & 設定 [#bc21b970]
$ sudo aptitude install mysql-server
 $ sudo aptitude install mysql-server

** リポジトリの追加 [#l573e420]
CloudStack は専用のリポジトリを追加し,インストールします.~
まず,CloudStack のリポジトリを追加します.~
エディタで/etc/apt/sources.listを開きます.~
 $sudo vi /etc/apt/sources.list
 $ sudo vi /etc/apt/sources.list
以下の行を追加します.
 deb http://download.cloud.com/apt/ubuntu/stable/oss ./
追加後,リポジトリの更新を行います.
 $ sudo aptitude update

** cloud-client のインストール & 設定 [#q36af46c]
Management Server へインストールするパッケージはcloud-client という名前で先ほど追加したリポジトリで提供されています.~
正しくリポジトリが追加されていれば,apt コマンドでインストールできます.
 $ sudo aptitude install cloud-client

cloud-clientをインストールした後,tomcatの停止を行います.
 $ sudo service tomcat6 stop
 $ sudo chkconfig tomcat6 off

** データベースの設定 [#l484be91]
 $ sudo cloud-setup-databases cloud:<dbpassword> kvm --deploy-as=root <rootpassword>
 $ sudo cloud-setup-databases cloud:<dbpassword> kvm --deploy-as=root:<rootpassword>
-- この際,ホストネームが正しく設定されていないと動作しません.~

** sudoersに追加 [#b39a18b8]
CloudStackはユーザー cloud で動作します.~
その際に,mountなどのコマンドを使用するため,sudoをパスワードなしで実行出来るようにsudoersに記述します.
 $ sudo visudo
以下の行を追加
 cloud ALL=(ALL) NOPASSWD: /bin/mount,/bin/umount,/bin/chmod

** nfs-clientのインストール [#nd1d623b]

 $ sudo apt-get install nfs-client

** management-serverの起動 [#q867d818]
Management Serverを起動します.
 $ sudo service cloud-management start
** management-serverの設定 [#q867d818]
Management Serverを設定します.
cloud-setup-management コマンドを使用すると,iptableと/etc/sudoersの設定が変更されます.
その後,自動的にManagement Serverのプロセスが起動します.
 $ sudo cloud-setup-management

** manegement-serverへアクセス [#u86dda9f]
Management Serverが起動すると,ブラウザでアクセスすることができます.
ブラウザでhttp://<management-server-ip-address>:8080/clientにアクセスするとログイン画面が表示されます.~
デフォルトユーザはadmin~
デフォルトパスワードはpassword~
となっています.

#ref(login-display.png)

* Computing Node の設定 [#ydafe057]
Management Server と同様に専用のリポジトリを追加して、パッケージをインストールします.~

** リポジトリの追加 [#ec56a0e6]
まず,CloudStack のリポジトリを追加します.~
エディタで/etc/apt/sources.listを開きます.~
 $sudo vi /etc/apt/sources.list
 $ sudo vi /etc/apt/sources.list
以下の行を追加します.
 deb http://download.cloud.com/apt/ubuntu/stable/oss ./
追加後,リポジトリの更新を行います.
 $ sudo aptitude update

** cloud-agent のインストール & 設定 [#ceddcb67]
Computing Node へインストールするパッケージはcloud-agent という名前で先ほど追加したリポジトリで提供されています.~
正しくリポジトリが追加されていれば,apt コマンドでインストールできます.
 $ sudo aptitude install cloud-agent
インストールが終了したら,cloud-agent の設定を行います.~
cloud-agent の設定はcloud-setup-agent コマンドで行います.~
 $ sudo cloud-setup-agent
cloud-setup-agent コマンドでは対話式による設定を行います.
 $ sudo cloud-setup-agent
 
 Welcome to the Cloud Agent setup
 
 example.jp
 The hostname of this machine is properly set up
 Checking for KVM
 KVM is properly set up
 Network configuration appears to be already correctly setup
 We are going to restart the network now, to make the network changes take effect.  Hit ENTER when you are ready.
 // Enterを押してください.
 Stopping NetworkManager
 network-manager: unrecognized service
 
 Starting networking
 networking stop/waiting
 
 Verifying that the bridge is up
 cloud-br0 Link encap:Ethernet  HWaddr 6c:f0:49:7e:42:09  
           inet addr:192.50.109.181  Bcast:192.50.109.191  Mask:255.255.255.192
           inet6 addr: fe80::6ef0:49ff:fe7e:4209/64 Scope:Link
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:9366996 errors:0 dropped:0 overruns:0 frame:0
           TX packets:1065901 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:0 
           RX bytes:997654646 (997.6 MB)  TX bytes:261803819 (261.8 MB)
 
 
 Networking restart done
 Control groups configuration appears to be already correctly setup
 Control rules configuration appears to be already correctly setup
 libvirt configuration appears to be already correctly setup
 qemu configuration appears to be already correctly setup
 qemu security configuration appears to be already correctly setup
 We are going to restart the virtualization services now, to make the configuration changes take effect.  Hit ENTER when you are ready.
 // Enterを押してください.
 
 Stopping libvirt
 libvirt-bin stop/waiting
 
 Stopping control rules
 Stopping CGroup Rules Engine Daemon...
 * 
 
 Stopping control groups
 
 Stopping cgconfig service:  * 
 
 Starting control groups
 Starting cgconfig service:  * 
 
 Starting control rules
 Starting CGroup Rules Engine Daemon...
 
 Starting libvirt
 libvirt-bin start/running, process 940
 
 Setting up firewall rules to permit traffic to Cloud services
 Rules set
 We are going to enable ufw now.  This may disrupt network connectivity and service availability.  See the ufw documentation for information on how to manage ufw firewall policies.
 Command may disrupt existing ssh connections. Proceed with operation (y|n)?  Firewall is active and enabled on system startup
 
 Examining agent configuration
 Please enter the host name of the management server that this agent will connect to: (just hit ENTER to go with localhost)
 // Management ServerのIPアドレスか名前を指定してください.
 
 Cloud Agent setup completed successfully
 Starting the Cloud Agent
  * Starting Cloud Agent cloud-agent
    ...done.

cloud-agentの設定が終わると自動的にcloud-agentが起動します.

最後にiptables の設定を行います.
 $ sudo iptables -I FORWARD -i cloud-br0 -o cloud-br0 -j ACCEPT
 $ sudo ufw allow proto tcp from any to any port 5900:6100

以上でComputing Node の設定は完了です.
以上でComputing Node の設定は完了です.~
Management ServerとComputing Nodeの設定が終わったら[[初期設定>CloudStack/初期設定]]に移ります.


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS