<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>快​速​安​裝​指​引​</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta name="generator" content="publican 2.8" /><meta name="package" content="Apache_CloudStack-Quick_Install_Guide-4.0.2-zh-TW-0-0" /><meta name="description" content="本​安​裝​手​冊​描​述​了​一​個​嚴​謹​的​安​裝​環​境​，確​保​能​成​功​安​裝​Apache CloudStack，所​有​相​關​的​環​境​需​求​，我​們​都​將​一​一​為​您​介​紹​。​Apache Cloud能​夠​做​更​進​階​的​設​定​，但​都​不​在​本​手​冊​的​範​疇​內​" /><script type="text/javascript" src="../../../../../toc.js"></script><script type="text/javascript">
              addID('Apache_CloudStack');
              
	      addID('Apache_CloudStack.4.0.2');
              
              addID('Apache_CloudStack.4.0.2.books');
	      addID('Apache_CloudStack.4.0.2.Quick_Install_Guide');
              </script></head><body class="toc_embeded "><div id="tocdiv" class="toc"><iframe id="tocframe" class="toc" src="../../../../toc.html">This is an iframe, to view it upgrade your browser or enable iframe display.</iframe></div><p id="title"><a class="left" href="http://cloudstack.apache.org"><img src="Common_Content/images/image_left.png" alt="Product Site" /></a><a class="right" href="http://cloudstack.apache.org/docs"><img src="Common_Content/images/image_right.png" alt="Documentation Site" /></a></p><div xml:lang="zh-TW" class="book" id="idm2284848" lang="zh-TW"><div class="titlepage"><div><div class="producttitle"><span class="productname">Apache CloudStack</span> <span class="productnumber">4.0.2</span></div><div><h1 id="idm2284848" class="title">快​速​安​裝​指​引​</h1></div><div><h2 class="subtitle">Apache CloudStack的​佈​署​指​南​</h2></div><p class="edition">版 0</p><div><h3 class="corpauthor">
		<span class="inlinemediaobject"><object data="Common_Content/images/title_logo.svg" type="image/svg+xml"> </object></span>

	</h3></div><div><div xml:lang="zh-TW" class="authorgroup" lang="zh-TW"><div class="author"><h3 class="author"><span class="firstname">Apache</span> <span class="surname">CloudStack</span></h3></div></div></div><hr /><div><div id="idm33657616" class="legalnotice"><h1 class="legalnotice">法律聲明</h1><div class="para">
		Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
	</div><div class="para">
		http://www.apache.org/licenses/LICENSE-2.0
	</div><div class="para">
		Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
	</div><div class="para">
		Apache CloudStack is an effort undergoing incubation at The Apache Software Foundation (ASF).
	</div><div class="para">
		Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
	</div><div class="para">
		CloudStack® is a registered trademark of the Apache Software Foundation.
	</div><div class="para">
		Apache CloudStack, the CloudStack word design, the Apache CloudStack word design, and the cloud monkey logo are trademarks of the Apache Software Foundation.
	</div></div></div><div><div class="abstract"><h6>摘要</h6><div class="para">
			本​安​裝​手​冊​描​述​了​一​個​嚴​謹​的​安​裝​環​境​，確​保​能​成​功​安​裝​Apache CloudStack，所​有​相​關​的​環​境​需​求​，我​們​都​將​一​一​為​您​介​紹​。​Apache Cloud能​夠​做​更​進​階​的​設​定​，但​都​不​在​本​手​冊​的​範​疇​內​
		</div></div></div></div><hr /></div><div class="toc"><dl class="toc"><dt><span class="preface"><a href="#pref-qig-Preface">序​</a></span></dt><dd><dl><dt><span class="section"><a href="#idm38793136">1. 文​​​件​​​常​​​規​​​</a></span></dt><dd><dl><dt><span class="section"><a href="#idm29842992">1.1. 排​​​字​​​上​​​的​​​常​​​規​​​</a></span></dt><dt><span class="section"><a href="#idm59415248">1.2. 引​​​述​​​常​​​規​​​</a></span></dt><dt><span class="section"><a href="#idm19400592">1.3. 註​​​解​​​和​​​警​​​告​​​</a></span></dt></dl></dd><dt><span class="section"><a href="#feedback">2. Submitting Feedback and Getting Help</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-qig-Overview">1. 概​述​</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-qig-Overview-What_building">1.1. 架​設​目​標​</a></span></dt><dt><span class="section"><a href="#sect-qig-Overview-hilevel">1.2. 流​程​概​述​</a></span></dt><dt><span class="section"><a href="#sect-qig-Overview-prereqs">1.3. 事​前​準​備​</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-qig-Environment">2. 環​境​設​定​</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-qig-Environment-operatingsys">2.1. 作​業​系​統​ </a></span></dt><dd><dl><dt><span class="section"><a href="#sect-qig-Environment-operatingsys-network">2.1.1. 設​定​網​路​</a></span></dt><dt><span class="section"><a href="#sect-qig-Environment-operatingsys-hostname">2.1.2. 主​機​名​稱​</a></span></dt><dt><span class="section"><a href="#sect-qig-Environment-operatingsys-selinux">2.1.3. SELinux</a></span></dt><dt><span class="section"><a href="#sect-qig-Environment-operatingsys-ntp">2.1.4. NTP</a></span></dt><dt><span class="section"><a href="#sect-qig-Environment-operatingsys-repoconfig">2.1.5. 設​定​CloudStack的​套​件​庫​</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-qig-Environment-nfs">2.2. NFS</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-qig-Management">3. 安​裝​management server</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-qig-Management-database">3.1. 安​裝​及​設​定​資​料​庫​</a></span></dt><dt><span class="section"><a href="#sect-qig-Management-installation">3.2. 安​裝​</a></span></dt><dt><span class="section"><a href="#sect-qig-Management-templatesetup">3.3. 設​定​系​統​模​板​</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-qig-KVM">4. 安​裝​及​設​定​KVM</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-qig-KVM-Prerequisites">4.1. 事​前​準​備​</a></span></dt><dt><span class="section"><a href="#sect-qig-KVM-Installation">4.2. 安​裝​</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-qig-KVM-Configuration">4.2.1. 設​定​KVM</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#chap-qig-Config">5. 系​統​設​定​</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-qig-Config-UI_Access">5.1. 使​用​UI</a></span></dt><dt><span class="section"><a href="#sect-qig-Config-Zone">5.2. 設​定​zone</a></span></dt><dt><span class="section"><a href="#sect-qig-Config-Pod">5.3. 設​定​pod</a></span></dt><dt><span class="section"><a href="#Runbook-config-cluster">5.4. 設​定​cluster</a></span></dt><dd><dl><dt><span class="section"><a href="#Runbook-config-cluster-pristorage">5.4.1. 設​定​Primary Storage</a></span></dt><dt><span class="section"><a href="#Runbook-config-cluster-secstorage">5.4.2. 設​定​Secondary Storage</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="#appe-qig-Revision_History">A. 修​訂​記​錄​</a></span></dt></dl></div><div xml:lang="zh-TW" class="preface" id="pref-qig-Preface" lang="zh-TW"><div class="titlepage"><div><div><h1 class="title">序​</h1></div></div></div><div xml:lang="zh-TW" class="section" id="idm38793136" lang="zh-TW"><div class="titlepage"><div><div><h2 class="title" id="idm38793136">1. 文​​​件​​​常​​​規​​​</h2></div></div></div><div class="para">
		本​​​指​​​南​​​使​​​用​​​了​​​幾​​​種​​​常​​​規​​​，以​​​強​​​調​​​特​​​定​​​文​​​字​​​與​​​詞​​​組​​​，並​​​著​​​重​​​於​​​特​​​定​​​的​​​資​​​訊​​​。​​​
	</div><div class="para">
		在​​​ PDF 和​​​書​​​面​​​版​​​本​​​中​​​，本​​​指​​​南​​​使​​​用​​​了​​​來​​​自​​​於​​​ <a href="https://fedorahosted.org/liberation-fonts/">Liberation Fonts</a> 字​​​體​​​組​​​的​​​ typefaces。​​​倘​​​若​​​ Liberation Fonts 字​​​體​​​已​​​安​​​裝​​​在​​​您​​​系​​​統​​​上​​​的​​​話​​​，該​​​字​​​體​​​也​​​會​​​被​​​使​​​用​​​於​​​ HTML 版​​​本​​​中​​​。​​​若​​​是​​​沒​​​有​​​的​​​話​​​，其​​​它​​​相​​​等​​​的​​​ typefaces 便​​​會​​​被​​​顯​​​示​​​。​​​請​​​注​​​意​​​：就​​​預​​​設​​​值​​​，Red Hat Enterprise Linux 5（與​​​更​​​新​​​版​​​本​​​）已​​​包​​​含​​​了​​​ Liberation Fonts 字​​​體​​​。​​​
	</div><div class="section" id="idm29842992"><div class="titlepage"><div><div><h3 class="title" id="idm29842992">1.1. 排​​​字​​​上​​​的​​​常​​​規​​​</h3></div></div></div><div class="para">
			有​​​四​​​種​​​被​​​用​​​來​​​強​​​調​​​特​​​定​​​文​​​字​​​與​​​詞​​​組​​​的​​​排​​​字​​​常​​​規​​​。​​​這​​​些​​​常​​​規​​​以​​​及​​​它​​​們​​​所​​​適​​​用​​​於​​​的​​​情​​​況​​​如​​​下​​​。​​​
		</div><div class="para">
			<code class="literal">固​​​定​​​粗​​​體​​​字​​​型​​​（Mono-spaced Bold）</code>
		</div><div class="para">
			用​​​來​​​強​​​調​​​系​​​統​​​輸​​​入​​​，包​​​括​​​ shell 指​​​令​​​、​​​檔​​​案​​​名​​​稱​​​與​​​路​​​徑​​​。​​​同​​​時​​​也​​​會​​​被​​​使​​​用​​​來​​​強​​​調​​​ key caps 與​​​按​​​鍵​​​組​​​合​​​。​​​例​​​如​​​：
		</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
				若​​​要​​​查​​​看​​​位​​​於​​​您​​​目​​​前​​​工​​​作​​​目​​​錄​​​中​​​的​​​ <code class="filename">my_next_bestselling_novel</code> 檔​​​案​​​的​​​話​​​，請​​​在​​​ shell 提​​​示​​​中​​​輸​​​入​​​ <code class="command">cat my_next_bestselling_novel</code> 指​​​令​​​並​​​按​​​下​​​ <span class="keycap"><strong>Enter</strong></span> 來​​​執​​​行​​​該​​​指​​​令​​​。​​​
			</div></blockquote></div><div class="para">
			以​​​上​​​包​​​含​​​了​​​一​​​個​​​檔​​​案​​​名​​​稱​​​、​​​shell 指​​​令​​​，以​​​及​​​ key cap，並​​​且​​​全​​​部​​​以​​​固​​​定​​​粗​​​體​​​字​​​型​​​來​​​顯​​​示​​​。​​​
		</div><div class="para">
			按​​​鍵​​​組​​​合​​​可​​​透​​​過​​​ keycaps 藉​​​由​​​連​​​字​​​符​​​號​​​連​​​接​​​組​​​合​​​鍵​​​來​​​辨​​​別​​​。​​​例​​​如​​​：
		</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
				請​​​按​​​下​​​ <span class="keycap"><strong>Enter</strong></span> 來​​​執​​​行​​​指​​​令​​​。​​​
			</div><div class="para">
				請​​​按​​​下​​​ <span class="keycap"><strong>Ctrl</strong></span>+<span class="keycap"><strong>Alt</strong></span>+<span class="keycap"><strong>F2</strong></span> 來​​​切​​​換​​​至​​​第​​​一​​​個​​​虛​​​擬​​​終​​​端​​​機​​​。​​​按​​​下​​​ <span class="keycap"><strong>Ctrl</strong></span>+<span class="keycap"><strong>Alt</strong></span>+<span class="keycap"><strong>F1</strong></span> 來​​​返​​​回​​​您​​​的​​​ X-Windows session。​​​
			</div></blockquote></div><div class="para">
			第​​​一​​​段​​​落​​​強​​​調​​​了​​​應​​​輸​​​入​​​的​​​特​​​定​​​ keycap。​​​第​​​二​​​段​​​落​​​強​​​調​​​了​​​兩​​​組​​​含​​​有​​​三​​​個​​​ keycaps 的​​​組​​​合​​​鍵​​​，各​​​組​​​組​​​合​​​鍵​​​都​​​是​​​同​​​時​​​按​​​下​​​的​​​。​​​
		</div><div class="para">
			若​​​討​​​論​​​到​​​原​​​始​​​碼​​​的​​​話​​​，段​​​落​​​中​​​所​​​提​​​及​​​的​​​ class 名​​​稱​​​、​​​method、​​​functions、​​​variable 名​​​稱​​​與​​​回​​​傳​​​值​​​，都​​​將​​​會​​​如​​​上​​​一​​​般​​​地​​​以​​​<code class="literal">固​​​定​​​粗​​​體​​​字​​​型​​​</code>顯​​​示​​​。​​​例​​​如​​​：
		</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
				和​​​檔​​​案​​​相​​​關​​​的​​​ class，其​​​中​​​包​​​含​​​了​​​<code class="classname">filesystem</code>（檔​​​案​​​系​​​統​​​）、​​​<code class="classname">file</code>（檔​​​案​​​）以​​​及​​​ <code class="classname">dir</code>（目​​​錄​​​）。​​​各​​​個​​​ class 都​​​有​​​著​​​與​​​它​​​關​​​聯​​​的​​​權​​​限​​​組​​​。​​​
			</div></blockquote></div><div class="para">
			<span class="application"><strong>相​​​稱​​​粗​​​體​​​字​​​型​​​（Proportional Bold）</strong></span>
		</div><div class="para">
			這​​​代​​​表​​​在​​​系​​​統​​​上​​​所​​​會​​​看​​​見​​​的​​​文​​​字​​​或​​​詞​​​組​​​，這​​​包​​​含​​​了​​​應​​​用​​​程​​​式​​​名​​​稱​​​；對​​​話​​​方​​​塊​​​文​​​字​​​；被​​​標​​​記​​​的​​​按​​​鈕​​​；核​​​取​​​方​​​塊​​​與​​​ radio button 標​​​籤​​​；選​​​單​​​標​​​題​​​以​​​及​​​子​​​選​​​單​​​標​​​題​​​。​​​例​​​如​​​：
		</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
				由​​​主​​​選​​​單​​​選​​​取​​​<span class="guimenu"><strong>系​​​統​​​</strong></span> → <span class="guisubmenu"><strong>偏​​​好​​​設​​​定​​​</strong></span> → <span class="guimenuitem"><strong>滑​​​鼠​​​</strong></span>來​​​啟​​​動​​​<span class="application"><strong>滑​​​鼠​​​偏​​​好​​​設​​​定​​​</strong></span>。​​​請​​​在​​​<span class="guilabel"><strong>按​​​鈕​​​</strong></span>分​​​頁​​​中​​​點​​​選​​​<span class="guilabel"><strong>左​​​手​​​操​​​作​​​滑​​​鼠​​​</strong></span>核​​​取​​​方​​​塊​​​並​​​按​​​下​​​<span class="guibutton"><strong>關​​​閉​​​</strong></span>來​​​將​​​主​​​要​​​滑​​​鼠​​​按​​​鍵​​​由​​​左​​​邊​​​切​​​換​​​至​​​右​​​邊​​​（這​​​可​​​讓​​​滑​​​鼠​​​適​​​合​​​以​​​左​​​手​​​使​​​用​​​）。​​​
			</div><div class="para">
				若​​​要​​​將​​​特​​​殊​​​字​​​元​​​插​​​入​​​一​​​個​​​ <span class="application"><strong>gedit</strong></span> 檔​​​案​​​中​​​的​​​話​​​，請​​​由​​​主​​​選​​​單​​​中​​​選​​​擇​​​<span class="guimenu"><strong>應​​​用​​​程​​​式​​​</strong></span> → <span class="guisubmenu"><strong>附​​​屬​​​應​​​用​​​程​​​式​​​</strong></span> → <span class="guimenuitem"><strong>字​​​元​​​對​​​應​​​表​​​</strong></span>。​​​接​​​下​​​來​​​，請​​​由​​​<span class="application"><strong>字​​​元​​​對​​​應​​​表​​​</strong></span>的​​​選​​​單​​​中​​​選​​​擇​​​<span class="guimenu"><strong>搜​​​尋​​​</strong></span> → <span class="guimenuitem"><strong>尋​​​找​​​…</strong></span>，並​​​在​​​<span class="guilabel"><strong>搜​​​尋​​​</strong></span>欄​​​位​​​中​​​輸​​​入​​​字​​​元​​​的​​​名​​​稱​​​，然​​​後​​​按​​​下​​​<span class="guibutton"><strong>下​​​一​​​步​​​</strong></span>。​​​您​​​所​​​選​​​擇​​​的​​​字​​​元​​​將​​​會​​​顯​​​示​​​於​​​<span class="guilabel"><strong>字​​​元​​​表​​​</strong></span>中​​​。​​​在​​​被​​​選​​​定​​​的​​​字​​​元​​​上​​​點​​​兩​​​下​​​滑​​​鼠​​​便​​​可​​​將​​​它​​​放​​​置​​​在​​​<span class="guilabel"><strong>準​​​備​​​複​​​製​​​的​​​文​​​字​​​</strong></span>欄​​​位​​​中​​​，接​​​下​​​來​​​請​​​按​​​下​​​旁​​​邊​​​的​​​<span class="guibutton"><strong>複​​​製​​​</strong></span>按​​​鈕​​​。​​​現​​​在​​​，請​​​切​​​換​​​回​​​您​​​的​​​文​​​件​​​並​​​由​​​ <span class="application"><strong>gedit</strong></span> 的​​​選​​​單​​​上​​​選​​​擇​​​<span class="guimenu"><strong>編​​​輯​​​</strong></span> → <span class="guimenuitem"><strong>貼​​​上​​​</strong></span>。​​​
			</div></blockquote></div><div class="para">
			以​​​上​​​文​​​字​​​包​​​含​​​了​​​應​​​用​​​程​​​式​​​名​​​稱​​​；系​​​統​​​全​​​域​​​的​​​選​​​單​​​名​​​稱​​​與​​​項​​​目​​​；應​​​用​​​程​​​式​​​特​​​屬​​​的​​​選​​​單​​​名​​​稱​​​；以​​​及​​​在​​​ GUI 介​​​面​​​中​​​所​​​看​​​到​​​的​​​按​​​鈕​​​與​​​文​​​字​​​全​​​部​​​皆​​​以​​​相​​​稱​​​粗​​​體​​​字​​​型​​​來​​​顯​​​示​​​，並​​​且​​​可​​​透​​​過​​​內​​​文​​​來​​​辨​​​別​​​。​​​
		</div><div class="para">
			<code class="command"><em class="replaceable"><code>Mono-spaced Bold Italic</code></em></code>（固​​​定​​​粗​​​體​​​斜​​​體​​​字​​​型​​​）或​​​是​​​ <span class="application"><strong><em class="replaceable"><code>Proportional Bold Italic</code></em></strong></span>（相​​​稱​​​粗​​​體​​​斜​​​體​​​字​​​型​​​）
		</div><div class="para">
			無​​​論​​​是​​​ Mono-spaced Bold 或​​​是​​​ Proportional Bold，額​​​外​​​的​​​斜​​​體​​​字​​​型​​​便​​​表​​​示​​​可​​​替​​​換​​​或​​​是​​​變​​​數​​​文​​​字​​​。​​​斜​​​體​​​字​​​型​​​代​​​表​​​您​​​不​​​會​​​照​​​字​​​面​​​輸​​​入​​​的​​​文​​​字​​​，或​​​是​​​會​​​依​​​照​​​情​​​況​​​而​​​改​​​變​​​的​​​文​​​字​​​。​​​比​​​方​​​說​​​：
		</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
				若​​​要​​​透​​​過​​​使​​​用​​​ ssh 來​​​連​​​至​​​一​​​部​​​遠​​​端​​​機​​​器​​​，請​​​在​​​ shell 提​​​示​​​中​​​輸​​​入​​​ <code class="command">ssh <em class="replaceable"><code>用​​​戶​​​名​​​稱​​​</code></em>@<em class="replaceable"><code>網​​​域​​​.名​​​稱​​​</code></em></code>。​​​若​​​遠​​​端​​​機​​​器​​​為​​​ <code class="filename">example.com</code> 而​​​您​​​在​​​該​​​機​​​器​​​上​​​的​​​用​​​戶​​​名​​​稱​​​為​​​ john 的​​​話​​​，請​​​輸​​​入​​​ <code class="command">ssh john@example.com</code>。​​​
			</div><div class="para">
				<code class="command">mount -o remount <em class="replaceable"><code>檔​​​案​​​系​​​統​​​</code></em></code> 指​​​令​​​會​​​將​​​ named 檔​​​案​​​系​​​統​​​重​​​新​​​掛​​​載​​​。​​​比​​​方​​​說​​​，若​​​要​​​重​​​新​​​掛​​​載​​​ <code class="filename">/home</code> 檔​​​案​​​系​​​統​​​的​​​話​​​，該​​​指​​​令​​​就​​​會​​​是​​​ <code class="command">mount -o remount /home</code>。​​​
			</div><div class="para">
				使​​​用​​​ <code class="command">rpm -q <em class="replaceable"><code>套​​​件​​​</code></em></code> 指​​​令​​​來​​​查​​​看​​​目​​​前​​​已​​​安​​​裝​​​套​​​件​​​的​​​版​​​本​​​。​​​系​​​統​​​將​​​會​​​回​​​傳​​​此​​​結​​​果​​​：<code class="command"><em class="replaceable"><code>套​​​件​​​發​​​行​​​版​​​本​​​</code></em></code>。​​​
			</div></blockquote></div><div class="para">
			請​​​注​​​意​​​以​​​上​​​以​​​粗​​​體​​​斜​​​體​​​字​​​型​​​所​​​表​​​現​​​出​​​的​​​文​​​字​​​ — 用​​​戶​​​名​​​稱​​​、​​​網​​​域​​​.名​​​稱​​​、​​​檔​​​案​​​系​​​統​​​、​​​套​​​件​​​以​​​及​​​發​​​行​​​版​​​本​​​。​​​所​​​有​​​文​​​字​​​皆​​​為​​​佔​​​位​​​符​​​號​​​，這​​​可​​​代​​​表​​​您​​​提​​​供​​​一​​​項​​​指​​​令​​​時​​​所​​​輸​​​入​​​的​​​文​​​字​​​或​​​是​​​系​​​統​​​所​​​顯​​​示​​​的​​​文​​​字​​​。​​​
		</div><div class="para">
			除​​​了​​​用​​​來​​​顯​​​示​​​一​​​項​​​作​​​業​​​標​​​題​​​這​​​樣​​​的​​​標​​​準​​​用​​​法​​​，斜​​​體​​​字​​​也​​​可​​​代​​​表​​​第​​​一​​​次​​​使​​​用​​​的​​​重​​​要​​​新​​​詞​​​彙​​​。​​​比​​​方​​​說​​​：
		</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
				Publican 是​​​個​​​ <em class="firstterm">DocBook</em> 發​​​佈​​​系​​​統​​​。​​​
			</div></blockquote></div></div><div class="section" id="idm59415248"><div class="titlepage"><div><div><h3 class="title" id="idm59415248">1.2. 引​​​述​​​常​​​規​​​</h3></div></div></div><div class="para">
			終​​​端​​​機​​​輸​​​出​​​與​​​原​​​始​​​碼​​​資​​​料​​​會​​​被​​​設​​​為​​​在​​​附​​​近​​​的​​​文​​​字​​​間​​​不​​​會​​​被​​​看​​​見​​​。​​​
		</div><div class="para">
			傳​​​送​​​至​​​終​​​端​​​機​​​的​​​輸​​​出​​​設​​​置​​​為​​​ <code class="computeroutput">mono-spaced roman</code>，並​​​且​​​以​​​此​​​方​​​式​​​顯​​​示​​​：
		</div><pre class="screen">books        Desktop   documentation  drafts  mss    photos   stuff  svn
