<?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>Quick Install Guide</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-CN-0-0" /><meta name="description" content="This guide is designed to provide a strict environment to guarantee a higher degree of success in initial deployments of Apache CloudStack. All of the elements of the environment will be provided to you. Apache CloudStack is capable of much more complex configurations, but they are beyond the scope of this document." /><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-CN" class="book" id="idm62693392" lang="zh-CN"><div class="titlepage"><div><div class="producttitle"><span class="productname">Apache CloudStack</span> <span class="productnumber">4.0.2</span></div><div><h1 id="idm62693392" class="title">Quick Install Guide</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-CN" class="authorgroup" lang="zh-CN"><div class="author"><h3 class="author"><span class="firstname">Apache</span> <span class="surname">CloudStack</span></h3></div></div></div><hr /><div><div id="idm69112032" 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">
			This guide is designed to provide a strict environment to guarantee a higher degree of success in initial deployments of Apache CloudStack. All of the elements of the environment will be provided to you. Apache CloudStack is capable of much more complex configurations, but they are beyond the scope of this document.
		</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="#idm4787024">1. 文​​​档​​​约​​​定​​​</a></span></dt><dd><dl><dt><span class="section"><a href="#idm67955552">1.1. 排​​​版​​​约​​​定​​​</a></span></dt><dt><span class="section"><a href="#idm69224288">1.2. 抬​​​升​​​式​​​引​​​用​​​约​​​定​​​</a></span></dt><dt><span class="section"><a href="#idm67894384">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. Configuring the CloudStack Package Repository</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. 安​装​管​理​服​务​器​</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. 访​问​用​户​界​面​</a></span></dt><dt><span class="section"><a href="#sect-qig-Config-Zone">5.2. 配​置​区​域​</a></span></dt><dt><span class="section"><a href="#sect-qig-Config-Pod">5.3. 配​置​提​供​点​</a></span></dt><dt><span class="section"><a href="#Runbook-config-cluster">5.4. 集​群​</a></span></dt><dd><dl><dt><span class="section"><a href="#Runbook-config-cluster-pristorage">5.4.1. 主​存​储​</a></span></dt><dt><span class="section"><a href="#Runbook-config-cluster-secstorage">5.4.2. 次​要​存​储​</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-CN" class="preface" id="pref-qig-Preface" lang="zh-CN"><div class="titlepage"><div><div><h1 class="title">前​言​</h1></div></div></div><div xml:lang="zh-CN" class="section" id="idm4787024" lang="zh-CN"><div class="titlepage"><div><div><h2 class="title" id="idm4787024">1. 文​​​档​​​约​​​定​​​</h2></div></div></div><div class="para">
		本​​​手​​​册​​​使​​​用​​​几​​​个​​​约​​​定​​​来​​​突​​​出​​​某​​​些​​​用​​​词​​​和​​​短​​​语​​​以​​​及​​​信​​​息​​​的​​​某​​​些​​​片​​​段​​​。​​​
	</div><div class="para">
		在​​​ PDF 版​​​本​​​以​​​及​​​纸​​​版​​​中​​​，本​​​手​​​册​​​使​​​用​​​在​​​ <a href="https://fedorahosted.org/liberation-fonts/">Liberation 字​​​体​​​</a>套​​​件​​​中​​​选​​​出​​​的​​​字​​​体​​​。​​​如​​​果​​​您​​​在​​​您​​​的​​​系​​​统​​​中​​​安​​​装​​​了​​​ Liberation 字​​​体​​​套​​​件​​​，它​​​还​​​可​​​用​​​于​​​ HTML 版​​​本​​​。​​​如​​​果​​​没​​​有​​​安​​​装​​​，则​​​会​​​显​​​示​​​可​​​替​​​换​​​的​​​类​​​似​​​字​​​体​​​。​​​请​​​注​​​意​​​：红​​​帽​​​企​​​业​​​ Linux 5 以​​​及​​​其​​​后​​​的​​​版​​​本​​​默​​​认​​​包​​​含​​​ Liberation 字​​​体​​​套​​​件​​​。​​​
	</div><div class="section" id="idm67955552"><div class="titlepage"><div><div><h3 class="title" id="idm67955552">1.1. 排​​​版​​​约​​​定​​​</h3></div></div></div><div class="para">
			我​​​们​​​使​​​用​​​四​​​种​​​排​​​版​​​约​​​定​​​突​​​出​​​特​​​定​​​用​​​词​​​和​​​短​​​语​​​。​​​这​​​些​​​约​​​定​​​及​​​其​​​使​​​用​​​环​​​境​​​如​​​下​​​。​​​
		</div><div class="para">
			<code class="literal">单​​​行​​​粗​​​体​​​</code>
		</div><div class="para">
			用​​​来​​​突​​​出​​​系​​​统​​​输​​​入​​​，其​​​中​​​包​​​括​​​ shell 命​​​令​​​、​​​文​​​件​​​名​​​以​​​及​​​路​​​径​​​。​​​还​​​可​​​用​​​来​​​突​​​出​​​按​​​键​​​以​​​及​​​组​​​合​​​键​​​。​​​例​​​如​​​：
		</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 命​​​令​​​以​​​及​​​一​​​个​​​按​​​键​​​，它​​​们​​​都​​​以​​​固​​​定​​​粗​​​体​​​形​​​式​​​出​​​现​​​，且​​​全​​​部​​​与​​​上​​​下​​​文​​​有​​​所​​​区​​​别​​​。​​​
		</div><div class="para">
			组​​​合​​​键​​​可​​​通​​​过​​​使​​​用​​​连​​​字​​​符​​​连​​​接​​​组​​​合​​​键​​​的​​​每​​​个​​​部​​​分​​​来​​​与​​​按​​​键​​​区​​​别​​​。​​​例​​​如​​​：
		</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 会​​​话​​​。​​​
			</div></blockquote></div><div class="para">
			第​​​一​​​段​​​突​​​出​​​的​​​是​​​要​​​按​​​的​​​特​​​定​​​按​​​键​​​。​​​第​​​二​​​段​​​突​​​出​​​了​​​两​​​个​​​按​​​键​​​组​​​合​​​（每​​​个​​​组​​​合​​​都​​​要​​​同​​​时​​​按​​​）。​​​下​​​。​​​
		</div><div class="para">
			如​​​果​​​讨​​​论​​​的​​​是​​​源​​​码​​​、​​​等​​​级​​​名​​​称​​​、​​​方​​​法​​​、​​​功​​​能​​​、​​​变​​​量​​​名​​​称​​​以​​​及​​​在​​​段​​​落​​​中​​​提​​​到​​​的​​​返​​​回​​​的​​​数​​​值​​​，那​​​么​​​都​​​会​​​以​​​上​​​述​​​形​​​式​​​出​​​现​​​，即​​​<code class="literal">固​​​定​​​粗​​​体​​​</code>。​​​例​​​如​​​：
		</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
				与​​​文​​​件​​​相​​​关​​​的​​​等​​​级​​​包​​​括​​​用​​​于​​​文​​​件​​​系​​​统​​​的​​​ <code class="classname">filesystem</code>、​​​用​​​于​​​文​​​件​​​的​​​ <code class="classname">file</code> 以​​​及​​​用​​​于​​​目​​​录​​​的​​​ <code class="classname">dir</code>。​​​每​​​个​​​等​​​级​​​都​​​有​​​其​​​自​​​身​​​相​​​关​​​的​​​权​​​限​​​。​​​
			</div></blockquote></div><div class="para">
			<span class="application"><strong>比​​​例​​​粗​​​体​​​</strong></span>
		</div><div class="para">
			这​​​是​​​指​​​在​​​系​​​统​​​中​​​遇​​​到​​​的​​​文​​​字​​​或​​​者​​​短​​​语​​​，其​​​中​​​包​​​括​​​应​​​用​​​程​​​序​​​名​​​称​​​、​​​对​​​话​​​框​​​文​​​本​​​、​​​标​​​记​​​的​​​按​​​钮​​​、​​​复​​​选​​​框​​​以​​​及​​​单​​​选​​​按​​​钮​​​标​​​签​​​、​​​菜​​​单​​​标​​​题​​​以​​​及​​​子​​​菜​​​单​​​标​​​题​​​。​​​例​​​如​​​：
		</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>固​​​定​​​粗​​​斜​​​体​​​</code></em></code> 或​​​者​​​ <span class="application"><strong><em class="replaceable"><code>比​​​例​​​粗​​​斜​​​体​​​ </code></em></strong></span>
		</div><div class="para">
			无​​​论​​​固​​​定​​​粗​​​体​​​或​​​者​​​比​​​例​​​粗​​​体​​​，附​​​加​​​的​​​斜​​​体​​​表​​​示​​​是​​​可​​​替​​​换​​​或​​​者​​​变​​​量​​​文​​​本​​​。​​​斜​​​体​​​表​​​示​​​那​​​些​​​不​​​直​​​接​​​输​​​入​​​的​​​文​​​本​​​或​​​者​​​那​​​些​​​根​​​据​​​环​​​境​​​改​​​变​​​的​​​文​​​本​​​。​​​例​​​如​​​：
		</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
				要​​​使​​​用​​​ ssh 连​​​接​​​到​​​远​​​程​​​机​​​器​​​，请​​​在​​​ shell 提​​​示​​​符​​​后​​​输​​​入​​​ <code class="command">ssh <em class="replaceable"><code>username</code></em>@<em class="replaceable"><code>domain.name</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>file-system</code></em></code> 命​​​令​​​会​​​重​​​新​​​挂​​​载​​​命​​​名​​​的​​​文​​​件​​​系​​​统​​​。​​​例​​​如​​​：要​​​重​​​新​​​挂​​​载​​​ <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>package</code></em></code> 命​​​令​​​。​​​它​​​会​​​返​​​回​​​以​​​下​​​结​​​果​​​：<code class="command"><em class="replaceable"><code>package-version-release</code></em></code>。​​​
			</div></blockquote></div><div class="para">
			请​​​注​​​意​​​以​​​上​​​文​​​字​​​中​​​的​​​粗​​​斜​​​体​​​字​​​ — username、​​​domain.name、​​​file-system、​​​package、​​​version 和​​​ release。​​​无​​​论​​​您​​​输​​​入​​​文​​​本​​​或​​​者​​​运​​​行​​​一​​​个​​​命​​​令​​​，还​​​是​​​该​​​系​​​统​​​显​​​示​​​的​​​文​​​本​​​，每​​​个​​​字​​​都​​​是​​​一​​​个​​​占​​​位​​​符​​​。​​​
		</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="idm69224288"><div class="titlepage"><div><div><h3 class="title" id="idm69224288">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="idm67894384"><div class="titlepage"><div><div><h3 class="title" id="idm67894384">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">
				重​​​要​​​框​​​中​​​的​​​内​​​容​​​是​​​那​​​些​​​容​​​易​​​错​​​过​​​的​​​事​​​情​​​：配​​​置​​​更​​​改​​​只​​​可​​​用​​​于​​​当​​​前​​​会​​​话​​​，或​​​者​​​在​​​应​​​用​​​更​​​新​​​前​​​要​​​重​​​启​​​的​​​服​​​务​​​。​​​忽​​​略​​​‘​​​重​​​要​​​’​​​框​​​中​​​的​​​内​​​容​​​不​​​会​​​造​​​成​​​数​​​据​​​丢​​​失​​​但​​​可​​​能​​​会​​​让​​​您​​​抓​​​狂​​​。​​​
			</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-CN" class="section" id="feedback" lang="zh-CN"><div class="titlepage"><div><div><h2 class="title">2. Submitting Feedback and Getting Help</h2></div></div></div><a id="idm64199760" 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-CN" class="chapter" id="chap-qig-Overview" lang="zh-CN"><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)云​平​台​是​一​件​复​杂​的​工​作​，它​提​供​了​过​于​多​的​选​项​，以​至​于​甚​至​是​经​验​丰​富​的​管​理​员​在​刚​开​始​搭​建​云​平​台​时​也​会​感​到​困​惑​。​该​操​作​手​册​的​目​标​是​提​供​一​系​列​直​观​的​说​明​以​帮​助​您​搭​建​并​运​行​一​个​最​简​单​的​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">
			This runbook will focus on building a CloudStack cloud using KVM with CentOS 6.3 with NFS storage on a flat layer-2 network utilizing layer-3 network isolation (aka Security Groups), and doing it all on a single piece of hardware.
		</div><div class="para">
			KVM (Kernel-based Virtual Machine) 是​一​种​针​对​LInux内​核​的​虚​拟​化​技​术​。​KVM支​持​本​地​虚​拟​化​，主​机​的​CPU处​理​器​需​支​持​硬​件​虚​拟​化​扩​展​。​
		</div><div class="para">
			安​全​组​起​到​类​似​分​布​式​防​火​墙​的​作​用​，它​可​以​对​一​组​虚​拟​机​进​行​访​问​控​制​。​
		</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服​务​器​用​于​提​供​各​类​存​储​资​源​。​接​下​来​的​步​骤​是​安​装​管​理​服​务​器​，下​载​系​统​虚​拟​机​模​板​，安​装​agnet；最​后​将​描​述​如​何​使​用​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">
						The <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">
						A /24 network with the gateway being at xxx.xxx.xxx.1, no DHCP should be on this network and none of the computers running CloudStack will have a dynamic address. Again this is done for the sake of simplicity.
					</div></li></ol></div>

		</div></div></div><div xml:lang="zh-CN" class="chapter" id="chap-qig-Environment" lang="zh-CN"><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. Configuring the CloudStack Package Repository</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">
		在​开​始​安​装​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">
			Using the CentOS 6.3 x86_64 minimal install ISO, you'll need to install CentOS on your hardware. The defaults will generally be acceptable for this installation.
		</div><div class="para">
			当​安​装​完​成​后​，需​要​以​root身​份​通​过​SSH连​接​新​安​装​的​主​机​，注​意​不​要​以​root账​户​登​录​生​产​环​境​，请​在​完​成​安​装​和​配​置​后​关​闭​远​程​登​录​。​
		</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地​址​，该​地​址​每​个​网​卡​唯​一​，请​保​留​您​配​置​文​件​中​HWADDR段​已​提​供​的​内​容​。​
				</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">
					本​文​档​假​定​您​提​供​一​个​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">
				为​了​纠​正​这​个​问​题​，需​设​置​主​机​名​，通​过​编​辑​<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，然​后​进​行​配​置​。​通​过​以​下​命​令​进​行​安​装​：
			</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. Configuring the CloudStack Package Repository</h3></div></div></div><div class="para">
				We need to configure the machine to use a CloudStack package repository. 
				<div class="important"><div class="admonition_header"><h2>The below repository is not an official Apache CloudStack project repository</h2></div><div class="admonition"><div class="para">
						The Apache CloudStack official releases are source code. As such there are no 'official' binaries available. The full installation guide describes how to take the source release and generate RPMs and and yum repository. This guide attempts to keep things as simple as possible, and thus we are using one of the community-provided yum repositories.
					</div></div></div>

			</div><div class="para">
				To add the CloudStack repository, create <code class="filename">/etc/yum.repos.d/cloudstack.repo</code> and insert the following information.
			</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">