books_tests  Desktop1  downloads      images  notes  scripts  svgs</pre><div class="para">
			原​​​始​​​碼​​​排​​​列​​​亦​​​設​​​置​​​為​​​ <code class="computeroutput">mono-spaced roman</code> 不​​​過​​​會​​​如​​​下​​​加​​​上​​​語​​​法​​​強​​​調​​​：
		</div><pre class="programlisting">package org.<span class="perl_Function">jboss</span>.<span class="perl_Function">book</span>.<span class="perl_Function">jca</span>.<span class="perl_Function">ex1</span>;

<span class="perl_Keyword">import</span> javax.naming.InitialContext;

<span class="perl_Keyword">public</span> <span class="perl_Keyword">class</span> ExClient
{
   <span class="perl_Keyword">public</span> <span class="perl_DataType">static</span> <span class="perl_DataType">void</span> <span class="perl_Function">main</span>(String args[]) 
       <span class="perl_Keyword">throws</span> Exception
   {
      InitialContext iniCtx = <span class="perl_Keyword">new</span> InitialContext();
      Object         ref    = iniCtx.<span class="perl_Function">lookup</span>(<span class="perl_String">"EchoBean"</span>);
      EchoHome       home   = (EchoHome) ref;
      Echo           echo   = home.<span class="perl_Function">create</span>();

      System.<span class="perl_Function">out</span>.<span class="perl_Function">println</span>(<span class="perl_String">"Created Echo"</span>);

      System.<span class="perl_Function">out</span>.<span class="perl_Function">println</span>(<span class="perl_String">"Echo.echo('Hello') = "</span> + echo.<span class="perl_Function">echo</span>(<span class="perl_String">"Hello"</span>));
   }
}</pre></div><div class="section" id="idm19400592"><div class="titlepage"><div><div><h3 class="title" id="idm19400592">1.3. 註​​​解​​​和​​​警​​​告​​​</h3></div></div></div><div class="para">
			最​​​後​​​，我​​​們​​​將​​​使​​​用​​​三​​​種​​​視​​​覺​​​上​​​的​​​形​​​式​​​，來​​​強​​​調​​​可​​​能​​​會​​​被​​​遺​​​漏​​​掉​​​的​​​資​​​訊​​​。​​​
		</div><div class="note"><div class="admonition_header"><h2>註​​​解​​​</h2></div><div class="admonition"><div class="para">
				註​​​解​​​代​​​表​​​某​​​些​​​作​​​業​​​上​​​的​​​提​​​示​​​、​​​捷​​​徑​​​或​​​是​​​其​​​它​​​完​​​成​​​方​​​式​​​。​​​忽​​​略​​​註​​​解​​​並​​​不​​​會​​​帶​​​來​​​太​​​大​​​的​​​負​​​面​​​影​​​響​​​，不​​​過​​​您​​​可​​​能​​​會​​​忽​​​略​​​掉​​​某​​​些​​​能​​​夠​​​較​​​輕​​​鬆​​​完​​​成​​​工​​​作​​​的​​​方​​​式​​​。​​​
			</div></div></div><div class="important"><div class="admonition_header"><h2>重​​​點​​​</h2></div><div class="admonition"><div class="para">
				重​​​點​​​方​​​塊​​​會​​​將​​​容​​​易​​​遺​​​漏​​​掉​​​的​​​項​​​目​​​詳​​​細​​​列​​​出​​​：只​​​對​​​應​​​於​​​當​​​下​​​ session 的​​​配​​​置​​​變​​​更​​​，或​​​是​​​某​​​些​​​要​​​套​​​用​​​更​​​新​​​前​​​必​​​須​​​將​​​之​​​重​​​新​​​啟​​​用​​​的​​​服​​​務​​​。​​​倘​​​若​​​您​​​忽​​​略​​​掉​​​重​​​點​​​方​​​塊​​​，雖​​​然​​​不​​​會​​​造​​​成​​​資​​​料​​​遺​​​失​​​，不​​​過​​​卻​​​會​​​造​​​成​​​工​​​作​​​上​​​的​​​不​​​便​​​與​​​其​​​它​​​影​​​響​​​。​​​
			</div></div></div><div class="warning"><div class="admonition_header"><h2>警​​​告​​​</h2></div><div class="admonition"><div class="para">
				任​​​何​​​警​​​告​​​都​​​不​​​該​​​被​​​忽​​​略​​​掉​​​。​​​忽​​​略​​​警​​​告​​​則​​​很​​​有​​​可​​​能​​​會​​​造​​​成​​​資​​​料​​​上​​​的​​​遺​​​失​​​。​​​
			</div></div></div></div></div><div xml:lang="zh-TW" class="section" id="feedback" lang="zh-TW"><div class="titlepage"><div><div><h2 class="title">2. Submitting Feedback and Getting Help</h2></div></div></div><a id="idm84722832" class="indexterm"></a><div class="para">
		If you find a typographical error in this manual, or if you have thought of a way to make this manual better, we would love to hear from you! Please submit a bug: <a href="https://issues.apache.org/jira/browse/CLOUDSTACK">https://issues.apache.org/jira/browse/CLOUDSTACK</a> against the component <span class="application"><strong>Doc</strong></span>.
	</div><div class="para">
		If you have a suggestion for improving the documentation, try to be as specific as possible when describing it. If you have found an error, please include the section number and some of the surrounding text so we can find it easily.
	</div><div class="para">
		Better yet, feel free to submit a patch if you would like to enhance the documentation. Our documentation is, along with the rest of the Apache CloudStack source code, kept in the project's git repository.
	</div><div class="para">
		The most efficient way to get help with Apache CloudStack is to ask on the mailing lists.
	</div><div class="para">
		The Apache CloudStack project has mailing lists for users and developers. These are the official channels of communication for the project and are the best way to get answers about using and contributing to CloudStack. It's a good idea to subscribe to the users@cloudstack.apache.org mailing list if you've deployed or are deploying CloudStack into production, and even for test deployments.
	</div><div class="para">
		The CloudStack developer's mailing list (dev@cloudstack.apache.org) is for discussions about CloudStack development, and is the best list for discussing possible bugs in CloudStack. Anyone contributing to CloudStack should be on this mailing list.
	</div><div class="para">
		To posts to the lists, you'll need to be subscribed. See the <a href="http://cloudstack.apache.org/mailing-lists.html">CloudStack Web site</a> for instructions.
	</div></div></div><div xml:lang="zh-TW" class="chapter" id="chap-qig-Overview" lang="zh-TW"><div class="titlepage"><div><div><h1 class="title">章 1. 概​述​</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="#sect-qig-Overview-What_building">1.1. 架​設​目​標​</a></span></dt><dt><span class="section"><a href="#sect-qig-Overview-hilevel">1.2. 流​程​概​述​</a></span></dt><dt><span class="section"><a href="#sect-qig-Overview-prereqs">1.3. 事​前​準​備​</a></span></dt></dl></div><div class="para">
		架​設​基​礎​設​施​即​服​務​(Infrastructure-as-a-Service, IaaS)雲​端​平​台​服​務​是​一​件​複​雜​的​工​作​。​在​架​設​的​過​程​中​，系​統​往​往​提​供​了​過​多​的​選​項​，以​至​於​即​使​是​經​驗​豐​富​的​IT人​員​在​架​設​的​初​期​也​會​感​到​十​分​困​惑​。​本​操​作​手​冊​的​目​的​是​為​了​提​供​簡​單​且​直​覺​的​安​裝​引​導​，幫​助​您​快​速​的​架​設​和​運​行​一​個​簡​易​的​CloudStack環​境​
	</div><div class="section" id="sect-qig-Overview-What_building"><div class="titlepage"><div><div><h2 class="title">1.1. 架​設​目​標​</h2></div></div></div><div class="para">
			本​操​作​手​冊​將​重​點​介​紹​如​何​架​設​CloudStack：使​用​CentOS 6.3(具​備​有​NFS storage)並​以​KVM做​為​Hypervisor，此​外​採​用​layer-2以​及​layer-3的​網​路​做​安​全​分​隔​（也​就​是​所​謂​的​Security Groups），所​有​安​裝​均​使​用​一​台​實​體​主​機​
		</div><div class="para">
			KVM（KVM, or Kernel-based Virtual Machine）是​一​種​針​對​Linux核​心​的​虛​擬​化​技​術​。​KVM支​持​本​地​虛​擬​化​，但​主​機​必​須​具​有​支​持​硬​體​虛​擬​化​的​延​伸​。​
		</div><div class="para">
			Security Groups類​似​於​分​散​式​防​火​牆​的​功​能​，它​可​以​控​制​一​組​虛​擬​機​的​存​取​權​限​
		</div></div><div class="section" id="sect-qig-Overview-hilevel"><div class="titlepage"><div><div><h2 class="title">1.2. 流​程​概​述​</h2></div></div></div><div class="para">
			在​實​際​安​裝​CloudStack之​前​，需​要​先​安​裝​作​業​系​統​，並​將​其​設​定​為​一​台​NFS伺​服​器​；接​下​來​是​安​裝​management server並​下​載​系​統​虛​擬​機​模​版​，以​及​安​裝​agent；最​後​將​描​述​如​何​使​用​CloudStack的​Web介​面​設​定​整​個​雲​端​平​台​服​務​。​
		</div></div><div class="section" id="sect-qig-Overview-prereqs"><div class="titlepage"><div><div><h2 class="title">1.3. 事​前​準​備​</h2></div></div></div><div class="para">
			完​成​本​操​作​手​冊​所​描​述​的​所​有​操​作​流​程​，您​可​能​需​要​下​列​資​源​：
			<div class="orderedlist"><ol><li class="listitem"><div class="para">
						至​少​一​台​支​援​硬​體​虛​擬​化​的​主​機​
					</div></li><li class="listitem"><div class="para">
						CentOS 6.3安​裝​ISO檔​<a href="http://mirrors.kernel.org/centos/6.3/isos/x86_64/CentOS-6.3-x86_64-minimal.iso"> CentOS 6.3 x86_64 minimal install CD </a>
					</div></li><li class="listitem"><div class="para">
						一​段​class C的​網​路​，gateway為​xxx.xxx.xxx.1，此​網​段​中​不​能​具​有​DHCP，所​有​的​CloudStack主​機​必​須​使​用​靜​態​的​IP位​址​，再​次​強​調​，這​是​為​了​簡​化​安​裝​。​
					</div></li></ol></div>

		</div></div></div><div xml:lang="zh-TW" class="chapter" id="chap-qig-Environment" lang="zh-TW"><div class="titlepage"><div><div><h1 class="title">章 2. 環​境​設​定​</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="#sect-qig-Environment-operatingsys">2.1. 作​業​系​統​ </a></span></dt><dd><dl><dt><span class="section"><a href="#sect-qig-Environment-operatingsys-network">2.1.1. 設​定​網​路​</a></span></dt><dt><span class="section"><a href="#sect-qig-Environment-operatingsys-hostname">2.1.2. 主​機​名​稱​</a></span></dt><dt><span class="section"><a href="#sect-qig-Environment-operatingsys-selinux">2.1.3. SELinux</a></span></dt><dt><span class="section"><a href="#sect-qig-Environment-operatingsys-ntp">2.1.4. NTP</a></span></dt><dt><span class="section"><a href="#sect-qig-Environment-operatingsys-repoconfig">2.1.5. 設​定​CloudStack的​套​件​庫​</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-qig-Environment-nfs">2.2. NFS</a></span></dt></dl></div><div class="para">
		以​下​我​們​將​詳​細​描​述​安​裝​Apache CloudStack前​的​準​備​工​作​
	</div><div class="section" id="sect-qig-Environment-operatingsys"><div class="titlepage"><div><div><h2 class="title">2.1. 作​業​系​統​ </h2></div></div></div><div class="para">
			使​用​CentOS 6.3 x86_64 minimal的​安​裝​ISO檔​，於​實​體​主​機​上​安​裝​CentOS，安​裝​過​程​中​採​用​預​設​選​項​即​可​。​
		</div><div class="para">
			安​裝​完​成​後​，您​可​能​會​想​以​root身​分​採​用​SSH的​方​式​連​接​到​剛​安​裝​好​基​礎​作​業​系​統​的​主​機​。​注​意​，請​勿​於​正​式​運​行​的​生​產​環​境​中​，使​用​root身​分​登​入​，也​務​必​於​安​裝​及​配​置​過​後​關​閉​SSH遠​端​登​入​服​務​。​
		</div><div class="section" id="sect-qig-Environment-operatingsys-network"><div class="titlepage"><div><div><h3 class="title">2.1.1. 設​定​網​路​</h3></div></div></div><div class="para">
				一​般​情​況​下​，新​安​裝​的​主​機​尚​未​啟​用​網​路​，您​必​須​根​據​實​際​環​境​進​行​網​路​設​定​。​由​於​網​路​中​不​包​含​DHCP伺​服​器​，您​需​要​手​動​設​定​網​路​介​面​，為​了​達​到​快​速​安​裝​的​目​標​，因​此​，我​們​假​設​新​安​裝​的​主​機​上​只​包​含​了​一​張​eth0的​網​路​介​面​。​
			</div><div class="para">
				以​root身​分​登​入​主​機​，檢​查​設​定​檔​<code class="filename">/etc/sysconfig/network-scripts/ifcfg-eth0</code>，預​設​的​情​況​下​，其​內​容​如​下​所​示​：
<pre class="screen">
DEVICE="eth0"
HWADDR="52:54:00:B9:A6:C0"
NM_CONTROLLED="yes"
ONBOOT="no"</pre>

			</div><div class="para">
				根​據​以​上​的​預​設​設​定​，您​將​無​法​連​接​到​網​路​，對​於​CloudStack也​同​樣​不​適​合​;您​需​修​改​配​置​文​件​，指​定​IP位​址​、​網​路​遮​罩​...等​，如​下​例​所​示​：
			</div><div class="important"><div class="admonition_header"><h2>實​體​位​址​</h2></div><div class="admonition"><div class="para">
					請​勿​複​製​網​路​配​置​範​例​中​的​MAC位​址​，每​張​網​路​卡​具​有​獨​特​的​MAC位​址​，保​留​您​實​際​配​置​文​件​中​的​HWADDR項​目​中​已​存​在​的​MAC位​址​。​
				</div></div></div><pre class="screen">
DEVICE=eth0
HWADDR=52:54:00:B9:A6:C0
NM_CONTROLLED=no
ONBOOT=yes BOOTPROTO=none
IPADDR=172.16.10.2
NETMASK=255.255.255.0
GATEWAY=172.16.10.1
DNS1=8.8.8.8
DNS2=8.8.4.4</pre><div class="note"><div class="admonition_header"><h2>IP位​址​</h2></div><div class="admonition"><div class="para">
					本​文​件​假​設​您​提​供​一​個​Class C之​網​路​供​CloudStack使​用​；該​網​路​可​以​試​任​何​RFC 1918相​容​的​網​路​，然​而​我​們​假​設​您​使​用​了​IP位​址​的​最​後​一​段​與​手​冊​中​使​用​的​鄉​符​合​；例​如​手​冊​中​使​用​<strong class="userinput"><code><em class="replaceable"><code>172.16.10</code></em>.2</code></strong>，如​果​您​使​用​192.168.55.0/24，請​使​用​<strong class="userinput"><code><em class="replaceable"><code>192.168.55</code></em>.2</code></strong>
				</div></div></div><div class="para">
				設​定​檔​完​成​之​後​，需​要​執​行​命​令​啟​動​網​路​
			</div><pre class="screen"><code class="prompt"># </code><strong class="userinput"><code><code class="command">chkconfig</code> network on</code></strong></pre><pre class="screen"><code class="prompt"># </code><strong class="userinput"><code><code class="command">service</code> network start</code></strong></pre></div><div class="section" id="sect-qig-Environment-operatingsys-hostname"><div class="titlepage"><div><div><h3 class="title">2.1.2. 主​機​名​稱​</h3></div></div></div><div class="para">
				CloudStack要​求​設​定​正​確​的​主​機​名​稱​，如​果​安​裝​作​業​系​統​時​您​採​用​的​預​設​的​選​項​，主​機​名​稱​應​該​為​localhost.localdomain，輸​入​以​下​命​令​可​以​逕​行​驗​證​：
			</div><pre class="screen"><code class="prompt"># </code><strong class="userinput"><code>hostname --fqdn</code></strong></pre><div class="para">
				此​時​會​回​傳​：
			</div><pre class="screen">localhost</pre><div class="para">
				為​了​讓​CloudStack能​正​確​運​行​，需​重​新​設​定​主​機​名​稱​，編​輯​<code class="filename">/etc/hosts</code>文​件​，更​改​範​例​如​下​：