/secondary *(rw,async,no_root_squash)
/primary   *(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">
			最​后​需​要​配​置​NFS服​务​为​开​机​自​启​动​：
		</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-CN" class="chapter" id="chap-qig-Management" lang="zh-CN"><div class="titlepage"><div><div><h1 class="title">第 3 章 安​装​管​理​服​务​器​</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管​理​服​务​器​和​相​关​的​组​件​。​
	</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">
			We are now going to install the management server. We do that by executing the following command: 
<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">
			平​台​系​统​本​身​安​装​后​，需​初​始​化​数​据​库​，通​过​以​下​命​令​和​选​项​完​成​：
		</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">
			数​据​库​创​建​后​，最​后​一​步​是​配​置​管​理​服​务​器​，通​过​如​下​命​令​执​行​：
		</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通​过​一​系​列​系​统​虚​拟​机​提​供​功​能​，如​访​问​虚​拟​机​控​制​台​，如​提​供​各​类​网​络​服​务​，以​及​管​理​次​要​存​储​的​中​的​各​类​资​源​。​该​步​骤​会​获​取​系​统​虚​拟​机​模​板​，用​于​云​平​台​引​导​后​系​统​虚​拟​机​的​部​署​。​
		</div><div class="para">
			然​后​需​要​下​载​系​统​虚​拟​机​模​板​，并​把​这​些​模​板​部​署​于​刚​才​创​建​的​次​要​存​储​中​；管​理​服​务​器​包​含​一​个​脚​本​可​以​正​确​的​操​作​系​统​虚​拟​机​模​板​：
		</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">
			以​上​是​管​理​服​务​器​的​安​装​和​配​置​过​程​；在​配​置​CloudStack之​前​，需​启​用​hypervisor
		</div></div></div><div xml:lang="zh-CN" class="chapter" id="chap-qig-KVM" lang="zh-CN"><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主​机​，其​中​大​部​分​配​置​工​作​已​在​配​置​管​理​节​点​时​完​成​；接​下​来​描​述​如​何​安​装​agent。​您​可​以​应​用​相​同​的​步​骤​添​加​额​外​的​KVM节​点​到​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">
			本​文​档​描​述​的​环​境​使​用​管​理​服​务​器​同​时​作​为​计​算​节​点​，这​意​味​着​很​多​先​决​步​骤​已​经​在​搭​建​管​理​服​务​器​时​完​成​；但​为​了​清​晰​起​见​，仍​然​列​出​相​关​步​骤​：
			<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 节 “Configuring the CloudStack Package Repository”</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">
			Installation of the KVM agent is trivial with just a single command, but afterwards we'll need to configure a few things.
		</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">
				We have two different parts of KVM to configure, libvirt, and QEMU.
			</div><div class="section" id="sect-qig-KVM-Configuration-qemu"><div class="titlepage"><div><div><h4 class="title">4.2.1.1. QEMU Configuration</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 Configuration</h4></div></div></div><div class="para">
					CloudStack uses libvirt for managing virtual machines. Therefore it is vital that libvirt is configured correctly. Libvirt is a dependency of cloud-agent and should already be installed.
				</div><div class="orderedlist"><ol><li class="listitem"><div class="para">
							In order to have live migration working libvirt has to listen for unsecured TCP connections. We also need to turn off libvirts attempt to use Multicast DNS advertising. Both of these settings are in <code class="filename">/etc/libvirt/libvirtd.conf</code>
						</div><div class="para">
							Set the following paramaters:
						</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">
							Turning on "listen_tcp" in libvirtd.conf is not enough, we have to change the parameters as well:
						</div><div class="para">
							On RHEL or CentOS modify <code class="filename">/etc/sysconfig/libvirtd</code>:
						</div><div class="para">
							Uncomment the following line:
						</div><pre class="programlisting">#LIBVIRTD_ARGS="--listen"</pre><div class="para">
							On Ubuntu: modify <code class="filename">/etc/init/libvirt-bin.conf</code>
						</div><div class="para">
							Change the following line (at the end of the file):
						</div><pre class="programlisting">exec /usr/sbin/libvirtd -d</pre><div class="para">
							to (just add -l)
						</div><pre class="programlisting">exec /usr/sbin/libvirtd -d -l</pre></li><li class="listitem"><div class="para">
							Restart libvirt
						</div><div class="para">
							In RHEL or CentOS:
						</div><pre class="programlisting"><code class="command">$ service libvirtd restart</code></pre><div class="para">
							In 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 configuration complete</h4></div></div></div><div class="para">
					以​上​内​容​是​KVM的​安​装​和​配​置​，下​面​将​介​绍​如​何​使​用​CloudStack用​户​界​面​配​置​云​平​台​。​
				</div></div></div></div></div><div xml:lang="zh-CN" class="chapter" id="chap-qig-Config" lang="zh-CN"><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. 访​问​用​户​界​面​</a></span></dt><dt><span class="section"><a href="#sect-qig-Config-Zone">5.2. 配​置​区​域​</a></span></dt><dt><span class="section"><a href="#sect-qig-Config-Pod">5.3. 配​置​提​供​点​</a></span></dt><dt><span class="section"><a href="#Runbook-config-cluster">5.4. 集​群​</a></span></dt><dd><dl><dt><span class="section"><a href="#Runbook-config-cluster-pristorage">5.4.1. 主​存​储​</a></span></dt><dt><span class="section"><a href="#Runbook-config-cluster-secstorage">5.4.2. 次​要​存​储​</a></span></dt></dl></dd></dl></div><div class="para">
		如​上​文​所​述​，该​手​册​所​描​述​的​环​境​将​使​用​安​全​组​提​供​网​络​隔​离​，这​意​味​着​您​的​安​装​环​境​仅​需​要​一​个​扁​平​的​二​层​网​络​，同​样​意​味​着​较​为​简​单​的​配​置​和​快​速​的​安​装​。​
	</div><div class="section" id="sect-qig-Config-UI_Access"><div class="titlepage"><div><div><h2 class="title">5.1. 访​问​用​户​界​面​</h2></div></div></div><div class="para">
			访​问​CloudStack用​户​界​面​，仅​需​通​过​浏​览​器​访​问​: 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. 配​置​区​域​</h2></div></div></div><div class="para">
			区​域​是​CloudStack平​台​中​最​大​的​组​织​单​位​，下​面​将​会​讲​述​如​何​创​建​一​个​区​域​；此​时​屏​幕​中​显​示​的​是​区​域​添​加​页​面​，这​里​需​要​您​提​供​以​下​5项​信​息​：
			<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. 配​置​提​供​点​</h2></div></div></div><div class="para">
			到​这​里​您​已​经​添​加​了​一​个​区​域​，下​一​步​后​会​显​示​提​供​点​的​相​关​信​息​，以​及​添​加​提​供​点​所​需​信​息​：
			<div class="orderedlist"><ol><li class="listitem"><div class="para">
						名​称​ - 这​里​填​写​“​Pod1”​为​例​
					</div></li><li class="listitem"><div class="para">
						网​关​ - 输​入​ <em class="replaceable"><code>172.16.10</code></em>.1
					</div></li><li class="listitem"><div class="para">
						网​络​掩​码​ - 输​入​ 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">
						用​户​网​关​ - 使​用​ <em class="replaceable"><code>172.16.10</code></em>.1
					</div></li><li class="listitem"><div class="para">
						用​户​掩​码​ - 输​入​ 255.255.255.0
					</div></li><li class="listitem"><div class="para">
						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. 集​群​</h2></div></div></div><div class="para">
			添​加​区​域​和​提​供​点​之​后​，仅​需​提​供​以​下​信​息​以​配​置​集​群​：
			<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">
			此​时​向​导​会​提​示​您​为​集​群​添​加​第​一​台​主​机​，需​提​供​如​下​信​息​：
			<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. 主​存​储​</h3></div></div></div><div class="para">
				With your cluster now setup - you should be prompted for primary storage information. Choose NFS as the storage type and then enter the following values in the fields: 
				<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">
							路​径​ - 输​入​/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. 次​要​存​储​</h3></div></div></div><div class="para">
				如​果​添​加​的​区​域​是​一​个​新​的​区​域​，您​需​提​供​次​要​存​储​相​关​信​息​：
				<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">
							路​径​ - 输​入​ /secondary
						</div></li></ol></div>

			</div><div class="para">
				现​在​，点​击​“​启​动​”​然​后​您​的​云​平​台​将​开​始​配​置​，依​赖​于​您​实​际​的​网​络​速​度​，配​置​过​程​可​能​耗​时​几​分​钟​
			</div></div></div></div><div xml:lang="zh-CN" class="appendix" id="appe-qig-Revision_History" lang="zh-CN"><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>Updating for 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>