<pre class="screen">
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 
172.16.10.2 srvr1.cloud.priv
</pre>

			</div><div class="para">
				更​改​設​定​檔​後​，重​新​啟​動​網​路​服​務​：
			</div><pre class="screen"><code class="prompt"># </code><strong class="userinput"><code><code class="command">service</code> network restart</code></strong></pre><div class="para">
				使​用​<code class="command">hostname --fqdn</code>命​令​重​新​檢​查​主​機​名​稱​，請​確​認​此​時​回​傳​了​一​個​FQDN的​格​式​結​果​
			</div></div><div class="section" id="sect-qig-Environment-operatingsys-selinux"><div class="titlepage"><div><div><h3 class="title">2.1.3. SELinux</h3></div></div></div><div class="para">
				目​前​版​本​的​CloudStack需​要​設​定​SELinux為​permissive才​能​正​常​運​行​，您​需​要​修​改​系​統​設​定​，並​確​認​設​定​於​主​機​重​新​啟​動​後​仍​然​有​效​
			</div><div class="para">
				將​SELinux設​定​為​permissive，需​使​用​以​下​指​令​：
			</div><pre class="screen"><code class="prompt"># </code><strong class="userinput"><code><code class="command">setenforce</code>0</code></strong></pre><div class="para">
				為​了​確​保​此​設​定​永​久​有​效​，需​修​改​設​定​檔​<code class="filename">/etc/selinux/config</code>，設​定​為​permissive，如​下​例​所​示​：
			</div><pre class="screen">
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted</pre></div><div class="section" id="sect-qig-Environment-operatingsys-ntp"><div class="titlepage"><div><div><h3 class="title">2.1.4. NTP</h3></div></div></div><div class="para">
				為​了​同​步​雲​端​平​台​系​統​中​個​主​機​的​時​間​，需​要​設​定​NTP；NTP服​務​預​設​是​沒​有​安​裝​的​，因​此​，必​須​先​安​裝​NTP後​逕​行​設​定​，採​用​以​下​指​令​安​裝​NTP：
			</div><pre class="screen"><code class="prompt"># </code><strong class="userinput"><code><code class="command">yum</code> -y install ntp</code></strong></pre><div class="para">
				使​用​預​設​的​設​定​檔​即​可​滿​足​本​文​件​需​求​，然​後​啟​用​NTP服​務​並​設​定​為​開​機​後​自​動​執​行​，如​下​所​示​：
			</div><pre class="screen"><code class="prompt"># </code><strong class="userinput"><code><code class="command">chkconfig</code> ntpd on</code></strong></pre><pre class="screen"><code class="prompt"># </code><strong class="userinput"><code><code class="command">service</code> ntpd start</code></strong></pre></div><div class="section" id="sect-qig-Environment-operatingsys-repoconfig"><div class="titlepage"><div><div><h3 class="title">2.1.5. 設​定​CloudStack的​套​件​庫​</h3></div></div></div><div class="para">
				我​們​必​須​設​定​主​機​使​用​CloudStack的​套​件​庫​
				<div class="important"><div class="admonition_header"><h2>以​下​所​列​的​套​件​庫​並​非​由​Apache官​方​所​維​護​的​專​案​套​件​庫​</h2></div><div class="admonition"><div class="para">
						官​方​所​發​佈​的​Apache CloudStack為​其​原​始​程​式​碼​，Apache官​方​並​不​提​供​已​編​譯​完​的​CloudStack執​行​程​式​。​完​整​的​安​裝​指​引​將​會​為​您​描​述​如​何​將​程​式​原​始​碼​包​裝​成​RPM檔​以​及​yum的​套​件​庫​。​此​安​裝​指​引​相​當​簡​明​扼​要​，因​為​採​用​社​群​提​供​的​yum套​件​庫​，會​是​一​個​不​錯​的​選​擇​
					</div></div></div>

			</div><div class="para">
				新​增​一​個​CloudStack套​件​庫​，請​建​立​<code class="filename">/etc/yum.repos.d/cloudstack.repo</code>檔​案​，並​加​入​以​下​內​容​
			</div><pre class="programlisting">
[cloudstack]
name=cloudstack
baseurl=http://cloudstack.apt-get.eu/rhel/4.0/
enabled=1
gpgcheck=0
</pre></div></div><div class="section" id="sect-qig-Environment-nfs"><div class="titlepage"><div><div><h2 class="title">2.2. NFS</h2></div></div></div><div class="para">
			本​文​件​描​述​的​佈​署​環​境​使​用​NFS做​為​主​要​儲​存​裝​置​及​次​要​儲​存​裝​置​，需​要​配​置​兩​個​NFS的​掛​載​點​，在​此​之​前​請​先​安​裝​<span class="application"><strong>nfs-utils</strong></span>
		</div><pre class="screen"><code class="prompt"># </code><strong class="userinput"><code><code class="command">yum</code> install nfs-utils</code></strong></pre><div class="para">
			接​下​來​需​設​定​NFS提​供​兩​個​不​同​的​掛​載​點​，請​編​輯​<code class="filename">/etc/exports</code>設​定​檔​，並​確​保​其​內​容​如​下​所​示​：
		</div><pre class="screen">
/primary *(rw,async,no_root_squash)
/secondary *(rw,async,no_root_squash)</pre><div class="para">
			您​會​發​現​到​，上​述​設​定​檔​中​設​定​了​兩​個​不​存​在​於​檔​案​系​統​中​的​目​錄​，因​此​，我​們​必​須​建​立​這​些​目​錄​並​給​予​正​確​的​權​限​，指​令​如​下​所​示​：
		</div><pre class="screen">
<code class="prompt"># </code><strong class="userinput"><code><code class="command">mkdir</code> /primary</code></strong>
<code class="prompt"># </code><strong class="userinput"><code><code class="command">mkdir</code> /secondary</code></strong>
</pre><div class="para">
			CentOS 6.x版​本​預​設​使​用​NFSv4，NFSv4要​求​客​戶​端​的​設​定​相​符​的​域​名​，本​文​以​cloud.priv為​例​，請​確​認​文​件​<code class="filename">/etc/idmapd.conf</code>中​的​域​名​設​定​沒​有​被​註​解​，並​設​定​為​以​下​內​容​：
		</div><pre class="screen">Domain = cloud.priv</pre><div class="para">
			現​在​，您​必​須​取​消​於​<code class="filename">/etc/sysconfig/nfs</code>設​定​檔​中​的​註​解​：
		</div><pre class="screen">
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020</pre><div class="para">
			接​下​來​，需​要​設​定​防​火​牆​，允​許​NFS連​結​，編​輯​設​定​檔​<code class="filename">/etc/sysconfig/iptables</code>如​下​：
		</div><pre class="screen">
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p udp --dport 111 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 111 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 2049 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 32803 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p udp --dport 32769 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 892 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p udp --dport 892 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 875 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p udp --dport 875 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 662 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p udp --dport 662 -j ACCEPT
</pre><div class="para">
			透​過​以​下​指​令​重​新​啟​動​iptables服​務​：
		</div><pre class="screen"><code class="prompt"># </code><strong class="userinput"><code><code class="command">service</code> iptables restart</code></strong></pre><div class="para">
			設​定​NSF服​務​於​開​機​後​自​動​啟​用​：
		</div><pre class="screen">
<code class="prompt"># </code><strong class="userinput"><code><code class="command">service</code> rpcbind start</code></strong>
<code class="prompt"># </code><strong class="userinput"><code><code class="command">service</code> nfs start</code></strong>
<code class="prompt"># </code><strong class="userinput"><code><code class="command">chkconfig</code> rpcbind on</code></strong>
<code class="prompt"># </code><strong class="userinput"><code><code class="command">chkconfig</code> nfs on</code></strong>
</pre></div></div><div xml:lang="zh-TW" class="chapter" id="chap-qig-Management" lang="zh-TW"><div class="titlepage"><div><div><h1 class="title">章 3. 安​裝​management server</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="#sect-qig-Management-database">3.1. 安​裝​及​設​定​資​料​庫​</a></span></dt><dt><span class="section"><a href="#sect-qig-Management-installation">3.2. 安​裝​</a></span></dt><dt><span class="section"><a href="#sect-qig-Management-templatesetup">3.3. 設​定​系​統​模​板​</a></span></dt></dl></div><div class="para">
		現​在​需​要​安​裝​CloudStack的​management server以​及​相​關​套​件​
	</div><div class="section" id="sect-qig-Management-database"><div class="titlepage"><div><div><h2 class="title">3.1. 安​裝​及​設​定​資​料​庫​</h2></div></div></div><div class="para">
			首​先​，安​裝​ <span class="application"><strong>MySQL</strong></span>並​設​定​，以​確​保​CloudStack能​正​常​操​作​資​料​庫​
		</div><div class="para">
			執​行​以​下​指​令​進​行​安​裝​<span class="application"><strong>MySQL</strong></span>
<pre class="screen"><code class="prompt"># </code><strong class="userinput"><code><code class="command">yum</code> -y install mysql-server</code></strong></pre>

		</div><div class="para">
			<span class="application"><strong>MySQL</strong></span>安​裝​完​成​後​，需​修​改​<code class="filename">/etc/my.cnf</code>設​定​檔​，您​必​須​於​[mysqld]區​塊​修​改​內​容​如​下​：
<pre class="screen">
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = 'ROW'</pre>

		</div><div class="para">
			<span class="application"><strong>MySQL</strong></span>設​定​完​成​後​，於​作​業​系​統​中​設​定​為​開​機​後​自​動​執​行​
<pre class="screen">
<code class="prompt"># </code><strong class="userinput"><code><code class="command">service</code> mysqld start</code></strong>
<code class="prompt"># </code><strong class="userinput"><code><code class="command">chkconfig</code> mysqld on</code></strong>
</pre>

		</div></div><div class="section" id="sect-qig-Management-installation"><div class="titlepage"><div><div><h2 class="title">3.2. 安​裝​</h2></div></div></div><div class="para">
			現​在​我​們​即​將​開​始​安​裝​CloudStack的​management server。​我​們​採​用​以​下​指​令​開​始​安​裝​
<pre class="screen"><code class="prompt"># </code><strong class="userinput"><code><code class="command">yum</code> -y install cloud-client</code></strong></pre>

		</div><div class="para">
			Management server安​裝​完​後​，我​們​需​要​初​始​化​資​料​庫​，可​以​透​過​以​下​指​令​完​成​：
		</div><pre class="screen"><code class="prompt"># </code><strong class="userinput"><code><code class="command">cloud-setup-databases</code> cloud:<em class="replaceable"><code>password</code></em>@localhost --deploy-as=root</code></strong></pre><div class="para">
			當​初​始​化​過​程​完​成​後​，您​將​會​看​到​類​似​訊​息​"CloudStack has successfully initialized the database."
		</div><div class="para">
			資​料​庫​建​立​後​，最​後​一​個​步​驟​是​設​定​management server，請​執​行​以​下​指​令​：
		</div><pre class="screen"><code class="prompt"># </code><strong class="userinput"><code><code class="command">cloud-setup-management</code></code></strong></pre></div><div class="section" id="sect-qig-Management-templatesetup"><div class="titlepage"><div><div><h2 class="title">3.3. 設​定​系​統​模​板​</h2></div></div></div><div class="para">
			CloudStack透​過​一​系​列​的​系​統​虛​擬​機​提​供​許​多​的​功​能​，例​如​：遠​端​登​入​虛​擬​機​、​提​供​各​式​的​網​路​服​務​、​以​及​管​理​次​存​儲​中​的​各​種​資​源​。​在​此​步​驟​中​，您​將​會​了​解​如​何​取​得​system VM模​板​ ，並​用​於​佈​署​之​後​的​虛​擬​機​
		</div><div class="para">
			接​著​，需​要​下​載​system VM 模​板​，並​將​這​些​模​板​佈​署​於​剛​才​建​立​的​secondary storage中​；管​理​伺​服​器​中​包​含​一​個​腳​本​可​以​正​確​的​導​入​system VM模​板​ ：
		</div><pre class="screen"><code class="prompt"># </code><strong class="userinput"><code><code class="command">/usr/lib64/cloud/common/scripts/storage/secondary/cloud-install-sys-tmplt</code> -m /secondary -u http://download.cloud.com/templates/acton/acton-systemvm-02062012.qcow2.bz2 -h kvm -F</code></strong>
</pre><div class="para">
			以​上​是​management server的​安​裝​及​設​定​過​程​；我​們​仍​然​需​要​設​定​CloudStack，但​在​之​前​，我​們​必​須​啟​用​hypervisor
		</div></div></div><div xml:lang="zh-TW" class="chapter" id="chap-qig-KVM" lang="zh-TW"><div class="titlepage"><div><div><h1 class="title">章 4. 安​裝​及​設​定​KVM</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="#sect-qig-KVM-Prerequisites">4.1. 事​前​準​備​</a></span></dt><dt><span class="section"><a href="#sect-qig-KVM-Installation">4.2. 安​裝​</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-qig-KVM-Configuration">4.2.1. 設​定​KVM</a></span></dt></dl></dd></dl></div><div class="para">
		本​文​件​描​述​的​佈​署​環​境​使​用​KVM做​為​Hypervisor，後​續​，本​文​將​回​顧​如​何​設​定​Hypervisor主​機​，其​中​大​部​份​工​作​在​設​定​Hypervisor主​機​時​完​成​，然​後​描​述​如​何​安​裝​Agent for KVM Hypervisor。​之​後​您​可​以​應​用​相​同​的​步​驟​新​增​KVM Hypervisor進​入​CloudStack中​
	</div><div class="section" id="sect-qig-KVM-Prerequisites"><div class="titlepage"><div><div><h2 class="title">4.1. 事​前​準​備​</h2></div></div></div><div class="para">
			本​文​描​述​的​環​境​中​，管​理​伺​服​器​同​時​做​為​計​算​資​源​的​節​點​(Compute Node)，這​也​意​謂​著​很​多​前​置​步​驟​已​經​在​架​設​管​理​伺​服​器​時​完​成​，但​為​了​，清​晰​起​見​，這​邊​仍​列​出​相​關​步​驟​：
			<div class="orderedlist"><ol><li class="listitem"><div class="para">
						<a class="xref" href="#sect-qig-Environment-operatingsys-network">節 2.1.1, “設​定​網​路​”</a>
					</div></li><li class="listitem"><div class="para">
						<a class="xref" href="#sect-qig-Environment-operatingsys-hostname">節 2.1.2, “主​機​名​稱​”</a>
					</div></li><li class="listitem"><div class="para">
						<a class="xref" href="#sect-qig-Environment-operatingsys-selinux">節 2.1.3, “SELinux”</a>
					</div></li><li class="listitem"><div class="para">
						<a class="xref" href="#sect-qig-Environment-operatingsys-ntp">節 2.1.4, “NTP”</a>
					</div></li><li class="listitem"><div class="para">
						<a class="xref" href="#sect-qig-Environment-operatingsys-repoconfig">節 2.1.5, “設​定​CloudStack的​套​件​庫​”</a>
					</div></li></ol></div>

		</div><div class="para">
			您​將​不​需​要​於​管​理​伺​服​器​上​再​次​執​行​這​些​步​驟​；當​然​，如​果​您​需​要​添​加​額​外​的​主​機​，仍​須​完​成​上​述​步​驟​：
		</div></div><div class="section" id="sect-qig-KVM-Installation"><div class="titlepage"><div><div><h2 class="title">4.2. 安​裝​</h2></div></div></div><div class="para">
			安​裝​KVM的​agent相​當​簡​單​，只​需​要​下​達​單​一​指​令​即​可​，之​後​我​們​必​須​做​一​些​設​定​
		</div><pre class="screen"><code class="prompt"># </code><strong class="userinput"><code><code class="command">yum</code> -y install cloud-agent</code></strong></pre><div class="section" id="sect-qig-KVM-Configuration"><div class="titlepage"><div><div><h3 class="title">4.2.1. 設​定​KVM</h3></div></div></div><div class="para">
				我​們​必​須​設​定​KVM的​libvirt以​及​QEMU兩​個​部​分​
			</div><div class="section" id="sect-qig-KVM-Configuration-qemu"><div class="titlepage"><div><div><h4 class="title">4.2.1.1. QEMU設​定​</h4></div></div></div><div class="para">
					KVM的​設​定​相​當​簡​易​，只​需​修​改​一​項​設​定​；編​輯​QEMU VNC的​設​定​文​件​<code class="filename">/etc/libvirt/qemu.conf</code>並​確​保​以​下​內​容​存​在​起​並​沒​有​被​註​解​
<pre class="screen">vnc_listen=0.0.0.0</pre>

				</div></div><div class="section" id="sect-qig-KVM-Configuration-libvirt"><div class="titlepage"><div><div><h4 class="title">4.2.1.2. Libvirt設​定​</h4></div></div></div><div class="para">
					CloudStack使​用​libvirt管​理​虛​擬​機​，因​此​libvirt必​須​設​定​正​確​。​Libvirt是​cloud-agent所​相​依​的​套​件​並​應​該​已​安​裝​
				</div><div class="orderedlist"><ol><li class="listitem"><div class="para">
							為​了​具​備​live migration的​能​力​ ,libviry必​須​傾​聽​不​安​全​的​TCP連​線​，我​們​也​必​須​關​閉​libvirt的​多​重​DNS廣​播​，這​些​設​定​均​在​<code class="filename">/etc/libvirt/libvirtd.conf</code>檔​案​中​可​以​找​到​
						</div><div class="para">
							設​定​以​下​參​數​
						</div><pre class="programlisting">listen_tls = 0</pre><pre class="programlisting">listen_tcp = 1</pre><pre class="programlisting">tcp_port = "16059"</pre><pre class="programlisting">auth_tcp = "none"</pre><pre class="programlisting">mdns_adv = 0</pre></li><li class="listitem"><div class="para">
							於​libvirtd.conf中​開​啟​"listen_tcp"是​不​夠​的​，我​們​仍​必​須​修​改​以​下​參​數​
						</div><div class="para">
							於​RHEL/CentOS 請​修​改​ <code class="filename">/etc/sysconfig/libvirtd</code>:
						</div><div class="para">
							取​消​下​列​程​式​碼​註​解​
						</div><pre class="programlisting">#LIBVIRTD_ARGS="--listen"</pre><div class="para">
							於​Ubuntu請​修​改​ <code class="filename">/etc/init/libvirt-bin.conf</code>
						</div><div class="para">
							修​改​以​下​數​行​(檔​案​尾​端​)
						</div><pre class="programlisting">exec /usr/sbin/libvirtd -d</pre><div class="para">
							為​(添​加​-l參​數​)
						</div><pre class="programlisting">exec /usr/sbin/libvirtd -d -l</pre></li><li class="listitem"><div class="para">
							重​新​啟​動​libvirt
						</div><div class="para">
							於​RHEL/CentOS
						</div><pre class="programlisting"><code class="command">$ service libvirtd restart</code></pre><div class="para">
							於​Ubuntu
						</div><pre class="programlisting"><code class="command">$ service libvirt-bin restart</code></pre></li></ol></div></div><div class="section" id="sect-qig-KVM-Configuration-finish"><div class="titlepage"><div><div><h4 class="title">4.2.1.3. KVM設​定​完​畢​</h4></div></div></div><div class="para">
					以​上​內​容​是​KVM的​安​裝​及​設​定​，下​面​將​介​紹​如​何​使​用​CloudStack使​用​者​介​面​設​定​整​個​雲​端​平​台​。​
				</div></div></div></div></div><div xml:lang="zh-TW" class="chapter" id="chap-qig-Config" lang="zh-TW"><div class="titlepage"><div><div><h1 class="title">章 5. 系​統​設​定​</h1></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="#sect-qig-Config-UI_Access">5.1. 使​用​UI</a></span></dt><dt><span class="section"><a href="#sect-qig-Config-Zone">5.2. 設​定​zone</a></span></dt><dt><span class="section"><a href="#sect-qig-Config-Pod">5.3. 設​定​pod</a></span></dt><dt><span class="section"><a href="#Runbook-config-cluster">5.4. 設​定​cluster</a></span></dt><dd><dl><dt><span class="section"><a href="#Runbook-config-cluster-pristorage">5.4.1. 設​定​Primary Storage</a></span></dt><dt><span class="section"><a href="#Runbook-config-cluster-secstorage">5.4.2. 設​定​Secondary Storage</a></span></dt></dl></dd></dl></div><div class="para">
		如​上​述​，本​手​冊​所​描​述​的​環​境​將​使​用​security groups提​供​網​路​隔​離​的​機​制​，因​此​您​的​安​裝​環​境​需​要​一​個​layer-2網​路​，這​也​意​味​著​提​供​了​較​為​簡​易​的​設​定​和​快​速​安​裝​
	</div><div class="section" id="sect-qig-Config-UI_Access"><div class="titlepage"><div><div><h2 class="title">5.1. 使​用​UI</h2></div></div></div><div class="para">
			訪​問​CloudStack的​UI，僅​需​使​用​瀏​覽​器​逕​行​訪​問​：http://<em class="replaceable"><code>172.16.10.</code></em>2:8080/client預​設​的​使​用​者​帳​號​為​"admin"，而​預​設​密​碼​為​"password"。​第​一​次​登​入​後​可​以​看​到​歡​迎​畫​面​，且​提​供​了​兩​個​設​定​CloudStack的​選​項​，請​選​擇​"繼​續​執​行​基​本​安​裝​"
		</div><div class="para">
			此​時​您​會​被​要​求​修​改​admin帳​號​的​密​碼​，請​更​新​後​繼​續​下​一​個​步​驟​
		</div></div><div class="section" id="sect-qig-Config-Zone"><div class="titlepage"><div><div><h2 class="title">5.2. 設​定​zone</h2></div></div></div><div class="para">
			zone是​CloudStack中​最​大​的​運​行​單​位​，下​面​將​會​繼​續​描​述​如​何​建​立​一​個​zone；此​時​螢​幕​顯​示​的​是​新​增​zone的​頁​面​，這​裡​需​要​您​提​供​以​下​資​訊​：
			<div class="orderedlist"><ol><li class="listitem"><div class="para">
						名​稱​ - 提​通​描​述​性​的​名​稱​，這​裡​以​"Zone1"為​例​
					</div></li><li class="listitem"><div class="para">
						DNS1 - 設​定​為​8.8.8.8
					</div></li><li class="listitem"><div class="para">
						DNS2 - 設​定​為​8.8.4.4
					</div></li><li class="listitem"><div class="para">
						內​部​DNS1 - 設​定​為​8.8.8.8
					</div></li><li class="listitem"><div class="para">
						內​部​DNS2 - 設​定​為​8.8.4.4
					</div></li></ol></div>

		</div><div class="note"><div class="admonition_header"><h2>關​於​DNS設​定​</h2></div><div class="admonition"><div class="para">
				CloudStack將​DNS設​定​分​為​內​部​及​外​部​。​內​部​DNS用​於​解​析​內​部​主​機​名​稱​，例​如​：NFS伺​服​器​的​主​機​名​稱​；外​部​DNS則​用​於​提​供​客​戶​虛​擬​機​外​網​的​IP位​址​解​析​。​您​可​以​為​上​述​兩​種​類​型​輸​入​相​同​的​DNS，但​必​須​確​認​內​部​和​外​網​的​IP位​址​都​存​在​到​達​該​DNS伺​服​器​的​路​由​。​本​手​冊​描​述​的​環​境​中​，內​部​資​源​不​只​用​主​機​名​稱​，因​此​這​裡​將​其​設​定​為​和​外​部​DNS一​致​以​簡​化​安​裝​流​程​，不​需​再​為​此​安​裝​一​台​DNS伺​服​器​。​
			</div></div></div></div><div class="section" id="sect-qig-Config-Pod"><div class="titlepage"><div><div><h2 class="title">5.3. 設​定​pod</h2></div></div></div><div class="para">
			到​這​裡​，您​已​新​增​了​一​個​zone，下​一​步​驟​會​提​示​您​設​定​pod的​相​關​資​訊​
			<div class="orderedlist"><ol><li class="listitem"><div class="para">
						名​稱​ - 這​裡​以​"Pod1"為​例​
					</div></li><li class="listitem"><div class="para">
						Gateway - 輸​入​<em class="replaceable"><code>172.16.10</code></em>.1
					</div></li><li class="listitem"><div class="para">
						Netmask - 輸​入​255.255.255.0
					</div></li><li class="listitem"><div class="para">
						IP範​圍​ - 輸​入​172.16.10.10 - 172.16.10.20
					</div></li><li class="listitem"><div class="para">
						Guest gateway - 使​用​<em class="replaceable"><code>172.16.10</code></em>.1
					</div></li><li class="listitem"><div class="para">
						Guest netmask - 輸​入​255.255.255.0
					</div></li><li class="listitem"><div class="para">
						Guest IP範​圍​ - 輸​入​<em class="replaceable"><code>172.16.10.</code></em>30-<em class="replaceable"><code>172.16.10.</code></em>200
					</div></li></ol></div>

		</div></div><div class="section" id="Runbook-config-cluster"><div class="titlepage"><div><div><h2 class="title">5.4. 設​定​cluster</h2></div></div></div><div class="para">
			於​新​增​zone和​pod之​後​，僅​需​以​下​資​訊​設​定​cluster：
			<div class="orderedlist"><ol><li class="listitem"><div class="para">
						名​稱​ - 這​裡​使​用​"Cluster1"為​例​
					</div></li><li class="listitem"><div class="para">
						Hypervisor - 選​擇​KVM
					</div></li></ol></div>

		</div><div class="para">
			此​時​，系​統​會​提​示​您​為​cluster新​增​第​一​台​主​機​，您​需​要​輸​入​以​下​資​訊​：
			<div class="orderedlist"><ol><li class="listitem"><div class="para">
						主​機​名​稱​ - 由​於​沒​有​設​定​內​部​DNS伺​服​器​，這​邊​我​們​使​用​IP位​址​<em class="replaceable"><code>172.16.10.</code></em>2
					</div></li><li class="listitem"><div class="para">
						用​戶​帳​號​ - root
					</div></li><li class="listitem"><div class="para">
						用​戶​密​碼​ - root用​戶​之​密​碼​
					</div></li></ol></div>

		</div><div class="section" id="Runbook-config-cluster-pristorage"><div class="titlepage"><div><div><h3 class="title">5.4.1. 設​定​Primary Storage</h3></div></div></div><div class="para">
				根​據​您​目​前​的​cluster設​定​，系​統​會​提​示​您​輸​入​primary storage的​資​訊​。​Storage type請​選​擇​NFS，並​輸​入​其​餘​相​關​資​訊​
				<div class="orderedlist"><ol><li class="listitem"><div class="para">
							名​稱​ - 輸​入​"Primary1"
						</div></li><li class="listitem"><div class="para">
							名​稱​ - 這​裡​輸​入​伺​服​器​的​IP位​址​<em class="replaceable"><code>172.16.10.</code></em>2
						</div></li><li class="listitem"><div class="para">
							Path - 輸​入​/primary
						</div></li></ol></div>

			</div></div><div class="section" id="Runbook-config-cluster-secstorage"><div class="titlepage"><div><div><h3 class="title">5.4.2. 設​定​Secondary Storage</h3></div></div></div><div class="para">
				如​果​添​加​的​是​一​個​全​新​的​zone，您​需​要​提​供​secondary storage的​相​關​資​訊​
				<div class="orderedlist"><ol><li class="listitem"><div class="para">
							NFS伺​服​器​ - 輸​入​IP位​址​<em class="replaceable"><code>172.16.10.</code></em>2
						</div></li><li class="listitem"><div class="para">
							Path - 輸​入​/secondary
						</div></li></ol></div>

			</div><div class="para">
				現​在​，點​選​"啟​動​"然​後​您​的​雲​端​平​台​系​統​將​開​始​逕​行​設​定​，設​定​過​程​可​能​會​需​要​幾​分​鐘​的​時​間​，會​根​據​您​的​實​際​的​網​路​速​度​而​有​所​不​同​
			</div></div></div></div><div xml:lang="zh-TW" class="appendix" id="appe-qig-Revision_History" lang="zh-TW"><div class="titlepage"><div><div><h1 class="title">修​訂​記​錄​</h1></div></div></div><div class="para">
		<div class="revhistory"><table summary="修訂記錄"><tr><th align="left" valign="top" colspan="3"><strong>修訂記錄</strong></th></tr><tr><td align="left">修訂 1-0</td><td align="left">Fri Feb 1 2013</td><td align="left"> </td></tr><tr><td align="left" colspan="3">
					<table border="0" summary="Simple list" class="simplelist"><tr><td>升​級​為​Apache CloudStack 4.0.1</td></tr></table>

				</td></tr><tr><td align="left">修訂 0-0</td><td align="left">Mon Jun 25 2012</td><td align="left"> </td></tr><tr><td align="left" colspan="3">
					<table border="0" summary="Simple list" class="simplelist"><tr><td>初​版​</td></tr></table>

				</td></tr></table></div>

	</div></div></div></body></html>
