<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.hi-suke.com/styles/feedsky6.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feed.hi-suke.com" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/visionblog" type="application/rss+xml"></fs:self_link><lastBuildDate>Wed, 11 Jan 2012 09:45:31 GMT</lastBuildDate><title>vision's blog</title><description>vision's blog</description><image><url>http://www.feedsky.com/feed/visionblog/sc/gif</url><title>vision's blog</title><link>http://blog.hi-suke.com</link></image><link>http://blog.hi-suke.com</link><id xmlns="http://www.w3.org/2005/Atom">http://blog.hi-suke.com/</id><link xmlns="http://www.w3.org/2005/Atom" href="http://blog.hi-suke.com"></link><link xmlns="http://www.w3.org/2005/Atom" href="http://blog.hi-suke.com/feed" rel="self"></link><author xmlns="http://www.w3.org/2005/Atom"><name>vision4fun</name></author><pubDate>Wed, 11 Jan 2012 09:45:31 GMT</pubDate><managingEditor>vision4fun</managingEditor><item><title>CCIE试验备考之交换Security</title><link>http://blog.hi-suke.com/2012/01/11/switch-Security.html</link><id xmlns="http://www.w3.org/2005/Atom">http://blog.hi-suke.com/entry/switch-Security</id><content xmlns="http://www.w3.org/2005/Atom" type="html">&lt;p&gt;
	&lt;a href=&quot;http://www.nchome.cn/news_view.asp?id=91&quot;&gt;http://www.nchome.cn/news_view.asp?id=91&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
	第一部分 端口安全&lt;/p&gt;
&lt;p&gt;
	端口安全是一种第2层特性，并且能够提供如下5种保护特性：&lt;br /&gt;
	l 基于主机MAC地址允许流量&lt;br /&gt;
	l 基于主机MAC地址限制流量&lt;br /&gt;
	l 在期望的端口上阻塞单播扩散&lt;br /&gt;
	l 避免MAC扩散攻击&lt;br /&gt;
	l 避免MAC欺骗攻击&lt;br /&gt;
	第一. 基于主机的MAC地址允许流量&lt;br /&gt;
	端口安全能够基于主机MAC地址而允许流量。单个端口能够允许一个以上到某个特定数目的MAC地址。根据交换机型号的不同，他们所允许的最大MAC地址数也不相同。这种特性有助于规定每个端口所允许的主机数。例如，通过将用户端口限制到1个学到的MAC地址，而将会议室端口限制到10个MAC地址，将有助于避免网络的非授权访问。&lt;br /&gt;
	通过如下步骤，将可以根据主机MAC地址来允许流量，进而启动端口安全：&lt;br /&gt;
	步骤1：对存在问题的端口启用端口安全&lt;br /&gt;
	步骤2：配置学习主机MAC地址&lt;br /&gt;
	步骤3：指定安全违背行为（默认行为是永久性地关闭端口）&lt;br /&gt;
	步骤4：如果安全违背行为准备关闭端口，就需要配置err-disable计时器，err-disable计时器是一个全局值。&lt;br /&gt;
	配置过程&lt;br /&gt;
	1． 配置每个端口所允许的最大MAC地址数&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置接口模式&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; switchport mode access|trunk&lt;br /&gt;
	注意：一个接口使用默认模式（动态协商）不能启用端口安全&lt;br /&gt;
	4） 设置最大MAC数&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; swtichport port-security maximum 最大值&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; switchport port-security vlan vlan列表 [access|voice]&lt;br /&gt;
	可以设置每个VLAN中允许的最大MAC数，access表示为该vlan是接入vlan，voice表示该vlan是语音vlan&lt;br /&gt;
	2．配置端口允许的MAC地址&lt;br /&gt;
	1） 进入接口模式 interface 接口&lt;br /&gt;
	2） 配置允许的MAC地址&lt;br /&gt;
	手工指定：&lt;br /&gt;
	&amp;nbsp; &amp;nbsp;switchport port-security mac-address mac地址 [vlan vlan号|[access|voice]]&lt;br /&gt;
	动态学习：交换机可以动态学习MAC地址并加入到MAC地址表中，当交换机重新启动后将丢失&lt;br /&gt;
	粘性地址：可以动态学习或手工配置，学习后MAC地址加入到MAC地址表，如果保存配置文件，当交换机重新启动后，交换机不再需要动态学习的那些之前动态学习的地址了&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; switchport port-security mac-address sticky&lt;br /&gt;
	3. 配置安全违背行为&lt;br /&gt;
	1） 进入接口模式 interface 接口&lt;br /&gt;
	2） 配置违规后的动作&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; switchport port-security violation protect|restrict|shutdown&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; protect:保护，当安全MAC地址数量达到了端口所允许的最大MAC地址数的时候，交换机会继续工作，但将把来自新主机的数据帧丢弃，直到删 除足够数量的MAC地址使其低于最大值。&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; Restrict:限制，交换机继续工作，向网络管理站（SNMP）发出一个陷阱trap通告&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; Shutdown:关闭，交换机将永久性或在特定时间周期内err-disable端口，并发送一个SNMP的trap陷阱通告&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; 需要配置关闭模式下的err-disable计时器&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; err-disable recovery cause secure-violation&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; 启用err-disable&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; err-disable recovery interval 计时器&lt;br /&gt;
	案例：&lt;br /&gt;
	Switch(config)# interface gigabitethernet0/1&lt;br /&gt;
	Switch(config-if)# switchport mode access&lt;br /&gt;
	Switch(config-if)# switchport port-security&lt;br /&gt;
	Switch(config-if)# switchport port-security maximum 50&lt;br /&gt;
	Switch(config-if)# switchport port-security mac-address sticky&lt;br /&gt;
	--------------------------------------------------------------------&lt;br /&gt;
	Switch(config)# interface f0/1&lt;br /&gt;
	Switch(config-if)# switchport mode access&lt;br /&gt;
	Switch(config-if)# switchport port-security&lt;br /&gt;
	Switch(config-if)# switchport port-security maximum 1&lt;br /&gt;
	Switch(config-if)# switchport port-security mac-address 0000.0000.0008&lt;br /&gt;
	Switch(config-if)# switchport port-security violation restrict&lt;br /&gt;
	Switch(config)# interface f0/2&lt;br /&gt;
	Switch(config-if)# switchport mode access&lt;br /&gt;
	Switch(config-if)# switchport port-security&lt;br /&gt;
	Switch(config-if)# switchport port-security maximum 1&lt;br /&gt;
	Switch(config-if)# switchport port-security mac-address 0000.0000.0011&lt;br /&gt;
	Switch(config-if)# switchport port-security violation shutdown&lt;br /&gt;
	-----------------------------------------------------------------------&lt;br /&gt;
	案例：&lt;br /&gt;
	Switch(config)#int f0/1&lt;br /&gt;
	Switch(config-if)#switchport port-security&lt;br /&gt;
	Command rejected: Fa0/1 is not an access port. //先启动端口安全会出现错误提示&lt;br /&gt;
	Switch(config-if)#swit mode access&lt;br /&gt;
	Switch(config-if)#switchport port-security //启动端口安全&lt;br /&gt;
	Switch(config-if)#switchport port-security maximum ?&lt;br /&gt;
	&amp;nbsp; &amp;lt;1-132&amp;gt; Maximum addresses&lt;br /&gt;
	Switch(config-if)#do show mac-address-table&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Mac Address Table&lt;br /&gt;
	-------------------------------------------&lt;br /&gt;
	Vlan Mac Address Type Ports&lt;br /&gt;
	---- ----------- -------- -----&lt;br /&gt;
	&amp;nbsp;All 000d.6564.0280 STATIC CPU&lt;br /&gt;
	&amp;nbsp;All 0100.0ccc.cccc STATIC CPU&lt;br /&gt;
	&amp;nbsp;All 0100.0ccc.cccd STATIC CPU&lt;br /&gt;
	&amp;nbsp;All 0100.0cdd.dddd STATIC CPU&lt;br /&gt;
	&amp;nbsp; &amp;nbsp;1 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp; &amp;nbsp;1 0010.7b35.e9b6 DYNAMIC Fa0/1 //这是和路由器相连的地址&lt;br /&gt;
	&amp;nbsp; &amp;nbsp;1 00a1.b003.3cd7 DYNAMIC Fa0/18&lt;br /&gt;
	&amp;nbsp; 10 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp; 20 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp; 30 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp; 40 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp;100 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp;200 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp;201 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp;202 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	Total Mac Addresses for this criterion: 15&lt;br /&gt;
	------------------------------------------------------------------&lt;br /&gt;
	Switch(config-if)#switchport port-security mac-address 0010.7b35.e9b6&lt;br /&gt;
	Switch(config-if)#switchport port-security violation shutdown&lt;br /&gt;
	Switch#show port-security interface f0/1&lt;br /&gt;
	Port Security : Enabled&lt;br /&gt;
	Port Status : Secure-up&lt;br /&gt;
	Violation Mode : Shutdown&lt;br /&gt;
	Aging Time : 0 mins&lt;br /&gt;
	Aging Type : Absolute&lt;br /&gt;
	SecureStatic Address Aging : Disabled&lt;br /&gt;
	Maximum MAC Addresses : 1&lt;br /&gt;
	Total MAC Addresses : 1&lt;br /&gt;
	Configured MAC Addresses : 1&lt;br /&gt;
	Sticky MAC Addresses : 0&lt;br /&gt;
	Last Source Address : 0010.7b35.e9b6&lt;br /&gt;
	Security Violation Count : 1&lt;br /&gt;
	-----------------------------------------------------&lt;br /&gt;
	Switch#show port-security&lt;br /&gt;
	Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (Count) (Count) (Count)&lt;br /&gt;
	---------------------------------------------------------------------------&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; Fa0/1 1 1 0 Shutdown&lt;br /&gt;
	---------------------------------------------------------------------------&lt;br /&gt;
	Total Addresses in System (excluding one mac per port) : 0&lt;br /&gt;
	Max Addresses limit in System (excluding one mac per port) : 1024&lt;br /&gt;
	---------------------------------------------------------------------------&lt;br /&gt;
	Switch#show port-security address&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Secure Mac Address Table&lt;br /&gt;
	-------------------------------------------------------------------&lt;br /&gt;
	Vlan Mac Address Type Ports Remaining Age&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(mins)&lt;br /&gt;
	---- ----------- ---- ----- -------------&lt;br /&gt;
	&amp;nbsp; &amp;nbsp;1 0010.7b35.e9b6 SecureConfigured Fa0/1 -&lt;br /&gt;
	-------------------------------------------------------------------&lt;br /&gt;
	Total Addresses in System (excluding one mac per port) : 0&lt;br /&gt;
	Max Addresses limit in System (excluding one mac per port) : 1024&lt;br /&gt;
	现在我们把mac地址为00a1.b003.3cd7的主机接入到f0/1中，此时会出现如下的信息：&lt;br /&gt;
	00:24:08: %PM-4-ERR_DISABLE: psecure-violation error detected on Fa0/1, putting&lt;br /&gt;
	Fa0/1 in err-disable state&lt;br /&gt;
	00:24:08: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address 00a1.b003.3cd7 on port FastEthernet0/1.&lt;br /&gt;
	00:24:09: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, chang&lt;br /&gt;
	ed state to down&lt;br /&gt;
	00:24:10: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to down&lt;br /&gt;
	-----------------------------------------&lt;br /&gt;
	Switch#show port-security&lt;br /&gt;
	Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (Count) (Count) (Count)&lt;br /&gt;
	---------------------------------------------------------------------------&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; Fa0/1 1 1 1 Shutdown&lt;br /&gt;
	---------------------------------------------------------------------------&lt;br /&gt;
	Total Addresses in System (excluding one mac per port) : 0&lt;br /&gt;
	Max Addresses limit in System (excluding one mac per port) : 1024&lt;br /&gt;
	-------------------------------------------------------------------&lt;br /&gt;
	Switch#show port-security interface f0/1&lt;br /&gt;
	Port Security : Enabled&lt;br /&gt;
	Port Status : Secure-shutdown&lt;br /&gt;
	Violation Mode : Shutdown&lt;br /&gt;
	Aging Time : 0 mins&lt;br /&gt;
	Aging Type : Absolute&lt;br /&gt;
	SecureStatic Address Aging : Disabled&lt;br /&gt;
	Maximum MAC Addresses : 1&lt;br /&gt;
	Total MAC Addresses : 1&lt;br /&gt;
	Configured MAC Addresses : 1&lt;br /&gt;
	Sticky MAC Addresses : 0&lt;br /&gt;
	Last Source Address : 00a1.b003.3cd7&lt;br /&gt;
	Security Violation Count : 1&lt;br /&gt;
	4．配置MAC地址持续时间&lt;br /&gt;
	1） 进入接口模式 interface 接口&lt;br /&gt;
	2） 配置持续时间&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; switchport port-security aging time 时间 type absolute|inactivity&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; absolute模式：当持续时间过后，安全端口上的地址将被绝对删除&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; inactivity模式：在持续时间内，没有使用的端口将被删除&lt;br /&gt;
	案例：&lt;br /&gt;
	Switch(config)# interface gigabitethernet0/1&lt;br /&gt;
	Switch(config-if)# switchport port-security aging time 120&lt;br /&gt;
	-------------------------------------------------------------------------&lt;br /&gt;
	Switch(config-if)# switchport port-security aging time 2&lt;br /&gt;
	Switch(config-if)# switchport port-security aging type inactivity&lt;br /&gt;
	Switch(config-if)# switchport port-security aging static&lt;br /&gt;
	5.验证结果&lt;br /&gt;
	show port-security [interface 接口] address&lt;br /&gt;
	案例：&lt;br /&gt;
	CCIE-LAB(V135)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	At sw1 port 15, there is a host need to be protected. You must config this port to protect it and must use arp command to bind the host&amp;rsquo;s ip address and mac address. Mac addresses 0080.2222.3333 and ip 172.1.1.1/24.&lt;br /&gt;
	配置：&lt;br /&gt;
	SW1&lt;br /&gt;
	interface f0/15&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	siwtchport port-security maximum 1&lt;br /&gt;
	switchport port-security mac-address 0080.2222.3333&lt;br /&gt;
	switchport port-security violation protect&lt;br /&gt;
	arp 172.1.1.1 0080.2222.3333 arpa f0/15&lt;br /&gt;
	CCIE-LAB(V142)&lt;br /&gt;
	题目要求：安全部分&lt;br /&gt;
	SW1的Fa0/12连接外部Public network drop的机器，这台机器的IP ADDRESS=X.X.X.X; MAC=0000.8333.3333，保证没有其他机器可使用这个端口。（考试没给出IP Address，故没必要用arp命令）&lt;br /&gt;
	配置：&lt;br /&gt;
	sw1&lt;br /&gt;
	config termi&lt;br /&gt;
	interface f0/12&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	switchport port-security&lt;br /&gt;
	switchport port-security maximum 1&lt;br /&gt;
	switchport port-security mac-address 0000.8333.3333&lt;br /&gt;
	switchport port-security violation protect&lt;br /&gt;
	no shut&lt;br /&gt;
	CCIE-LAB(V148)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	Configure Sw2-Fa0/2 so that it only accepts traffic from R2. If another host is attached to the port then the traffic should be dropped, but the port should remain enabled.&lt;br /&gt;
	配置：&lt;br /&gt;
	SW2&lt;br /&gt;
	Interface f0/2&lt;br /&gt;
	Switchport mode access&lt;br /&gt;
	Switchport port-security&lt;br /&gt;
	Switchport port-securtiy mac-address R2的mac地址&lt;br /&gt;
	Switchport port-security maximum 1&lt;br /&gt;
	Switchport port-security violation protect&lt;br /&gt;
	CCIE-LAB(yy)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	VLAN_B need tight (high) security, configure the ports in this VLAN to physical address of the routers that are currently attached to them.&lt;br /&gt;
	This configuration should survive the reboot of the switch.&lt;br /&gt;
	Log violations of this policy while allowing correct traffic to proceed.&lt;br /&gt;
	图：&lt;br /&gt;
	&lt;br /&gt;
	VLAN B---VLAN12&lt;br /&gt;
	配置：&lt;br /&gt;
	SW2&lt;br /&gt;
	conf t&lt;br /&gt;
	interface range f0/2,f0/5&lt;br /&gt;
	shut down&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	switchport port-security&lt;br /&gt;
	switchport port-security maximum 1&lt;br /&gt;
	switchport port-security mac-address sticky&lt;br /&gt;
	switchport port-security violation restrict&lt;br /&gt;
	另外解决方案：&lt;br /&gt;
	sw2&lt;br /&gt;
	config terminal&lt;br /&gt;
	show mac-address-table //查看r2和r5的mac地址&lt;br /&gt;
	interface f0/2&lt;br /&gt;
	shut&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	switchport port-security&lt;br /&gt;
	switchport port-security maximum 1&lt;br /&gt;
	switchport port-security mac-address r2的mac地址&lt;br /&gt;
	switchport port-security violation restrict&lt;br /&gt;
	no shut&lt;br /&gt;
	interface f0/5&lt;br /&gt;
	shut&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	switchport port-security&lt;br /&gt;
	switchport port-security maximum 1&lt;br /&gt;
	switchport port-security mac-address r2的mac地址&lt;br /&gt;
	switchport port-security violation restrict&lt;br /&gt;
	no shut&lt;br /&gt;
	案例：&lt;br /&gt;
	CCIE-LAB(V180)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	The customer wants to connect guest Ipphones to Sw4 f0/11-15&lt;br /&gt;
	l He wants to protecte interface from a user connecting a PC or a hub&lt;br /&gt;
	l He wants the interface to learning first mac-address connected and become part of the configuration&lt;br /&gt;
	l He does not want to have to manually bring backup the interface if the encounter a security viotation,but he do to ensure that the phones&amp;rsquo;s address is the only one allowed,and be able to check eth steales violation.&lt;br /&gt;
	配置：&lt;br /&gt;
	sw4&lt;br /&gt;
	config termi&lt;br /&gt;
	mls qos&lt;br /&gt;
	interface range f0/11 &amp;ndash;15&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	switchport voice vlan dot1p&lt;br /&gt;
	switchport port-security&lt;br /&gt;
	switchport port-security mac-address sticky&lt;br /&gt;
	switchport port-security violation restrict&lt;br /&gt;
	mls qos trust cos&lt;br /&gt;
	第二． 基于主机MAC地址限制流量&lt;br /&gt;
	对于MAC过滤的特性，它能够根据主机MAC地址来限制流量，在使用该特性的情况下，交换机能够丢弃源自所配置MAC地址的流量。通过使用这种特性，网络管理源能够防止未授权主机向网络发送流量。&lt;br /&gt;
	注意，交换机只允许对单播的源MAC地址流量进行过滤，而不允许对多播的源MAC地址流量进行过滤。他对采用多播源MAC地址发送数据报的规范是无效的。&lt;br /&gt;
	交换机允许在整个VLAN或单个接口上配置单播过滤。如果数据帧采用的源MAC地址没有被指定，那么交换机就可以正常地传递数据帧。对于基于cisco IOS软件的交换机，它只支持重启之后仍然存在的单播过滤。&lt;br /&gt;
	配置过程：&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 配置限制MAC地址流量&lt;br /&gt;
	mac-address-table static MAC地址 vlan vlan号 drop&lt;br /&gt;
	3） 验证结果&lt;br /&gt;
	show mac-address-table static vlan 1&lt;br /&gt;
	案例：&lt;br /&gt;
	switch(config)#mac-address-table static 0000.0000.0008 vlan 1 drop&lt;br /&gt;
	switch#show mac-address-table static vlan 1&lt;br /&gt;
	Mac Address Table&lt;br /&gt;
	-------------------------------------------&lt;br /&gt;
	Vlan Mac Address Type Ports&lt;br /&gt;
	---- ----------- -------- -----&lt;br /&gt;
	1 000d.6564.0280 STATIC CPU&lt;br /&gt;
	1 0100.0ccc.cccc STATIC CPU&lt;br /&gt;
	1 0100.0ccc.cccd STATIC CPU&lt;br /&gt;
	1 0100.0cdd.dddd STATIC CPU&lt;br /&gt;
	1 0000.0000.0008 STATIC Drop&lt;br /&gt;
	Total Mac Addresses for this criterion: 5&lt;br /&gt;
	第三。阻塞端口的单播或多播扩散&lt;br /&gt;
	默认情况下，如果数据包具有未知的目标MAC地址，那么交换机将把它扩散到与接收端口的VLAN相同的VLAN中所有端口。某些端口不需要扩散功能。例如，如果某个端口只有手工分配的MAC地址，并且没有连接所配置MAC地址之外的其它任何网络设备，那么它就不需要接收扩散数据包。此外，如果端口已经学到最大数目的MAC地址，那么对于通过配置安全MAC地址或端口启用端口安全的端口，它就不必接收未知的单播扩散。&lt;br /&gt;
	通过使用单播或多播扩散阻塞的特性，将可以避免在不必要的端口上转发单播扩散流量。通过以每个端口为基础而限制流量大小，不仅可以增加网络的安全限制，并且还可以防止网络设备徒然地处理无定向的数据包。&lt;br /&gt;
	配置过程：&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置其端口阻塞单播&lt;br /&gt;
	switchport block unicast&lt;br /&gt;
	4） 配置其端口阻塞多播流量&lt;br /&gt;
	switchport block multicast&lt;br /&gt;
	5） 验证结果&lt;br /&gt;
	show interface 接口 switchport&lt;br /&gt;
	案例：&lt;br /&gt;
	Switch# configure terminal&lt;br /&gt;
	Switch(config)# interface fa0/1&lt;br /&gt;
	Switch(config-if)# switchport block multicast&lt;br /&gt;
	Switch(config-if)# switchport block unicast&lt;br /&gt;
	Switch(config-if)# end&lt;br /&gt;
	Switch#show interface f0/1 switchport&lt;br /&gt;
	案例：&lt;br /&gt;
	CCIE-LAB(V160)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	在SW2种fa0/10上阻塞所有未知的组播流量&lt;br /&gt;
	配置：&lt;br /&gt;
	SW2&lt;br /&gt;
	config termi&lt;br /&gt;
	interface f0/10&lt;br /&gt;
	switchport block multicast&lt;br /&gt;
	第二部分 IEEE 802.1X管理网络访问安全&lt;br /&gt;
	IEEE 802.1x访问控制特性是一种基于行业标准的第2层访问控制方法，提供了集中管理功能。IEEE 802.1x访问控制特性还被广泛应用于无线网络。&lt;br /&gt;
	&lt;br /&gt;
	使用802.1x的时候，在交换机接收器端口连接的工作站发送的数据包之前，将请求身份验证服务器对工作站进行身份验证。在身份验证服务器验证工作站的身份之前，802.1x访问控制特性只允许EAPOL(Extensible Authentication Protocol over LAN，LAN上的可扩展身份验证协议)通信流通过工作站连接的端口。通过身份验证后，常规通信流才能通过该端口。&lt;br /&gt;
	基于端口的802.1x身份验证涉及3种设备：&lt;br /&gt;
	* 客户（client）---使用802.1x请求网络对其进行身份验证的工作站。当前，只有Microsoft Windows XP和Windows 2003内置了对802.1x支持功能&lt;br /&gt;
	* 身份验证服务器（Authentication server）---负责验证交换机转发的客户请求。当前，身份验证服务器是安装了EAPOL扩展的RADIUS服务器。&lt;br /&gt;
	* 交换机---负责将客户请求转发给身份验证服务器，并在客户通过身份验证后授予其访问网络的权限。在802.1x运行期间，交换机实际上是代理&lt;br /&gt;
	交换机端口的状态决定了客户是否能够访问网络。端口开始处于未经授权（unauthorized）状态。在这种状态下，除802.1x协议数据包外，端口不允许任何入站通信流和出站通信流通过。客户通过身份验证后，端口将切换到授权（authorized）状态，允许来自客户的通信流通过。如果交换机请求客户表明其身份（证明方发起的），而客户不支持802.1x，端口将保持未经许可状态，客户不能访问网络。&lt;br /&gt;
	相反地，当启用了802.1x的客户连接到端口，并向交换机发送EAPOL启动帧一启动身份验证过程（恳求方发起），而交换机没有运行802.1x协议，无法响应客户时，客户将开始发送数据帧，就像端口处于许可状态一样。&lt;br /&gt;
	2．验证开始和消息交换&lt;br /&gt;
	交换机或客户可以发起验证。如果一个端口上使用dot1x port-control auto接口配置命令启动验证，那么交换机必须在确定该端口链路状态从down转换为UP时发起验证。交换机接着向客户发送一个EAP-请求/身份帧来请求它的身份。根据收到的帧，客户响应一个EAP-响应/身份帧。&lt;br /&gt;
	&lt;br /&gt;
	如果在启动期间客户没有收到一个来自交换机的EAP-请求/身份帧，那么客户可以发送一个EAPOL-开始帧来发起验证。这提示交换机要请求客户的身份。&lt;br /&gt;
	如果网络接入设备上没有启用或支持802.1X，则会丢弃任何来自客户的EAPOL帧。如果客户在尝试开始验证的指定次数之后还未收到EAP-请求/身份帧，那么客户将发送帧如同端口已处于授权状态。出于授权状态的端口实际上意味着客户已被成功验证了。&lt;br /&gt;
	当客户提供其身份是，交换机开始他的中介职责，在客户和验证服务器之间传递EAP帧直到验证成功或失败。如果授权成功，交换端口即被授权&lt;br /&gt;
	EAP帧的详细交换基于所使用的验证方法。如图，由客户发起的与RADIUS服务器一起使用OTP（一次口令）验证方法的消息交换。&lt;br /&gt;
	3．支持的拓扑&lt;br /&gt;
	802.1X基于端口的验证支持在两种拓扑种：&lt;br /&gt;
	* 点对点（单用户）&lt;br /&gt;
	* 无线LAN（多用户）&lt;br /&gt;
	在点对点配置中，只有一个客户能够连接到起用了802.1X的交换机端口上。交换机在端口链路状态变为UP状态时检测客户。如果客户离开或被另一个客户替换，交换机将端口链路状态变为DOWN,端口返回到未授权状态。&lt;br /&gt;
	802.1X交换机端口被配置为一个多主机端口，一旦客户通过验证即变为授权的。当端口是授权的时候，所有其他非直连的主机获准接入网络。如果端口变为未授权的（在重新验证失败或受到一个EAPOL-下线消息时），交换机拒绝所有直连客户的网络访问。&lt;br /&gt;
	&lt;br /&gt;
	这个拓扑中，无线接入点负责验证直连到它的客户，并且该无线接入点作为交换机的一个客户。&lt;br /&gt;
	4．端口身份验证状态：&lt;br /&gt;
	* Force-authorized---禁用基于端口的802.1x身份验证，导致端口切换到许可状态，而不需要交换任何身份验证信息。端口发送和接收常规通信流，而不对客户进行基于802.1x的身份验证，这是默认设置&lt;br /&gt;
	* Force-unauthorized---导致端口保持未经许可状态，并忽略客户的所有身份验证请求。交换机不能通过这种端口为客户提供身份验证服务。&lt;br /&gt;
	* Auto---启用基于端口的802.1x身份验证，导致端口一开始处于未经许可状态，只能接收和发送EAPOL帧。端口的链路状态从down到up(验证方发起)或收到EAPOL启动帧（恳求方发起）后，身份验证过程便开始了。交换机请求客户说明其身份，并在客户和验证服务器之间转发身份验证消息。交换机使用客户的MAC地址来唯一地标识每个试图访问网络的客户。&lt;br /&gt;
	如果客户通过了身份验证（收到来自身份验证服务器的Accept帧），端口状态将变为许可，客户发送的所有帧都被允许通过端口。如果未通过身份验证，端口将保持未经许可状态。在这种状态下，端口只允许用于重新验证身份的通信流通过，而不允许其他用户通信流通过。如果身份验证服务器不可达，交换机可能重传请求。如果重传指定次数后，服务器仍没有响应，身份验证将一失败告终，交换机不允许客户访问网络。此外，客户注销是将发送一条EAPOL注销信息，导致服务器端口切换到未经许可状态。&lt;br /&gt;
	5．802.1X配置指导&lt;br /&gt;
	802.1X协议在第2层的静态接入端口上支持，但在以下类型的端口上不支持：&lt;br /&gt;
	* 中继端口---试图在一个中继端口上启用802.1X会产生错误消息，因而不能激活802.1X。&lt;br /&gt;
	* 动态端口---处于动态模式的端口会与其相邻的邻居协商变成一个中继端口，所以要在动态模式的端口设置802.1X会出错。&lt;br /&gt;
	* VQP端口---试图在一个动态接入（VLAN查询协议[VQP]）端口上启用802.1X会出错&lt;br /&gt;
	* 活动的ETHERCHANNEL端口---在端口启用802.1X之前，首先应将该端口从EtherChannel中移除。试图在一个EtherChannel或一个EtherChannel中的一个活动端口上启用802.1x会产生错误&lt;br /&gt;
	l 安全端口---安全端口不能配置为802.1x&lt;br /&gt;
	l span目的端口---802.1x可以在一个SPAN目的的端口上启用，但802.1X直到该端口不再是SPAN目的时才会生效。802.1X可以再SPAN源端口使用&lt;br /&gt;
	6．配置802.1X&lt;br /&gt;
	默认配置&lt;br /&gt;
	特性 默认设置&lt;br /&gt;
	------------------------------------------&lt;br /&gt;
	交换机IEEE802.1x 禁用&lt;br /&gt;
	AAA验证 禁用&lt;br /&gt;
	RADIUS服务器&lt;br /&gt;
	IP地址 未指定&lt;br /&gt;
	UDP端口 1812&lt;br /&gt;
	密钥 未指定&lt;br /&gt;
	主机模式 点对点（单主机）&lt;br /&gt;
	每个接口的802.1X启用状态 禁用（强制未授权），端口发送和接受正常的流量&lt;br /&gt;
	周期性的重新验证 禁止&lt;br /&gt;
	重新验证尝试之间的次数 3600秒&lt;br /&gt;
	安静周期 60秒（交换机在与客户的一次失败验证交换之后保持安静状态的时间）&lt;br /&gt;
	重传时间 30秒（交换机在重传请求之前等待客户对一个EAP请求/身份帧的响应时间）&lt;br /&gt;
	最大重传次数 2次（交换机在重新开始验证过程之前发送一个EAP请求/身份帧的次数）&lt;br /&gt;
	多主机支持 禁止&lt;br /&gt;
	客户超时周期 30秒（在将一个请求从验证服务器中介给客户时，交换机向客户重传该请求之前等待响应的时间）。该设置不能配置&lt;br /&gt;
	验证服务器超时周期 30秒（在将一个请求从客户中介给验证服务器时，交换机向服务器重传该请求之前等待响应的时间）。该设置不能配置&lt;br /&gt;
	配置IEEE802.1X认证&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 启用AAA&lt;br /&gt;
	aaa new-model&lt;br /&gt;
	3） 建立IEEE802.1x认证列表&lt;br /&gt;
	aaa authentication dot1x {default} method1&lt;br /&gt;
	default:将后面指定的身份验证方法作为默认配置，自动作用于所有IEEE802.1x&lt;br /&gt;
	method1:指定身份验证的方法&lt;br /&gt;
	4） 启用IEEE802.1x授权&lt;br /&gt;
	dot1x system-auth-control&lt;br /&gt;
	5） 建立授权（可选）&lt;br /&gt;
	aaa authorization network {default} group radius&lt;br /&gt;
	指定通过RADIUS服务起来建立授权&lt;br /&gt;
	6） 指定RADIUS服务器的地址&lt;br /&gt;
	radius-server host　IP地址&lt;br /&gt;
	7） 指定密钥&lt;br /&gt;
	radius-server key 密钥&lt;br /&gt;
	8） 进入接口模式 interface 接口&lt;br /&gt;
	9） 启用IEEE802.1x认证&lt;br /&gt;
	switchport mode access dot1x port-control auto&lt;br /&gt;
	10） 验证结果&lt;br /&gt;
	show dot1x&lt;br /&gt;
	配置交换机域RADIUS服务器之间通信&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 配置RADIUS服务器特征&lt;br /&gt;
	radius-server host [主机名|IP地址] auth-port 端口号 key 密钥&lt;br /&gt;
	auth-port:UDP端口号&lt;br /&gt;
	配置主机模式&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置主机模式&lt;br /&gt;
	dot1x host-mode multi-host&lt;br /&gt;
	允许多主机模式&lt;br /&gt;
	4） 配置IEEE802.1x认证&lt;br /&gt;
	dot1x port-control auto&lt;br /&gt;
	配置重认证周期&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 启用IEEE802.1x重认证&lt;br /&gt;
	dot1x reauthentication&lt;br /&gt;
	4） 设置重认证周期&lt;br /&gt;
	dot1x timeout reauth-period 秒数&lt;br /&gt;
	秒数：默认为3600秒，取值为1-65535&lt;br /&gt;
	5） 验证结果&lt;br /&gt;
	show dot1x interface 接口&lt;br /&gt;
	配置安静周期&lt;br /&gt;
	交换机在与客户的一次失败验证交换之后保持安静状态的时间&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置安静周期Quiet period&lt;br /&gt;
	dot1x timeout quiet-period 秒数&lt;br /&gt;
	秒数：默认为60秒，取值为1-65535&lt;br /&gt;
	配置交换机与主机之间重传时间&lt;br /&gt;
	交换机在重传请求之前等待客户对一个EAP请求/身份帧的响应时间&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interfacer 接口&lt;br /&gt;
	3） 配置重传时间&lt;br /&gt;
	dot1x timeout tx-period 秒数&lt;br /&gt;
	秒数为5-65535，默认为5秒&lt;br /&gt;
	配置交换机与主机之间重传最大次数&lt;br /&gt;
	交换机在重新开始验证过程之前发送一个EAP请求/身份帧的次数&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interfacer 接口&lt;br /&gt;
	3） 配置重传最大次数&lt;br /&gt;
	dot1x max- req 次数&lt;br /&gt;
	次数为1-10，默认为2次&lt;br /&gt;
	配置交换机与主机之间重认证最大次数&lt;br /&gt;
	1） 入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interfacer 接口&lt;br /&gt;
	3） 配置重传最大次数&lt;br /&gt;
	dot1x max-reauth-req 次数&lt;br /&gt;
	秒数为1-10，默认为2次&lt;br /&gt;
	案例：&lt;br /&gt;
	CCIE-LAB(V133)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	you want to restrict unauthorized clients form connecting to your network configure sw1 so that the por f0/9 has 802.1x port-based authentication using a RADIUS server heinitial state of this port should be unauthorized ,but when transitions form down to up the authentication process to the Radius SERVER SHOULD BEGIN ,PERFORM ONLY THE MINIMUM AAA configuration pertinent to the 802.1x port-based authentication&lt;br /&gt;
	配置：&lt;br /&gt;
	SW1&lt;br /&gt;
	configure term&lt;br /&gt;
	aaa new-model&lt;br /&gt;
	aaa authentication dot1x default group radius&lt;br /&gt;
	aaa authortication network default group radius&lt;br /&gt;
	dot1x system-auto-control&lt;br /&gt;
	interface f0/9&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	dot1x port-control auto&lt;br /&gt;
	CCIE-LAB(YY)&lt;br /&gt;
	you want to restrict unauthorized clients form connecting to your network configure sw1 so that the por f0/17 has 802.1x port-based authentication using a RADIUS server heinitial state of this port should be unauthorized ,but when transitions form down to up the authentication process to the Radius SERVER SHOULD BEGIN ,PERFORM ONLY THE MINIMUM AAA configuration pertinent to the 802.1x port-based authentication.RADIUS Server address:150.1.1.254,key is cisco.&lt;br /&gt;
	配置：&lt;br /&gt;
	sw1&lt;br /&gt;
	config termi&lt;br /&gt;
	aaa new-model&lt;br /&gt;
	aaa authentication dot1x default group radius&lt;br /&gt;
	aaa authentication network default group raidus&lt;br /&gt;
	radius-server host 150.1.1.254&lt;br /&gt;
	radius-server key cisco&lt;br /&gt;
	dot1x system-auth-control&lt;br /&gt;
	interface f0/17&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	dot1x port-control auto&lt;br /&gt;
	show dot1x&lt;br /&gt;
	show dot1x interface f0/17&lt;br /&gt;
	配置访客vlan(guest vlan)&lt;br /&gt;
	如果端口指定了访客Guest VLAN项，此端口下的接入用户如果认证失败或根本无用户账号的话，会成为Guest VLAN 组的成员，可以享用此组内的相应网络资源，这一种功能同样可为网络应用的某一些群体开放最低限度的资源，并为整个网络提供了一个最外围的接入安全。用户可以去下载客户端，但是不能去上公网，他限制了未拨号用户可以访问的资源。&lt;br /&gt;
	配置过程：&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置接口模式&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	4） 配置dot1x认证&lt;br /&gt;
	dot1x port-control auto&lt;br /&gt;
	5） 配置某个活动vlan成为访客vlan&lt;br /&gt;
	dot1x guest-vlan vlan号&lt;br /&gt;
	vlan号：1-4094，除了RSPAN vlan、私有VLAN的主Vlan、语音vlan&lt;br /&gt;
	案例：&lt;br /&gt;
	CCIE-LAB(210)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	配置sw3上基于802.1X安全的GUEST VLAN，vlan号为999，端口范围为fa0/11-18,RADIUS SERVER地址为150.1.1.254，密码为cisco。&lt;br /&gt;
	配置：&lt;br /&gt;
	SW3:&lt;br /&gt;
	config terminal&lt;br /&gt;
	vlan 999&lt;br /&gt;
	name guestvlan&lt;br /&gt;
	aaa new-model&lt;br /&gt;
	aaa authentication dot1x default group radius&lt;br /&gt;
	aaa authortication network default group radius&lt;br /&gt;
	dot1x system-auth-control&lt;br /&gt;
	radius-server host 150.1.1.254&lt;br /&gt;
	radius-server key cisco&lt;br /&gt;
	interface fa0/11 &amp;ndash;18&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	dot1x port-control auto&lt;br /&gt;
	dot1x guest-vlan 999&lt;br /&gt;
	&lt;br /&gt;
	配置受限vlan&lt;br /&gt;
	可以配置端口指定为受限vlan,当认证失败之后（超过认证次数3次），不能访问guest vlan的客户将加入受限的vlan, 限制了未认证成功的用户可以访问的资源。&lt;br /&gt;
	配置过程：&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置接口模式&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	4） 配置受限vlan&lt;br /&gt;
	dot1x auth-fail vlan vlan号&lt;br /&gt;
	5） 配置最大认证接收次数&lt;br /&gt;
	dot1x auth-fail auth-attwmpts 次数&lt;br /&gt;
	次数：取值为1-3，默认为3&lt;br /&gt;
	配置物理地址认证旁路&lt;br /&gt;
	使用mac地址认证旁路特性，交换机可以使用客户端的mac地址作为客户认证，比如端口上连接一台打印机。当一个802.1x端口上使用mac认证旁路特性，交换机将使用mac地址作为客户端的身份的验证，认证服务器有一张客户mac地址表用作是否允许客户访问网络。交换机等待客户的EAP响应/身份帧的认证时间超时，交换机会尝试使用mac地址作为客户的认证。&lt;br /&gt;
	配置过程：&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置接口&lt;br /&gt;
	dot1x port-control auto&lt;br /&gt;
	dot1x mac-address-bypass [eap]&lt;br /&gt;
	eap:交换机使用eap认证&lt;br /&gt;
	非法IEEE802.1x&lt;br /&gt;
	配置过程：&lt;br /&gt;
	1） 进入接口模式 interface 接口&lt;br /&gt;
	2） 非法ieee802.1x功能&lt;br /&gt;
	no dot1x pae&lt;br /&gt;
	恢复原始配置参数&lt;br /&gt;
	配置过程：&lt;br /&gt;
	1） 进入接口模式&lt;br /&gt;
	2） 恢复原始配置&lt;br /&gt;
	dot1x default&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
	第三部分 访问控制&lt;br /&gt;
	1．RACL&lt;br /&gt;
	针对路由接口的控制通信流量的安全策略。交换机在硬件中支持包含允许和拒绝操作的RACL。RACL的配置方式与常规的ACL相同。&lt;br /&gt;
	在交换机中，用户可以在任何路由接口中应用RACL，其中包括如下接口：&lt;br /&gt;
	*SVI（交换虚拟接口vlan端口）&lt;br /&gt;
	*第3层端口或路由端口&lt;br /&gt;
	*第3层端口通道&lt;br /&gt;
	*其它第3层接口&lt;br /&gt;
	2．VACL&lt;br /&gt;
	VACL又称为VLAN访问映射表，应用于VLAN中的所有通信流。VACL支持基于ethertype和MAC地址的过滤，也支持Ipv4的IP地址过滤。与基于cisco IOS的路由映射表一样，vacl中条目的顺序并非无关紧要。VACL不定义方向（进或出）。一个VACL可以用于多个VLAN中；但一个VLAN只能与一个VACL关联。&lt;br /&gt;
	支持多种VACL操作：&lt;br /&gt;
	* 转发（允许）：这种VACL操作像通常那样转发帧。如果希望配置交换机端口分析器（SPAN）选项，必须采用带capture选项的转发操作；SPAN是一项用于将数据帧复制到监控端口的排错特性。这种VACL对于配置多个SPAN端口并连接网络监控设备（如第三方IDS设备）很有用。&lt;br /&gt;
	* 丢弃（拒绝）：流与某个ACL丢弃（拒绝）条目匹配后，将它同下一个ACL条目进行比较。如果流不予任何ACL条目匹配，且至少配置了一个针对数据包类型的ACL，则流中的数据包将被丢弃&lt;br /&gt;
	* 重定向：VACL重定向操作对于出于监控、安全或交换的目的而重定向特定通信流很有用。&lt;br /&gt;
	&lt;br /&gt;
	配置方法：&lt;br /&gt;
	1） 定义访问控制列表（标准、扩展、命名）&lt;br /&gt;
	a.标准访问控制列表&lt;br /&gt;
	access-list 列表编号 deny|permit 源地址 反掩码 [log]&lt;br /&gt;
	* 列表编号：1-99&lt;br /&gt;
	* deny:拒绝&lt;br /&gt;
	* permit:允许&lt;br /&gt;
	* 源地址：控制访问的源头&lt;br /&gt;
	* 反掩码：any 是指任意主机，host是指某台主机&lt;br /&gt;
	* log:记录到日志文件&lt;br /&gt;
	案例：&lt;br /&gt;
	Switch (config)# access-list 2 deny host 171.69.198.102&lt;br /&gt;
	Switch (config)# access-list 2 permit any&lt;br /&gt;
	Switch(config)# end&lt;br /&gt;
	Switch# show access-lists&lt;br /&gt;
	Standard IP access list 2&lt;br /&gt;
	10 deny 171.69.198.102&lt;br /&gt;
	20 permit any&lt;br /&gt;
	&lt;br /&gt;
	b.扩展访问控制列表&lt;br /&gt;
	access-list 列表编号 deny|permit 协议 源地址 反掩码 [源端口] 目标地址 反掩码 [目标端口] [表达式]&lt;br /&gt;
	* 列表编号：100-199&lt;br /&gt;
	* 协议：IP、TCP、UDP、ICMP等，协议选项是区别标准访问列表的特征之一&lt;br /&gt;
	* 表达式：eq 协议或端口号:等于协议或端口号&lt;br /&gt;
	gq 协议或端口号：小于指定的协议或端口号&lt;br /&gt;
	lq 协议或端口号：大于指定的协议或端口号&lt;/p&gt;
&lt;p&gt;
	案例：&lt;br /&gt;
	Switch(config)# access-list 102 deny tcp 171.69.198.0 0.0.0.255 172.20.52.0 0.0.0.255 eq telnet&lt;br /&gt;
	Switch(config)# access-list 102 permit tcp any any&lt;br /&gt;
	Switch(config)# end&lt;br /&gt;
	Switch# show access-lists&lt;br /&gt;
	Extended IP access list 102&lt;br /&gt;
	10 deny tcp 171.69.198.0 0.0.0.255 172.20.52.0 0.0.0.255 eq telnet&lt;br /&gt;
	20 permit tcp any any&lt;/p&gt;
&lt;p&gt;
	c.命名访问控制列表&lt;br /&gt;
	命名的列表允许使用超过99个标准控制列表和100个扩展控制列表。优于编号的控制列表的特点是可以删除特定的一条语句，而编号访问控制列表只能删除整个访问控制。&lt;br /&gt;
	Ip access-list [standard|extended] 名称&lt;br /&gt;
	Permit|deny 标准和扩展有所不同&lt;/p&gt;
&lt;p&gt;
	案例：&lt;br /&gt;
	Switch(config)# ip access-list extended border-list&lt;br /&gt;
	Switch(config-ext-nacl)# no permit ip host 10.1.1.3 any&lt;br /&gt;
	2） 定义VACL映射表&lt;br /&gt;
	vlan access-map 名称&lt;br /&gt;
	a) 匹配指定的IP访问控制列表 match ip address 访问列表号&lt;br /&gt;
	匹配指定的mac访问控制列表 match mac address 访问控制列表&lt;br /&gt;
	b) 指定对符合条件的流量进行何动作 action drop|forward&lt;/p&gt;
&lt;p&gt;
	案例：&lt;br /&gt;
	switch(config)#vlan access-map test&lt;br /&gt;
	switch(config-access-map)#match ip address 101&lt;br /&gt;
	switch(config-access-map)#action forward&lt;br /&gt;
	3） 将VACL映射表应用到某个VLAN&lt;br /&gt;
	vlan filter 映射表名称 vlan-list vlan列表&lt;/p&gt;
&lt;p&gt;
	案例：&lt;br /&gt;
	vlan filter test vlan-list 10&lt;/p&gt;
&lt;p&gt;
	4） 验证结果&lt;br /&gt;
	show vlan access-map 名称&lt;br /&gt;
	&lt;br /&gt;
	Switch#show vlan access-map&lt;br /&gt;
	Vlan access-map &amp;quot;test&amp;quot; 10&lt;br /&gt;
	Match clauses:&lt;br /&gt;
	ip address: 100&lt;br /&gt;
	Action:&lt;br /&gt;
	drop&lt;br /&gt;
	Vlan access-map &amp;quot;test&amp;quot; 20&lt;br /&gt;
	Match clauses:&lt;br /&gt;
	Action:&lt;br /&gt;
	forward&lt;br /&gt;
	---------------------------------------------------&lt;br /&gt;
	show vlan filter access-map 名称 | vlan vlan号&lt;/p&gt;
&lt;p&gt;
	Switch#show vlan filter&lt;br /&gt;
	VLAN Map test is filtering VLANs:&lt;br /&gt;
	11-13&lt;/p&gt;
&lt;p&gt;
	案例：&lt;br /&gt;
	主机X和主机Y位于不同的VLAN，交换机B已经对这两个VLAN做了vlan间的路由&lt;br /&gt;
	Switch(config)# ip access-list extended http&lt;br /&gt;
	Switch(config-ext-nacl)# permit tcp host 10.1.1.32 host 10.1.1.34 eq www&lt;br /&gt;
	Switch(config-ext-nacl)# exit&lt;/p&gt;
&lt;p&gt;
	Switch(config)# vlan access-map map2 10&lt;br /&gt;
	Switch(config-access-map)# match ip address http&lt;br /&gt;
	Switch(config-access-map)# action drop&lt;br /&gt;
	Switch(config-access-map)# exit&lt;br /&gt;
	Switch(config)# ip access-list extended match_all&lt;br /&gt;
	Switch(config-ext-nacl)# permit ip any any&lt;br /&gt;
	Switch(config-ext-nacl)# exit&lt;br /&gt;
	Switch(config)# vlan access-map map2 20&lt;br /&gt;
	Switch(config-access-map)# match ip address match_all&lt;br /&gt;
	Switch(config-access-map)# action forward&lt;br /&gt;
	Switch(config)# vlan filter map2 vlan 1&lt;br /&gt;
	要注意vlan间的acl和vacl之间的区别&lt;br /&gt;
	&lt;br /&gt;
	3.PACL&lt;br /&gt;
	通过控制端口级别的流量，PACL(Port ACL)端口ACL能够提供另外一种控制机制。PACL可应用于第2层交换机端口、干道端口或EtherChannel端口。&lt;br /&gt;
	在使用PACL的时候，能够在第2层接口上应用如下的ACL:&lt;br /&gt;
	* 标准访控（针对源IP地址）&lt;br /&gt;
	* 扩展访控（针对源IP地址和目标IP地址以及用于第4层协议类型信息）&lt;br /&gt;
	* MAC扩展访控（针对源和目标MAC地址，还可以使用第3层协议类型信息）&lt;br /&gt;
	当PACL应用于trunk端口上时，ACL将过滤trunk端口上所有的vlan的流量。当PACL应用到语音vlan端口的时候，ACL将过滤数据和语音VLAN的流量。&lt;br /&gt;
	对于PACL，通过采用IP访问控制列表，将能够过滤IP流量，通过采用MAC访问控制列表，将能够过滤非IP流量。此外，通过在接口上应用IP访问控制列表和MAC访问列表，将能够过滤相同的第2层接口上IP流量和非IP流量。&lt;/p&gt;
&lt;p&gt;
	配置MAC扩展访控：&lt;br /&gt;
	1）进入全局模式 configure terminal&lt;br /&gt;
	2）定义mac扩展访控名称&lt;br /&gt;
	mac access-list extended 名称&lt;br /&gt;
	3） 定义相应访问控制列表语句&lt;br /&gt;
	deny|permit [any | host 源MAC | 源MAC 源MAC掩码] [any | host 目标MAC | 目标MAC 目标MAC掩码 ] [ aarp | amber | dec-spanning | decnet-iv | diagnostic | dsm | etype-6000 | etype-8042 | lat | lavc-sca | mop-console | mop-dump | msdos | mumps | netbios | vines-echo |vines-ip | xns-idp | 0-65535] [cos cos]&lt;br /&gt;
	4） 应用访问控制列表到第2层接口&lt;br /&gt;
	进入接口模式 interface 接口&lt;br /&gt;
	应用访控 mac access-group 访控名称 in&lt;br /&gt;
	对于端口ACL而言，只有进入的方向可以加访控&lt;br /&gt;
	5） 验证结果&lt;br /&gt;
	show access-lists [列表号|名称]&lt;br /&gt;
	show access-group [interface 接口]&lt;br /&gt;
	&lt;br /&gt;
	案例：&lt;br /&gt;
	switch#configure terminal&lt;br /&gt;
	switch(config)#mac access-list extended cisco&lt;br /&gt;
	switch(config-ext-macl)#permit host 0011.abcd.abcd host 0011.1111.1111&lt;br /&gt;
	switch(config-ext-macl)#exit&lt;br /&gt;
	switch(config)#access-list 101 deny ip 10.10.1.0 0.0.0.255 host 10.10.2.2&lt;br /&gt;
	switch(config)#access-list 101 permit ip any any&lt;br /&gt;
	switch(config)#interface f0/23&lt;br /&gt;
	switch(config-if)#switchport mode trunk&lt;br /&gt;
	switch(config-if)#ip access-group 101 in&lt;br /&gt;
	switch(config-if)#mac access-group cisco in&lt;br /&gt;
	switch(config-if)#end&lt;br /&gt;
	switch#show access-lists&lt;br /&gt;
	switch#show access-group interface f0/23&lt;/p&gt;
&lt;p&gt;
	案例：&lt;br /&gt;
	CCIE-LAB(v133)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	Assume that connected to port f0/15 on SW1 is a host sending Ethernet Type 6000 frames into the network configures an access-list to block only this traffic allowing other frames to enter into the network.Please use &amp;ldquo;Block_eth6000&amp;rdquo; as the name of access-list.&lt;br /&gt;
	配置：&lt;br /&gt;
	SW1&lt;br /&gt;
	configure terminal&lt;br /&gt;
	mac access-list extended Block_eth6000&lt;br /&gt;
	deny any any etype-6000&lt;br /&gt;
	permit any any&lt;br /&gt;
	interface f0/15&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	mac access-group Block_eth6000 in&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
	第四部分 DHCP监听&lt;br /&gt;
	在某些情况下，入侵者可以将一个DHCP 服务器加入网络，令其&amp;ldquo;冒充&amp;rdquo;这个网段的DHCP 服务器。这让入侵者可以为缺省的网关和域名服务器（DNS 和WINS）提供错误的DHCP 信息，从而将客户端指向黑客的主机。这种误导让黑客可以成为&amp;ldquo;中间人&amp;rdquo;，获得对保密信息的访问权限，例如用户名和密码，而最终用户对攻击一无所知。为了防止出现这种情况，您可以使用DHCP 监听。DHCP监听是一种dhcp安全特性，他能够过滤来自网络中主机或其他设备的非信任dhcp报文。通过建立并维护dhcp监听绑定表，dhcp能够实现上述级别的安全。&lt;br /&gt;
	非信任DHCP消息是交换机从外部的网络、防火墙或其他非授权dhcp服务器接收到的dhcp消息，在启用dhcp监听的环境中，当从信任的区域中之外的设备传来的信息都是非信任的消息，这些非信任的消息可能是黑客入侵。&lt;br /&gt;
	DHCP监听建立DHCP绑定表，用来过滤不可信任区域的DHCP信息，其中包括对应交换机上不信任的端口的客户端IP地址、MAC地址、端口号、VLAN编号、租用和绑定类型等消息。交换机支持在每个vlan基础上启用DHCP监听特性。通过这种特性，交换机拦截第2层VLAN域内的所有DHCP报文。&lt;br /&gt;
	通过这种特性，交换机能够限制用户端口（非信任端口）只能够发送dhcp请求，并且将丢弃来自用户端口的所有其它DHCP报文，例如DHCP提供（OFFER）响应报文等。DHCP监听信任端口是连接到已知合法DHCP服务器或与分布层交换机（能够提供到达DHCP服务器的路径）之间的上行链路端口。信任端口能够发送或接收所有的DHCP报文。这种情况下，交换机只允许受信任的dhcp服务器能够通过DHCP响应来分发DHCP地址。&lt;br /&gt;
	当交换机从启用了dhcp监听的vlan中一个不信任端口接收到一个报文，交换机会比较源mac地址和dhcp客户机的硬件地址，如果匹配这个数据报文被转发，如果不匹配这个数据报将被丢弃。&lt;/p&gt;
&lt;p&gt;
	交换机根据以下情况会丢弃报文：&lt;br /&gt;
	* 当收到外网的dhcp服务器发来的DHCPOFFER, DHCPACK, DHCPNAK, DHCPLEASEQUERY报文&lt;br /&gt;
	* 接收到非信任端口报文，源MAC和DHCP客户端硬件地址不匹配&lt;br /&gt;
	* 接收到DHCPRELEASE或DHCPDECLINE广播信息中有dhcp绑定表中某个mac地址，但接口信息和收到的信息中的接口信息不匹配。&lt;br /&gt;
	如果一台支持DHCP监听的汇聚层交换机和一台插入了选项82信息的边界交换机相连，这台交换机会丢弃从非信任的端口收到的插入了选项82的报文信息，如果信任端口收到插入选项82的信息报，汇聚交换机不会为信任端口链接的设备建立DHCP监听绑定表条目。&lt;br /&gt;
	拥有ios12.25或更早版本的边界交换机如果插入了选项82，和它相连的汇聚交换机因为汇聚交换机的dhcp监听绑定表不完整不能使能dhcp监听功能，汇聚交换机也不能使用IP源保护和动态arp，除非你手工指定绑定表和arp的访问控制。&lt;br /&gt;
	在IOS 12.2(25)SE版本之后，汇聚交换机和边界交换机通过一个非信任端口相连时，通过全局模式下命令ip dhcp snooping information allow-untrusted的配置，汇聚交换机会接收从边界交换机发来的插入选项82的信息报，汇聚交换机也会学习和绑定从不信任端口相连的设备信息。&lt;br /&gt;
	选项82&lt;br /&gt;
	当DHCP Relay Agent将客户端的DHCP包转发到DHCP服务器时，可以插入一些选项信息，以便DHCP服务器能更精确的得知PC客户端的信息，从而能更灵活按相应策略分配IP地址和IP地址需要的租约时间。该选项信息的选项号为82，故又称为Option 82，相关标准文档为RFC 3046。Option 82是对DHCP选项的扩展应用，这个新的选项被称为：DHCP relay agent information option（中继代理信息选项），当向一个DHCP中继代理传输客户端发起的DHCP请求时被中继代理嵌入到客户端的DHCP报文中，当服务器识别到中继代理信息选项后就会根据选项中的信息执行IP地址的分配和策略的实施。&lt;br /&gt;
	在一些大型的网络环境中，DHCP服务可以集中管理IP地址指派给大批用户，当交换机的选项82使能后，用户设备可以通过身份鉴定由交换机访问网络（除其mac地址），局域网中多个用户主机通过具有独特的身份鉴定（选项82）由交换机的同一端口访问网络。&lt;br /&gt;
	&lt;br /&gt;
	如上图，因为DHCP服务器和DHCP客户端不在同一网络或子网中，交换机配置DHCP的中继代理，通过ip help-address命令使能在dhcp服务器和客户端之间广播转发和传送dhcp消息。&lt;br /&gt;
	1． 主机（DHCP客户端）发出DHCP请求消息，并广播到网络中&lt;br /&gt;
	2． 交换机收到这条DHCP REQUEST消息，将选项82插入这个消息报中，默认情况下，RemoteID子选项是交换机的mac地址，CircuitID子选项是接收到消息的端口标示符，这些参数是可以配置的。&lt;br /&gt;
	3． 如果中继代理的IP地址有配置，交换机会添加这个IP地址到DHCP包中&lt;br /&gt;
	4． 交换机转发带有选项82的DHCP REQUEST报到DHCP服务器&lt;br /&gt;
	5． DHCP服务器收到这个信息后，如果DHCP服务器启用了选项82，服务器使用RemoteID、CircuitID或者两个子选项来分配IP地址和应用相应的策略。DHCP服务器标识选项82到DHCP回应消息。&lt;br /&gt;
	6． DHCP服务器单播DHCP REPLY到交换机（DHCP中继代理），交换机将选项字段剥去后发送给客户端。&lt;br /&gt;
	&amp;ldquo;中继信息&amp;rdquo;选项被定义为一个包含一个或多个&amp;ldquo;子选项&amp;rdquo;的单独的DHCP选项，并传送可被中继代理识别的信息。Option 82选项如同一个&amp;ldquo;容器&amp;rdquo;选项，为中继代理分配的特定的子选项在DHCP报文中提供了数据空间。&lt;br /&gt;
	CircuitID子选项（SUBOPTION）帧格式&lt;br /&gt;
	子选项类型（1字节）&lt;br /&gt;
	长度（1字节）&lt;br /&gt;
	电路ID类型&lt;br /&gt;
	长度（电路ID）&lt;br /&gt;
	&lt;br /&gt;
	其中电路ID子选项中的端口字段，端口号是从3开始的，比如对于一个24口10/100M的交换机，fa0/1端口在子选项中端口字段表示为3，fa0/2端口表示为4&amp;hellip;&amp;hellip;&lt;br /&gt;
	RemoteID子选项帧格式&lt;br /&gt;
	当交换机使能DHCP SNOOPING和ip dhcp snooping information option命令后，circuitID子选项和remoteID子选项采用以上的帧格式（默认格式）&lt;br /&gt;
	当我们全局模式下使能dhcp 监听，用户全局模式使用命令ip dhcp snooping information option format remote-id和接口模式下使用ip dhcp snooping vlan information option format-type circuit-id string命令配置了remoteID和circuiteID子选项后，circuiteID和remoteID子选项的帧格式有所变化：&lt;br /&gt;
	circuitID子选项帧格式：&lt;br /&gt;
	*circute类型为1&lt;br /&gt;
	*长度是可变的，根据用户配置的字符串扩展&lt;br /&gt;
	&lt;br /&gt;
	remoteID子选项帧格式&lt;br /&gt;
	* remote类型为1&lt;br /&gt;
	*长度是可变的，根据用户配置的字符串扩展&lt;br /&gt;
	&lt;br /&gt;
	配置DHCP 监听&lt;br /&gt;
	默认配置：&lt;br /&gt;
	特性 默认配置&lt;br /&gt;
	------------------------------------------&lt;br /&gt;
	DHCP SERVER 启用，但需要配置&lt;br /&gt;
	DHCP中继代理 启用&lt;br /&gt;
	DHCP包转发地址 没有配置&lt;br /&gt;
	核实中继代理信息 启用&lt;br /&gt;
	DHCP中继代理转发策略 代替现行的DHCP中继代理信息&lt;br /&gt;
	DHCP监听 未启用&lt;br /&gt;
	选项82 启用&lt;br /&gt;
	不信任端口是否接收DHCP监听选项 未启用&lt;br /&gt;
	限速 未配置&lt;br /&gt;
	信任状态 不信任状态&lt;br /&gt;
	VLAN的DHCP监听 未启用&lt;br /&gt;
	DHCP监听MAC地址验证 启用&lt;br /&gt;
	DHCP绑定表 启用&lt;br /&gt;
	DHCP监听绑定表 启用，但需要配置&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
	配置DHCP snooping&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 启用dhcp监听&lt;br /&gt;
	ip dhcp snooping&lt;br /&gt;
	3） 在vlan上启用dhcp 监听，如果在vlan上不启用，dhcp监听是不激活的&lt;br /&gt;
	ip dhcp snooping vlan vlan范围&lt;br /&gt;
	4） 是否插入选项82&lt;br /&gt;
	ip dhcp snooping information option&lt;br /&gt;
	5） 配置remoteID子选项（可选）&lt;br /&gt;
	ip dhcp snooping information option format remote-id [string 字符串|主机名]&lt;br /&gt;
	6） 配置汇聚交换机接收从边界交换机发来的带有选项82的数据包（可选）&lt;br /&gt;
	ip dhcp snooping information option allow-untrusted&lt;br /&gt;
	7） 进入接口模式 interface 接口&lt;br /&gt;
	8） 指定为信任端口（可选）&lt;br /&gt;
	ip dhcp snooping trust&lt;br /&gt;
	9） 配置circuiteID子选项（可选）&lt;br /&gt;
	ip dhcp snooping vlan vlan号information option format-type circuit-id string 字符串&lt;br /&gt;
	10） 设置限速&lt;br /&gt;
	ip dhcp snooping limit rate 速率&lt;br /&gt;
	速率：指定每秒传输包数，取值为1-2048&lt;br /&gt;
	11） 验证结果&lt;br /&gt;
	show ip dhcp snooping //查看dhcp监听状态&lt;br /&gt;
	show ip dhcp snooping binding //查看dhcp监听绑定表&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
	案例：&lt;br /&gt;
	switch#config terminal&lt;br /&gt;
	switch(config)#ip dhcp snooping&lt;br /&gt;
	switch(config)#ip dhcp snooping vlan 10&lt;br /&gt;
	switch(config)#interface f0/1&lt;br /&gt;
	switch(config-if)#ip dhcp snooping trust&lt;br /&gt;
	switch(config-if)#switch access vlan 10&lt;br /&gt;
	switch(config-if)#interface f0/2&lt;br /&gt;
	switch(config-if)#switch access vlan 10&lt;br /&gt;
	switch(config-if)#interface f0/3&lt;br /&gt;
	switch(config-if)#switch access vlan 10&lt;br /&gt;
	---------------------------------------------------&lt;br /&gt;
	配置与交换机f0/1相连的路由器r1为dhcp服务器&lt;br /&gt;
	r1(config)#interface f0/1&lt;br /&gt;
	r1(config-if)#ip address 192.168.1.1 255.255.255.0&lt;br /&gt;
	r1(config)#ip dhcp execlude 192.168.1.1&lt;br /&gt;
	r1(config)#ip dhcp pool cisco&lt;br /&gt;
	r1(dhcp-config)#network 192.168.1.2 255.255.255.0&lt;br /&gt;
	r1(dhcp-config)#default-route 192.168.1.1&lt;br /&gt;
	---------------------------------------------------&lt;br /&gt;
	配置与交换机f0/2相连的路由器r2模拟为主机，从dhcp服务器获得ip&lt;br /&gt;
	r2(config)#no ip routing&lt;br /&gt;
	r2(config)#int f0/0&lt;br /&gt;
	r2(config-if)#ip address dhcp&lt;br /&gt;
	------------------------------------------------------&lt;br /&gt;
	配置与交换机f0/3相连的路由器r3模拟为主机，ip地址配置为dhcp服务器地址，作为攻击者&lt;br /&gt;
	---------------------------------------------------------&lt;br /&gt;
	验证：&lt;br /&gt;
	Switch#show ip dhcp snoopi bind&lt;br /&gt;
	MacAddress IpAddress Lease(sec) Type VLAN Interface&lt;br /&gt;
	------------ ----------- ---------- --------- ------- ------------&lt;br /&gt;
	00:10:7B:3C:01:DA 192.168.1.2 85781 dhcp-snooping 10 FastEthernet0/4&lt;br /&gt;
	Total number of bindings: 2&lt;br /&gt;
	----------------------------------------------------------------------------&lt;br /&gt;
	Switch#show ip dhcp snoopi&lt;br /&gt;
	Switch DHCP snooping is enabled&lt;br /&gt;
	DHCP snooping is configured on following VLANs:&lt;br /&gt;
	10&lt;br /&gt;
	Insertion of option 82 is disabled&lt;br /&gt;
	Option 82 on untrusted port is not allowed&lt;br /&gt;
	Verification of hwaddr field is enabled&lt;br /&gt;
	Interface Trusted Rate limit (pps)&lt;br /&gt;
	------------------------ ------- ----------------&lt;br /&gt;
	FastEthernet0/1 yes unlimited&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
	配置DHCP监听的绑定表代理&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 指定绑定表代理和数据库文件位置（可选）&lt;br /&gt;
	ip dhcp snooping database flash:/文件名|tftp://文件名|ftp://用户名：密码@主机/文件名|http://[[用户名：密码]@]主机名|主机地址/目录/文件.tar&lt;br /&gt;
	3） 指定绑定表数据库传输超时时间&lt;br /&gt;
	ip dhcp snooping database timeout 秒数&lt;br /&gt;
	秒数：取值为0-86400，默认为300秒&lt;br /&gt;
	4） 值定绑定表数据库写入延迟时间&lt;br /&gt;
	ip dhcp snooping database write-delay 秒数&lt;br /&gt;
	秒数：取值为15-86400，默认为300秒（15分钟）&lt;br /&gt;
	5） 进入特权模式 end&lt;br /&gt;
	6） 手工值定绑定表条目&lt;br /&gt;
	ip dhcp snooping binding mac地址 vlan vlan号 IP地址 interface 接口 expiry 秒数&lt;br /&gt;
	expiry:这条静态条目到期的时间，取值为1-4294967295&lt;br /&gt;
	7） 验证结果&lt;br /&gt;
	show ip dhcp snooping database&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
	第五部分 IP源保护（IP Source Guard）&lt;br /&gt;
	IPSG提供检测机制来确保单个接口所接收到的数据包能够被各个接口所接收。如果检查成功通过，那么就将许可数据包；否则就会发生违背策略的活动。IPSG不仅能够确保第2层网络中终端设备的IP地址不会被劫持，而且还能确保非授权设备不能通过自己指定IP地址的方式来访问网络或导致网络崩溃及瘫痪。&lt;br /&gt;
	在DHCP监听绑定表或静态IP源绑定的帮助下，IPSG能够获得有效的源端口信息。在不信任端口上启用dhcp snooping和ip源保护之后，交换机将阻止除了dhcp数据包之外的所有流量。一旦DHCP服务器分配了IP地址，那么就更新dhcp绑定表。IPSG然后会自动在接口加载基于端口的vlan访控（PACL）。这样将客户端流量限定到绑定表中所配置的源IP地址。对于来自源IP绑定之外的其他源IP地址的主机端口的流量，将会被过滤。&lt;br /&gt;
	IP源保护只支持第2层端口，其中包括介入access和干道trunk接口。对于不信任端口（第2层），存在以下两种级别的IP流量安全过滤：&lt;br /&gt;
	* 源IP地址过滤：根据源IP地址对IP流量进行过滤，只有当源IP地址与IP源绑定条目匹配，IP流量才允许通过。&lt;br /&gt;
	当端口创建、修改、删除新的IP源绑定条目的时候，IP源地址过滤器将发生变化。为了能够反映IP源绑定的变更，端口PACL将被重新修改并重新应用到端口上。&lt;br /&gt;
	默认情况下，如果端口没有任何IP源绑定配置的情况下启用了ip源保护，默认的PACL将拒绝端口的所有流量。如果你取消了IP源保护，端口的ACL也会从接口上移除。&lt;br /&gt;
	* 源IP和MAC地址过滤：根据源IP地址和MAC地址对IP流量进行过滤，只有当源IP地址和MAC地址与IP源绑定条目匹配，IP流量才允许通过。&lt;br /&gt;
	当以IP和MAC地址作为过滤的时候，为了确保DHCP协议能够正常的工作，还必须启用DHCP监听选项82，对于没有选项82的数据，交换机不能确定用于转发DHCP服务器响应的客户端主机端口。相反地，DHCP服务器响应将被丢弃，客户机也不能获得ip地址&lt;br /&gt;
	交换机使用端口安全来过滤源maC地址，所以端口上的端口安全的违规处理将关闭。&lt;br /&gt;
	配置过程：&lt;br /&gt;
	注意：&lt;br /&gt;
	1． 在某个VLAN上启用基于源IP地址的IP源保护之前，必须先启用DHCP监听功能&lt;br /&gt;
	2． 如果是在TRUNK接口上对于多个VLAN启用IP源保护，必须在所有的VLAN上启用DHCP监听，同时要应用基于源IP过滤策略在所有的VLAN&lt;br /&gt;
	3． 启用基于源ip和mac地址的IP源保护之前，必须启用DHCP监听和端口安全（Port security）&lt;br /&gt;
	4． 在私有vlan上启用基于源ip和mac地址的IP源保护，端口安全是不支持的&lt;br /&gt;
	5． IP源保护不支持以太通道（EthenChannel）&lt;br /&gt;
	6． 在启用了802.x认证的情况下，也可以使用这种特性。&lt;br /&gt;
	配置：&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 启用IP源保护&lt;br /&gt;
	基于源IP地址的 ip verify source&lt;br /&gt;
	基于源IP和MAC地址的 ip verify source port-security&lt;br /&gt;
	注意：dhcp服务器必须支持选项82，或者客户端没有分配到IP地址。同时MAC地址不能被学习为安全地址&lt;br /&gt;
	5） 进入全局模式，添加静态的IP源绑定&lt;br /&gt;
	ip source binding mac地址 vlan vlan号 ip地址 interface 接口&lt;br /&gt;
	6） 验证结果&lt;br /&gt;
	show ip verify source [interface 接口]&lt;br /&gt;
	show ip source binding [ip地址] [mac地址] [interfac, e 接口] [vlan vlan号] [dhcp snooping|static]&lt;br /&gt;
	案例：&lt;br /&gt;
	我们接着上部分试验继续&lt;br /&gt;
	Switch(config)#interface f0/2&lt;br /&gt;
	Switch(config-if)#switchport port-security&lt;br /&gt;
	Switch(config-if)#ip verify source port-security&lt;br /&gt;
	Switch(config)#interface f0/3&lt;br /&gt;
	Switch(config-if)#switchport port-security&lt;br /&gt;
	Switch(config-if)#ip verify source port-security&lt;br /&gt;
	Switch(config-if)#exit&lt;br /&gt;
	Switch(config)#ip source binding 00e0.1e60.7c86 vlan 10 192.168.1.1 interface f0/1&lt;br /&gt;
	Switch(config)#end&lt;br /&gt;
	Switch#show ip source bind&lt;br /&gt;
	MacAddress IpAddress Lease(sec) Type VLAN Interface&lt;br /&gt;
	---------- ----------- ---------- ------------- ---- ----------------&lt;br /&gt;
	00:10:7B:3C:01:DA 192.168.1.2 85535 dhcp-snooping 10 fastEthernet0/2&lt;br /&gt;
	00:E0:1E:60:7C:86 192.168.1.1 infinite static 10 fastEthernet0/1&lt;br /&gt;
	Total number of bindings: 3&lt;br /&gt;
	----------------------------------------------------------------&lt;br /&gt;
	Switch#show ip verify source&lt;br /&gt;
	Interface Filter-type Filter-mode IP-address Mac-address Vlan&lt;br /&gt;
	--------- ---------- ----------- --------------- ------------- ----------&lt;br /&gt;
	Fa0/2 ip-mac active 192.168.1.2 permit-all 10&lt;br /&gt;
	Fa0/3 ip-mac active deny-all permit-all 10&lt;br /&gt;
	&lt;br /&gt;
	第六部分 动态ARP检测&lt;br /&gt;
	DAI(Dynamic ARP Inspection)动态ARP检测是一种能够验证网络中ARP地址解析协议数据报的安全特性。通过DAI，网络管理员能够拦截、记录和丢弃具有无效MAC地址/IP地址绑定的ARP数据包。&lt;br /&gt;
	&lt;br /&gt;
	如上图，主机A、主机B、主机C连接到交换机中相同的网络或同一个vlan中。主机A需要与主机B进行通信，主机A广播ARP请求通过主机B的IP地址（IB）来获得主机B的MAC地址。因为ARP请求是以广播的形式传送，交换机和主机B收到主机A发出的ARP请求之后，会在自己的ARP缓存中创建或更新主机A的MAC地址（MA）和IP地址（IA），然后主机B一单播得形式发送ARP响应，交换机和主机A收到ARP响应之后，主机A将更新自己的ARP缓存，将主机B的IP地址和MAC地址对应。&lt;br /&gt;
	主机C破坏交换机的ARP缓存，主机C发送伪造的ARP响应（将自己的MAC地址代替真实主机的MAC地址，比如主机C用自己的MAC地址（MC）替代主机B发给主机A的MAC地址（MB）），使得主机A（或主机B）的IP地址和主机C的MAC地址（MC）对应，主机C以中间人的身份发起攻击。这样造成主机A不能拥有主机B真实的MAC地址的ARP条目，同样，主机B也认为主机C的MAC地址是映射到主机A IP地址的真实地址。对于主机A和主机B之间的通信，都会被发往主机C，主机C能够在阅读内容后进行流量的重定向。&lt;br /&gt;
	动态ARP检测是一个安全特性，通过DAI，网络管理员能够检测、拦截、记录和丢弃具有无效MAC地址/IP地址绑定的ARP数据包。能够预防&amp;ldquo;中间人&amp;rdquo;的攻击。&lt;br /&gt;
	动态ARP检测只会转发合法的ARP请求和响应包，他会：&lt;br /&gt;
	* 检测不信任的端口上的所有ARP请求和响应包&lt;br /&gt;
	* 在更新本地的ARP缓存和转发ARP数据包到目的地之前，会检测是否是合法的IP和MAC地址对应内容。&lt;br /&gt;
	* 如果确认是不合法的数据包，他会丢弃数据包并记录这个违规的行为。&lt;br /&gt;
	动态ARP检测依据一个信任的数据库（如手工配置或dhcp监听绑定表）中合法的IP对应MAC地址的条目来判断数据包的合法性。这个数据库可以手工指定配置或者在vlan中启用了dhcp监听动态学习建立。如果ARP数据包是在信任端口上接收到的，交换机不会做任何检测直接转发ARP数据包。如果是从不信任端口上接收到ARP数据包，交换机只会转发合法的数据包。&lt;br /&gt;
	在DHCP服务器存在的环境下，可以在每个VLAN中启用DHCP监听和ip arp inspection vlan命令来启用动态ARP检测。如果没有DHCP环境，用户需要使用arp 访问列表手工配置IP地址来启用动态ARP检测合法的数据包。&lt;br /&gt;
	接口信任状态和网络安全&lt;br /&gt;
	如果ARP数据包是在信任端口上接收到的，交换机不会做任何检测直接转发ARP数据包。如果是从不信任端口上接收到ARP数据包，交换机只会转发合法的数据包。&lt;br /&gt;
	在一个典型的网络中，交换机中所有连接主机的端口配置为不信任端口，所有交换机与交换机相连的端口配置为信任端口。如下图，交换机A和交换机B运行动态ARP检测，主机1和主机2需要从连接到交换机A的dhcp服务器来获得IP地址，交换机1建立主机1和主机2的IP和MAC地址的绑定信息，交换机B建立主机2的IP和MAC地址的绑定信息。如果交换机A和交换机B连接的端口设置为不信任端口，从主机1发出的ARP数据包到达交换机B时，会被交换机B丢弃，这样主机1和主机2的联系就中断了。&lt;br /&gt;
	&lt;br /&gt;
	配置过程：&lt;br /&gt;
	默认配置：&lt;br /&gt;
	特性 默认配置&lt;br /&gt;
	-----------------------------------------&lt;br /&gt;
	动态ARP检测 所有vlan中不启用&lt;br /&gt;
	接口信任状态 所有接口是不信任&lt;br /&gt;
	进入ARP数据包流量限制 不信任端口：15 pps信任端口：没有限制&lt;br /&gt;
	没有dhcp环境下的arp访控 没有定义&lt;br /&gt;
	合法核实 没有核实允许&lt;br /&gt;
	日志缓冲 所有拒绝和丢弃arp数据包的行为都会被记录日志的缓冲大小为32系统信息数被限制为5秒钟一次&lt;br /&gt;
	每个vlan的日志 所有的拒绝和丢弃的行为都被记录&lt;br /&gt;
	配置DHCP环境的DAI&lt;br /&gt;
	1） 配置相应的DHCP监听和IP源保护&lt;br /&gt;
	2） 进入全局模式 configure terminal&lt;br /&gt;
	3） 在指定的vlan上启用动态ARP检测&lt;br /&gt;
	ip arp inspection vlan vlan范围&lt;br /&gt;
	4） 进入接口模式 interface 接口&lt;br /&gt;
	5） 指定信任端口&lt;br /&gt;
	ip arp inspection trust&lt;br /&gt;
	6） 验证结果&lt;br /&gt;
	show ip arp inspection&lt;br /&gt;
	show ip arp inspection database&lt;br /&gt;
	show ip arp inspection vlan vlan号&lt;br /&gt;
	show ip arp inspection statistes vlan vlan号&lt;br /&gt;
	案例：&lt;br /&gt;
	&lt;br /&gt;
	swA#config terminal&lt;br /&gt;
	swA(config)#ip dhcp snooping&lt;br /&gt;
	swA(config)#ip dhcp snooping vlan 10&lt;br /&gt;
	swA(config)#ip arp inspection vlan 10&lt;br /&gt;
	swA(config)#interface f0/1&lt;br /&gt;
	swA(config-if)#ip dhcp snooping trust&lt;br /&gt;
	swA(config-if)#switch access vlan 10&lt;br /&gt;
	swA(config-if)#interface f0/2&lt;br /&gt;
	swA(config-if)#switch access vlan 10&lt;br /&gt;
	swA(config)#interface f0/23&lt;br /&gt;
	swA(config-if)#ip arp inspection trust&lt;br /&gt;
	--------------------------------------------------&lt;br /&gt;
	swB#config terminal&lt;br /&gt;
	swB(config)#ip dhcp snooping&lt;br /&gt;
	swB(config)#ip dhcp snooping vlan 10&lt;br /&gt;
	swB(config)#ip arp inspection vlan 10&lt;br /&gt;
	swB(config-if)#interface f0/3&lt;br /&gt;
	swB(config-if)#switch access vlan 10&lt;br /&gt;
	swB(config)#interface f0/23&lt;br /&gt;
	swB(config-if)#ip arp inspection trust&lt;br /&gt;
	swB(config-if)#ip dhcp snooping trust&lt;br /&gt;
	-----------------------------------------------------------&lt;br /&gt;
	与交换机A fa0/1相连的路由器扮演dhcp服务器的角色&lt;br /&gt;
	dhcpserver#conf ter&lt;br /&gt;
	dhcpserver(config)#ip dhcp excluded-address 192.168.1.1&lt;br /&gt;
	dhcpserver(config)#ip dhcp pool cisco&lt;br /&gt;
	dhcpserver(dhcp-config)#network 192.168.1.0 255.255.255.0&lt;br /&gt;
	dhcpserver(dhcp-config)#default-route 192.168.1.1&lt;br /&gt;
	-------------------------------------------------------------&lt;br /&gt;
	与交换机A fa0/2相连的路由器扮演主机1的角色&lt;br /&gt;
	host1(config)#no ip routing&lt;br /&gt;
	host1(config)#int e0&lt;br /&gt;
	host1(config-if)#ip address dhcp&lt;br /&gt;
	-------------------------------------------------------------&lt;br /&gt;
	与交换机B fa0/3相连的路由器扮演主机2的角色&lt;br /&gt;
	host2(config)#no ip routing&lt;br /&gt;
	host2(config)#int f0/0&lt;br /&gt;
	host2(config-if)#ip address dhcp&lt;br /&gt;
	------------------------------------------------------------&lt;br /&gt;
	SWA#show ip dhcp snoo bind&lt;br /&gt;
	MacAddress IpAddress Lease(sec) Type VLAN Interface&lt;br /&gt;
	------------- -------------- ---------- ---------- ---- ----------------&lt;br /&gt;
	00:E0:1E:60:7C:86 192.168.1.2 83702 dhcp-snooping 10 FastEthernet0/2&lt;br /&gt;
	Total number of bindings: 1&lt;br /&gt;
	-------------------------------------------------------------------------&lt;br /&gt;
	SWA#show ip arp inspection&lt;br /&gt;
	Source Mac Validation : Disabled&lt;br /&gt;
	Destination Mac Validation : Disabled&lt;br /&gt;
	IP Address Validation : Disabled&lt;br /&gt;
	Vlan Configuration Operation ACL Match Static ACL&lt;br /&gt;
	---- ------------- --------- --------- ----------&lt;br /&gt;
	10 Enabled Active&lt;br /&gt;
	Vlan ACL Logging DHCP Logging&lt;br /&gt;
	---- ----------- ------------&lt;br /&gt;
	10 Deny Deny&lt;br /&gt;
	Vlan Forwarded Dropped DHCP Drops ACL Drops&lt;br /&gt;
	---- --------- ------- ---------- ---------&lt;br /&gt;
	10 0 0 0 0&lt;br /&gt;
	Vlan DHCP Permits ACL Permits Source MAC Failures&lt;br /&gt;
	---- ------------ ----------- -------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data&lt;br /&gt;
	---- ----------------- ---------------------- ---------------------&lt;br /&gt;
	&lt;br /&gt;
	Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data&lt;br /&gt;
	---- ----------------- ---------------------- ---------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	------------------------------------------------------------------------&lt;br /&gt;
	SWA#show ip arp inspection statistics vlan 10&lt;br /&gt;
	Vlan Forwarded Dropped DHCP Drops ACL Drops&lt;br /&gt;
	---- --------- ------- ---------- ---------&lt;br /&gt;
	10 0 0 0 0&lt;br /&gt;
	Vlan DHCP Permits ACL Permits Source MAC Failures&lt;br /&gt;
	---- ------------ ----------- -------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data&lt;br /&gt;
	---- ----------------- ---------------------- ---------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	-------------------------------------------------------------------------&lt;br /&gt;
	SWA#show ip arp inspection inter&lt;br /&gt;
	Interface Trust State Rate (pps) Burst Interval&lt;br /&gt;
	--------------- ----------- ---------- --------------&lt;br /&gt;
	Fa0/1 Untrusted 15 1&lt;br /&gt;
	Fa0/2 Untrusted 15 1&lt;br /&gt;
	Fa0/3 Untrusted 15 1&lt;br /&gt;
	Fa0/4 Untrusted 15 1&lt;br /&gt;
	Fa0/5 Untrusted 15 1&lt;br /&gt;
	Fa0/6 Untrusted 15 1&lt;br /&gt;
	Fa0/7 Untrusted 15 1&lt;br /&gt;
	Fa0/8 Untrusted 15 1&lt;br /&gt;
	Fa0/9 Untrusted 15 1&lt;br /&gt;
	Fa0/10 Untrusted 15 1&lt;br /&gt;
	Fa0/11 Untrusted 15 1&lt;br /&gt;
	Fa0/12 Untrusted 15 1&lt;br /&gt;
	Fa0/13 Untrusted 15 1&lt;br /&gt;
	Fa0/14 Untrusted 15 1&lt;br /&gt;
	Fa0/15 Untrusted 15 1&lt;br /&gt;
	Fa0/16 Untrusted 15 1&lt;br /&gt;
	Fa0/17 Untrusted 15 1&lt;br /&gt;
	Fa0/18 Untrusted 15 1&lt;br /&gt;
	Fa0/19 Untrusted 15 1&lt;br /&gt;
	Fa0/20 Untrusted 15 1&lt;br /&gt;
	Fa0/21 Untrusted 15 1&lt;br /&gt;
	Fa0/22 Untrusted 15 1&lt;br /&gt;
	Fa0/23 Trusted None N/A&lt;br /&gt;
	Fa0/24 Untrusted 15 1&lt;br /&gt;
	Gi0/1 Untrusted 15 1&lt;br /&gt;
	Gi0/2 Untrusted 15 1&lt;br /&gt;
	Po13 Untrusted 15 1&lt;br /&gt;
	Po14 Untrusted 15 1&lt;br /&gt;
	--------------------------------------------------------------&lt;br /&gt;
	SWB#show ip arp inspection vlan 10&lt;br /&gt;
	Source Mac Validation : Disabled&lt;br /&gt;
	Destination Mac Validation : Disabled&lt;br /&gt;
	IP Address Validation : Disabled&lt;br /&gt;
	Vlan Configuration Operation ACL Match Static ACL&lt;br /&gt;
	---- ------------- --------- --------- ----------&lt;br /&gt;
	10 Enabled Active&lt;br /&gt;
	Vlan ACL Logging DHCP Logging&lt;br /&gt;
	---- ----------- ------------&lt;br /&gt;
	10 Deny Deny&lt;br /&gt;
	-------------------------------------------------------------------&lt;br /&gt;
	SWA#show ip arp inspection statistics&lt;br /&gt;
	Vlan Forwarded Dropped DHCP Drops ACL Drops&lt;br /&gt;
	---- --------- ------- ---------- ---------&lt;br /&gt;
	10 13 45 45 0&lt;br /&gt;
	Vlan DHCP Permits ACL Permits Source MAC Failures&lt;br /&gt;
	---- ------------ ----------- -------------------&lt;br /&gt;
	10 1 0 0&lt;br /&gt;
	Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data&lt;br /&gt;
	---- ----------------- ---------------------- ---------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	-----------------------------------------------------------------------&lt;br /&gt;
	检测攻击&lt;br /&gt;
	我们将主机2模拟为攻击者，将主机2的IP地址配置为主机1的IP地址&lt;br /&gt;
	Rack11SW2#ping 192.168.1.2&lt;br /&gt;
	Type escape sequence to abort.&lt;br /&gt;
	Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:&lt;br /&gt;
	14:36:50: %SW_DAI-4-DHCP_SNOOPING_DENY: 1 Invalid ARPs (Req) on Fa0/3, vlan 10.([0013.1a7f.8c21/192.168.1.2/0000.0000.0000/11.11.36.6/14:36:49 UTC Mon Mar 1 1993]).&lt;br /&gt;
	14:36:51: %SW_DAI-4-DHCP_SNOOPING_DENY: 1 Invalid ARPs (Res) on Fa0/3, vlan 10.([0013.1a7f.8c21/192.168.1.2/000d.bde6.a880/192.168.1.200/14:36:50 UTC Mon Mar 1 1993]).&lt;br /&gt;
	14:36:55: %SW_DAI-4-DHCP_SNOOPING_DENY: 1 Invalid ARPs (Res) on Fa0/3, vlan 10.([0013.1a7f.8c21/192.168.1.2/000d.bde6.a880/192.168.1.200/14:36:54 UTC Mon Mar 1 1993]).&lt;br /&gt;
	Success rate is 0 percent (0/5)&lt;br /&gt;
	----------------------------------------------------------------------------&lt;br /&gt;
	SWB#show arp&lt;br /&gt;
	Protocol Address Age (min) Hardware Addr Type Interface&lt;br /&gt;
	Internet 192.168.1.2 0 Incomplete ARPA&lt;br /&gt;
	配置非DHCP环境的动态ARP检测&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 定义arp的访问控制列表&lt;br /&gt;
	arp access-list 访控名称&lt;br /&gt;
	3） 定义允许列表内容&lt;br /&gt;
	permit ip host 发送者IP地址 mac host 发送者MAC地址&lt;br /&gt;
	4） 将arp访控应用到指定的vlan&lt;br /&gt;
	ip arp inspection filter arp访控名称 vlan vlan范围 [static]&lt;br /&gt;
	static:使用这个参数，访控将使用隐含的deny语句来拒绝arp数据包&lt;br /&gt;
	5） 验证结果&lt;br /&gt;
	show arp access-list&lt;br /&gt;
	案例：&lt;br /&gt;
	&lt;br /&gt;
	如图，把交换机A上相连的dhcp服务器去除，交换机B也配置了动态ARP检测。如果我们把交换机A的端口1配置为信任端口，因为信任端口是不会对arp数据包做任何的检测，这样交换机B或者主机2对交换机A和主机1会造成arp的攻击。这样交换机A的端口1配置为非信任端口，但为了主机2和主机1之间通信，必须在交换机A上应用一个arp访问控制列表允许主机2访问。如果主机2的IP地址不是静态的，必须将交换机A和交换机B在第3层上分隔开，两者之间添加路由器来路由两者之间的数据包。&lt;br /&gt;
	SwA#config terminal&lt;br /&gt;
	SWA(config)#arp access-list cisco&lt;br /&gt;
	SWA(config-arp-nacl)#permit ip host 192.168.1.3 mac host 0013.1a7f.8c21&lt;br /&gt;
	SWA(config-arp-nacl)#exit&lt;br /&gt;
	SWA(config)#int f0/23&lt;br /&gt;
	SWA(config-if)#no ip arp inspection trust&lt;br /&gt;
	SWA(config-if)#end&lt;br /&gt;
	SWA(config)#ip arp inspection filter cisco vlan 10&lt;br /&gt;
	--------------------------------------------------------------------------&lt;br /&gt;
	SWA#show arp access-list&lt;br /&gt;
	ARP access list cisco&lt;br /&gt;
	permit ip host 192.168.1.3 mac host 0013.1a7f.8c21&lt;br /&gt;
	-------------------------------------------------------------------------&lt;br /&gt;
	SWA#show ip arp inspection&lt;br /&gt;
	Source Mac Validation : Disabled&lt;br /&gt;
	Destination Mac Validation : Disabled&lt;br /&gt;
	IP Address Validation : Disabled&lt;br /&gt;
	Vlan Configuration Operation ACL Match Static ACL&lt;br /&gt;
	---- ------------- --------- --------- ----------&lt;br /&gt;
	10 Enabled Active cisco No&lt;br /&gt;
	Vlan ACL Logging DHCP Logging&lt;br /&gt;
	---- ----------- ------------&lt;br /&gt;
	10 Deny Deny&lt;br /&gt;
	Vlan Forwarded Dropped DHCP Drops ACL Drops&lt;br /&gt;
	---- --------- ------- ---------- ---------&lt;br /&gt;
	10 21 45 45 0&lt;br /&gt;
	Vlan DHCP Permits ACL Permits Source MAC Failures&lt;br /&gt;
	---- ------------ ----------- -------------------&lt;br /&gt;
	10 9 0 0&lt;br /&gt;
	Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data&lt;br /&gt;
	---- ----------------- ---------------------- ---------------------&lt;br /&gt;
	&lt;br /&gt;
	Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data&lt;br /&gt;
	---- ----------------- ---------------------- ---------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	配置ARP数据包的流量限制&lt;br /&gt;
	当进入的ARP数据包超过了配置的流量限定，交换机会将这个端口进入到err-disable状态。这个端口一直保持这种状态到err-disable恢复时间到期&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置ARP数据包的流量限制&lt;br /&gt;
	ip arp inspection limit rate 每秒包数 [burst interval 秒数]&lt;br /&gt;
	PPS：每秒多少数据包，取值为0-2048，非信任端口上默认为每秒15数据包，信任端口上没有流量限制&lt;br /&gt;
	Burst interval:突发时间间隔，取值为1-15&lt;br /&gt;
	4） 配置使能端口err-disable状态的恢复&lt;br /&gt;
	errdisable recovery cause arp-inspection interval 秒数&lt;br /&gt;
	默认情况下，err-disable恢复是关闭的，恢复时间为300秒，取值为30-86400&lt;br /&gt;
	5） 验证结果&lt;br /&gt;
	show ip arp inspection interface&lt;br /&gt;
	SWA# show ip arp inspection interface f0/23&lt;br /&gt;
	Interface Trust State Rate (pps) Burst Interval&lt;br /&gt;
	--------------- ----------- ---------- --------------&lt;br /&gt;
	Fa0/23 Untrusted 200 5&lt;br /&gt;
	合法性的检查&lt;br /&gt;
	网络管理员能够根据IP对应MAC地址的绑定的合法性来拦截、记录和丢弃具有无效MAC地址/IP地址绑定的ARP数据包。交换机能够配置以目标的MAC地址、IP地址和源MAC地址来作为核实的依据。&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 配置合法性的检查依据&lt;br /&gt;
	ip arp inspection validate [src-mac|dst-mac|ip]&lt;br /&gt;
	3） 验证结果&lt;br /&gt;
	SWA#show ip arp inspection statistics vlan 10&lt;br /&gt;
	Vlan Forwarded Dropped DHCP Drops ACL Drops&lt;br /&gt;
	---- --------- ------- ---------- ---------&lt;br /&gt;
	10 0 0 0 0&lt;br /&gt;
	Vlan DHCP Permits ACL Permits Source MAC Failures&lt;br /&gt;
	---- ------------ ----------- -------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data&lt;br /&gt;
	---- ----------------- ---------------------- ---------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	配置日志的缓冲&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 配置日志缓冲&lt;br /&gt;
	ip arp inspection log-buffer entrie 条数 | logs 数目 interval 秒数&lt;br /&gt;
	entrie 数目：指定日志缓冲的条目个数，取值为0-1024&lt;br /&gt;
	logs 数目 interval 秒数：在指定的时间间隔内，产生系统信息的条目数目&lt;br /&gt;
	3） 指定记录日志的类型，默认情况下，所有拒绝和丢弃的行为都会被记录。&lt;br /&gt;
	ip arp inspection vlan vlan值 logging acl-match [matchlog] | dhcp-bindings [all|none|permit]&lt;br /&gt;
	acl-match:记录符合arp 访控列表条目permit或deny的内容&lt;br /&gt;
	dhcp-bindings:记录匹配dhcp绑定表的内容&lt;br /&gt;
	4） 验证结果&lt;br /&gt;
	show ip arp inspection log&lt;br /&gt;
	案例：&lt;br /&gt;
	SWA(config)#ip arp inspection log-buffer entrie 15&lt;br /&gt;
	SWA(config)#ip arp inspection log-buffer logs 100 interval 60000&lt;br /&gt;
	SWA#show ip arp inspection log&lt;br /&gt;
	Total Log Buffer Size : 15&lt;br /&gt;
	Syslog rate : 100 entries per 60000 seconds.&lt;br /&gt;
	Interface Vlan Sender MAC Sender IP Num Pkts Reason Time&lt;br /&gt;
	---------- ---- -------------- ---------- ------- ----------- ----&lt;br /&gt;
	Fa0/3 10 0013.1a7f.8c21 192.168.1.3 1 DHCP Deny 15:59:31 UTC&lt;br /&gt;
	&lt;br /&gt;
	Mon Mar 1 1993&amp;nbsp;&lt;/p&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/11/22/sysu-nat.html&quot;&gt;出口ip,mark一下&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/03/9/tcp.html&quot;&gt;TCP: SYN ACK FIN RST PSH URG 详解&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/02/24/linux-clear.html&quot;&gt;linux入侵踪迹隐藏攻略&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/01/19//&quot;&gt;一个Linux下的入侵响应案&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2012/01/11/switch-Security.html&quot;&gt;http://blog.hi-suke.com/2012/01/11/switch-Security.html&lt;/a&gt;&lt;/p&gt;</content><author xmlns="http://www.w3.org/2005/Atom"><name>vision4fun</name></author><content:encoded>&lt;p&gt;
	&lt;a href=&quot;http://www.nchome.cn/news_view.asp?id=91&quot;&gt;http://www.nchome.cn/news_view.asp?id=91&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
	第一部分 端口安全&lt;/p&gt;
&lt;p&gt;
	端口安全是一种第2层特性，并且能够提供如下5种保护特性：&lt;br /&gt;
	l 基于主机MAC地址允许流量&lt;br /&gt;
	l 基于主机MAC地址限制流量&lt;br /&gt;
	l 在期望的端口上阻塞单播扩散&lt;br /&gt;
	l 避免MAC扩散攻击&lt;br /&gt;
	l 避免MAC欺骗攻击&lt;br /&gt;
	第一. 基于主机的MAC地址允许流量&lt;br /&gt;
	端口安全能够基于主机MAC地址而允许流量。单个端口能够允许一个以上到某个特定数目的MAC地址。根据交换机型号的不同，他们所允许的最大MAC地址数也不相同。这种特性有助于规定每个端口所允许的主机数。例如，通过将用户端口限制到1个学到的MAC地址，而将会议室端口限制到10个MAC地址，将有助于避免网络的非授权访问。&lt;br /&gt;
	通过如下步骤，将可以根据主机MAC地址来允许流量，进而启动端口安全：&lt;br /&gt;
	步骤1：对存在问题的端口启用端口安全&lt;br /&gt;
	步骤2：配置学习主机MAC地址&lt;br /&gt;
	步骤3：指定安全违背行为（默认行为是永久性地关闭端口）&lt;br /&gt;
	步骤4：如果安全违背行为准备关闭端口，就需要配置err-disable计时器，err-disable计时器是一个全局值。&lt;br /&gt;
	配置过程&lt;br /&gt;
	1． 配置每个端口所允许的最大MAC地址数&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置接口模式&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; switchport mode access|trunk&lt;br /&gt;
	注意：一个接口使用默认模式（动态协商）不能启用端口安全&lt;br /&gt;
	4） 设置最大MAC数&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; swtichport port-security maximum 最大值&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; switchport port-security vlan vlan列表 [access|voice]&lt;br /&gt;
	可以设置每个VLAN中允许的最大MAC数，access表示为该vlan是接入vlan，voice表示该vlan是语音vlan&lt;br /&gt;
	2．配置端口允许的MAC地址&lt;br /&gt;
	1） 进入接口模式 interface 接口&lt;br /&gt;
	2） 配置允许的MAC地址&lt;br /&gt;
	手工指定：&lt;br /&gt;
	&amp;nbsp; &amp;nbsp;switchport port-security mac-address mac地址 [vlan vlan号|[access|voice]]&lt;br /&gt;
	动态学习：交换机可以动态学习MAC地址并加入到MAC地址表中，当交换机重新启动后将丢失&lt;br /&gt;
	粘性地址：可以动态学习或手工配置，学习后MAC地址加入到MAC地址表，如果保存配置文件，当交换机重新启动后，交换机不再需要动态学习的那些之前动态学习的地址了&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; switchport port-security mac-address sticky&lt;br /&gt;
	3. 配置安全违背行为&lt;br /&gt;
	1） 进入接口模式 interface 接口&lt;br /&gt;
	2） 配置违规后的动作&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; switchport port-security violation protect|restrict|shutdown&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; protect:保护，当安全MAC地址数量达到了端口所允许的最大MAC地址数的时候，交换机会继续工作，但将把来自新主机的数据帧丢弃，直到删 除足够数量的MAC地址使其低于最大值。&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; Restrict:限制，交换机继续工作，向网络管理站（SNMP）发出一个陷阱trap通告&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; Shutdown:关闭，交换机将永久性或在特定时间周期内err-disable端口，并发送一个SNMP的trap陷阱通告&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; 需要配置关闭模式下的err-disable计时器&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; err-disable recovery cause secure-violation&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; 启用err-disable&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; err-disable recovery interval 计时器&lt;br /&gt;
	案例：&lt;br /&gt;
	Switch(config)# interface gigabitethernet0/1&lt;br /&gt;
	Switch(config-if)# switchport mode access&lt;br /&gt;
	Switch(config-if)# switchport port-security&lt;br /&gt;
	Switch(config-if)# switchport port-security maximum 50&lt;br /&gt;
	Switch(config-if)# switchport port-security mac-address sticky&lt;br /&gt;
	--------------------------------------------------------------------&lt;br /&gt;
	Switch(config)# interface f0/1&lt;br /&gt;
	Switch(config-if)# switchport mode access&lt;br /&gt;
	Switch(config-if)# switchport port-security&lt;br /&gt;
	Switch(config-if)# switchport port-security maximum 1&lt;br /&gt;
	Switch(config-if)# switchport port-security mac-address 0000.0000.0008&lt;br /&gt;
	Switch(config-if)# switchport port-security violation restrict&lt;br /&gt;
	Switch(config)# interface f0/2&lt;br /&gt;
	Switch(config-if)# switchport mode access&lt;br /&gt;
	Switch(config-if)# switchport port-security&lt;br /&gt;
	Switch(config-if)# switchport port-security maximum 1&lt;br /&gt;
	Switch(config-if)# switchport port-security mac-address 0000.0000.0011&lt;br /&gt;
	Switch(config-if)# switchport port-security violation shutdown&lt;br /&gt;
	-----------------------------------------------------------------------&lt;br /&gt;
	案例：&lt;br /&gt;
	Switch(config)#int f0/1&lt;br /&gt;
	Switch(config-if)#switchport port-security&lt;br /&gt;
	Command rejected: Fa0/1 is not an access port. //先启动端口安全会出现错误提示&lt;br /&gt;
	Switch(config-if)#swit mode access&lt;br /&gt;
	Switch(config-if)#switchport port-security //启动端口安全&lt;br /&gt;
	Switch(config-if)#switchport port-security maximum ?&lt;br /&gt;
	&amp;nbsp; &amp;lt;1-132&amp;gt; Maximum addresses&lt;br /&gt;
	Switch(config-if)#do show mac-address-table&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Mac Address Table&lt;br /&gt;
	-------------------------------------------&lt;br /&gt;
	Vlan Mac Address Type Ports&lt;br /&gt;
	---- ----------- -------- -----&lt;br /&gt;
	&amp;nbsp;All 000d.6564.0280 STATIC CPU&lt;br /&gt;
	&amp;nbsp;All 0100.0ccc.cccc STATIC CPU&lt;br /&gt;
	&amp;nbsp;All 0100.0ccc.cccd STATIC CPU&lt;br /&gt;
	&amp;nbsp;All 0100.0cdd.dddd STATIC CPU&lt;br /&gt;
	&amp;nbsp; &amp;nbsp;1 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp; &amp;nbsp;1 0010.7b35.e9b6 DYNAMIC Fa0/1 //这是和路由器相连的地址&lt;br /&gt;
	&amp;nbsp; &amp;nbsp;1 00a1.b003.3cd7 DYNAMIC Fa0/18&lt;br /&gt;
	&amp;nbsp; 10 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp; 20 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp; 30 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp; 40 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp;100 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp;200 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp;201 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	&amp;nbsp;202 000b.5f2c.2097 DYNAMIC Fa0/23&lt;br /&gt;
	Total Mac Addresses for this criterion: 15&lt;br /&gt;
	------------------------------------------------------------------&lt;br /&gt;
	Switch(config-if)#switchport port-security mac-address 0010.7b35.e9b6&lt;br /&gt;
	Switch(config-if)#switchport port-security violation shutdown&lt;br /&gt;
	Switch#show port-security interface f0/1&lt;br /&gt;
	Port Security : Enabled&lt;br /&gt;
	Port Status : Secure-up&lt;br /&gt;
	Violation Mode : Shutdown&lt;br /&gt;
	Aging Time : 0 mins&lt;br /&gt;
	Aging Type : Absolute&lt;br /&gt;
	SecureStatic Address Aging : Disabled&lt;br /&gt;
	Maximum MAC Addresses : 1&lt;br /&gt;
	Total MAC Addresses : 1&lt;br /&gt;
	Configured MAC Addresses : 1&lt;br /&gt;
	Sticky MAC Addresses : 0&lt;br /&gt;
	Last Source Address : 0010.7b35.e9b6&lt;br /&gt;
	Security Violation Count : 1&lt;br /&gt;
	-----------------------------------------------------&lt;br /&gt;
	Switch#show port-security&lt;br /&gt;
	Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (Count) (Count) (Count)&lt;br /&gt;
	---------------------------------------------------------------------------&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; Fa0/1 1 1 0 Shutdown&lt;br /&gt;
	---------------------------------------------------------------------------&lt;br /&gt;
	Total Addresses in System (excluding one mac per port) : 0&lt;br /&gt;
	Max Addresses limit in System (excluding one mac per port) : 1024&lt;br /&gt;
	---------------------------------------------------------------------------&lt;br /&gt;
	Switch#show port-security address&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Secure Mac Address Table&lt;br /&gt;
	-------------------------------------------------------------------&lt;br /&gt;
	Vlan Mac Address Type Ports Remaining Age&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(mins)&lt;br /&gt;
	---- ----------- ---- ----- -------------&lt;br /&gt;
	&amp;nbsp; &amp;nbsp;1 0010.7b35.e9b6 SecureConfigured Fa0/1 -&lt;br /&gt;
	-------------------------------------------------------------------&lt;br /&gt;
	Total Addresses in System (excluding one mac per port) : 0&lt;br /&gt;
	Max Addresses limit in System (excluding one mac per port) : 1024&lt;br /&gt;
	现在我们把mac地址为00a1.b003.3cd7的主机接入到f0/1中，此时会出现如下的信息：&lt;br /&gt;
	00:24:08: %PM-4-ERR_DISABLE: psecure-violation error detected on Fa0/1, putting&lt;br /&gt;
	Fa0/1 in err-disable state&lt;br /&gt;
	00:24:08: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address 00a1.b003.3cd7 on port FastEthernet0/1.&lt;br /&gt;
	00:24:09: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, chang&lt;br /&gt;
	ed state to down&lt;br /&gt;
	00:24:10: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to down&lt;br /&gt;
	-----------------------------------------&lt;br /&gt;
	Switch#show port-security&lt;br /&gt;
	Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (Count) (Count) (Count)&lt;br /&gt;
	---------------------------------------------------------------------------&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; Fa0/1 1 1 1 Shutdown&lt;br /&gt;
	---------------------------------------------------------------------------&lt;br /&gt;
	Total Addresses in System (excluding one mac per port) : 0&lt;br /&gt;
	Max Addresses limit in System (excluding one mac per port) : 1024&lt;br /&gt;
	-------------------------------------------------------------------&lt;br /&gt;
	Switch#show port-security interface f0/1&lt;br /&gt;
	Port Security : Enabled&lt;br /&gt;
	Port Status : Secure-shutdown&lt;br /&gt;
	Violation Mode : Shutdown&lt;br /&gt;
	Aging Time : 0 mins&lt;br /&gt;
	Aging Type : Absolute&lt;br /&gt;
	SecureStatic Address Aging : Disabled&lt;br /&gt;
	Maximum MAC Addresses : 1&lt;br /&gt;
	Total MAC Addresses : 1&lt;br /&gt;
	Configured MAC Addresses : 1&lt;br /&gt;
	Sticky MAC Addresses : 0&lt;br /&gt;
	Last Source Address : 00a1.b003.3cd7&lt;br /&gt;
	Security Violation Count : 1&lt;br /&gt;
	4．配置MAC地址持续时间&lt;br /&gt;
	1） 进入接口模式 interface 接口&lt;br /&gt;
	2） 配置持续时间&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; switchport port-security aging time 时间 type absolute|inactivity&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; absolute模式：当持续时间过后，安全端口上的地址将被绝对删除&lt;br /&gt;
	&amp;nbsp; &amp;nbsp; inactivity模式：在持续时间内，没有使用的端口将被删除&lt;br /&gt;
	案例：&lt;br /&gt;
	Switch(config)# interface gigabitethernet0/1&lt;br /&gt;
	Switch(config-if)# switchport port-security aging time 120&lt;br /&gt;
	-------------------------------------------------------------------------&lt;br /&gt;
	Switch(config-if)# switchport port-security aging time 2&lt;br /&gt;
	Switch(config-if)# switchport port-security aging type inactivity&lt;br /&gt;
	Switch(config-if)# switchport port-security aging static&lt;br /&gt;
	5.验证结果&lt;br /&gt;
	show port-security [interface 接口] address&lt;br /&gt;
	案例：&lt;br /&gt;
	CCIE-LAB(V135)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	At sw1 port 15, there is a host need to be protected. You must config this port to protect it and must use arp command to bind the host&amp;rsquo;s ip address and mac address. Mac addresses 0080.2222.3333 and ip 172.1.1.1/24.&lt;br /&gt;
	配置：&lt;br /&gt;
	SW1&lt;br /&gt;
	interface f0/15&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	siwtchport port-security maximum 1&lt;br /&gt;
	switchport port-security mac-address 0080.2222.3333&lt;br /&gt;
	switchport port-security violation protect&lt;br /&gt;
	arp 172.1.1.1 0080.2222.3333 arpa f0/15&lt;br /&gt;
	CCIE-LAB(V142)&lt;br /&gt;
	题目要求：安全部分&lt;br /&gt;
	SW1的Fa0/12连接外部Public network drop的机器，这台机器的IP ADDRESS=X.X.X.X; MAC=0000.8333.3333，保证没有其他机器可使用这个端口。（考试没给出IP Address，故没必要用arp命令）&lt;br /&gt;
	配置：&lt;br /&gt;
	sw1&lt;br /&gt;
	config termi&lt;br /&gt;
	interface f0/12&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	switchport port-security&lt;br /&gt;
	switchport port-security maximum 1&lt;br /&gt;
	switchport port-security mac-address 0000.8333.3333&lt;br /&gt;
	switchport port-security violation protect&lt;br /&gt;
	no shut&lt;br /&gt;
	CCIE-LAB(V148)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	Configure Sw2-Fa0/2 so that it only accepts traffic from R2. If another host is attached to the port then the traffic should be dropped, but the port should remain enabled.&lt;br /&gt;
	配置：&lt;br /&gt;
	SW2&lt;br /&gt;
	Interface f0/2&lt;br /&gt;
	Switchport mode access&lt;br /&gt;
	Switchport port-security&lt;br /&gt;
	Switchport port-securtiy mac-address R2的mac地址&lt;br /&gt;
	Switchport port-security maximum 1&lt;br /&gt;
	Switchport port-security violation protect&lt;br /&gt;
	CCIE-LAB(yy)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	VLAN_B need tight (high) security, configure the ports in this VLAN to physical address of the routers that are currently attached to them.&lt;br /&gt;
	This configuration should survive the reboot of the switch.&lt;br /&gt;
	Log violations of this policy while allowing correct traffic to proceed.&lt;br /&gt;
	图：&lt;br /&gt;
	&lt;br /&gt;
	VLAN B---VLAN12&lt;br /&gt;
	配置：&lt;br /&gt;
	SW2&lt;br /&gt;
	conf t&lt;br /&gt;
	interface range f0/2,f0/5&lt;br /&gt;
	shut down&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	switchport port-security&lt;br /&gt;
	switchport port-security maximum 1&lt;br /&gt;
	switchport port-security mac-address sticky&lt;br /&gt;
	switchport port-security violation restrict&lt;br /&gt;
	另外解决方案：&lt;br /&gt;
	sw2&lt;br /&gt;
	config terminal&lt;br /&gt;
	show mac-address-table //查看r2和r5的mac地址&lt;br /&gt;
	interface f0/2&lt;br /&gt;
	shut&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	switchport port-security&lt;br /&gt;
	switchport port-security maximum 1&lt;br /&gt;
	switchport port-security mac-address r2的mac地址&lt;br /&gt;
	switchport port-security violation restrict&lt;br /&gt;
	no shut&lt;br /&gt;
	interface f0/5&lt;br /&gt;
	shut&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	switchport port-security&lt;br /&gt;
	switchport port-security maximum 1&lt;br /&gt;
	switchport port-security mac-address r2的mac地址&lt;br /&gt;
	switchport port-security violation restrict&lt;br /&gt;
	no shut&lt;br /&gt;
	案例：&lt;br /&gt;
	CCIE-LAB(V180)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	The customer wants to connect guest Ipphones to Sw4 f0/11-15&lt;br /&gt;
	l He wants to protecte interface from a user connecting a PC or a hub&lt;br /&gt;
	l He wants the interface to learning first mac-address connected and become part of the configuration&lt;br /&gt;
	l He does not want to have to manually bring backup the interface if the encounter a security viotation,but he do to ensure that the phones&amp;rsquo;s address is the only one allowed,and be able to check eth steales violation.&lt;br /&gt;
	配置：&lt;br /&gt;
	sw4&lt;br /&gt;
	config termi&lt;br /&gt;
	mls qos&lt;br /&gt;
	interface range f0/11 &amp;ndash;15&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	switchport voice vlan dot1p&lt;br /&gt;
	switchport port-security&lt;br /&gt;
	switchport port-security mac-address sticky&lt;br /&gt;
	switchport port-security violation restrict&lt;br /&gt;
	mls qos trust cos&lt;br /&gt;
	第二． 基于主机MAC地址限制流量&lt;br /&gt;
	对于MAC过滤的特性，它能够根据主机MAC地址来限制流量，在使用该特性的情况下，交换机能够丢弃源自所配置MAC地址的流量。通过使用这种特性，网络管理源能够防止未授权主机向网络发送流量。&lt;br /&gt;
	注意，交换机只允许对单播的源MAC地址流量进行过滤，而不允许对多播的源MAC地址流量进行过滤。他对采用多播源MAC地址发送数据报的规范是无效的。&lt;br /&gt;
	交换机允许在整个VLAN或单个接口上配置单播过滤。如果数据帧采用的源MAC地址没有被指定，那么交换机就可以正常地传递数据帧。对于基于cisco IOS软件的交换机，它只支持重启之后仍然存在的单播过滤。&lt;br /&gt;
	配置过程：&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 配置限制MAC地址流量&lt;br /&gt;
	mac-address-table static MAC地址 vlan vlan号 drop&lt;br /&gt;
	3） 验证结果&lt;br /&gt;
	show mac-address-table static vlan 1&lt;br /&gt;
	案例：&lt;br /&gt;
	switch(config)#mac-address-table static 0000.0000.0008 vlan 1 drop&lt;br /&gt;
	switch#show mac-address-table static vlan 1&lt;br /&gt;
	Mac Address Table&lt;br /&gt;
	-------------------------------------------&lt;br /&gt;
	Vlan Mac Address Type Ports&lt;br /&gt;
	---- ----------- -------- -----&lt;br /&gt;
	1 000d.6564.0280 STATIC CPU&lt;br /&gt;
	1 0100.0ccc.cccc STATIC CPU&lt;br /&gt;
	1 0100.0ccc.cccd STATIC CPU&lt;br /&gt;
	1 0100.0cdd.dddd STATIC CPU&lt;br /&gt;
	1 0000.0000.0008 STATIC Drop&lt;br /&gt;
	Total Mac Addresses for this criterion: 5&lt;br /&gt;
	第三。阻塞端口的单播或多播扩散&lt;br /&gt;
	默认情况下，如果数据包具有未知的目标MAC地址，那么交换机将把它扩散到与接收端口的VLAN相同的VLAN中所有端口。某些端口不需要扩散功能。例如，如果某个端口只有手工分配的MAC地址，并且没有连接所配置MAC地址之外的其它任何网络设备，那么它就不需要接收扩散数据包。此外，如果端口已经学到最大数目的MAC地址，那么对于通过配置安全MAC地址或端口启用端口安全的端口，它就不必接收未知的单播扩散。&lt;br /&gt;
	通过使用单播或多播扩散阻塞的特性，将可以避免在不必要的端口上转发单播扩散流量。通过以每个端口为基础而限制流量大小，不仅可以增加网络的安全限制，并且还可以防止网络设备徒然地处理无定向的数据包。&lt;br /&gt;
	配置过程：&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置其端口阻塞单播&lt;br /&gt;
	switchport block unicast&lt;br /&gt;
	4） 配置其端口阻塞多播流量&lt;br /&gt;
	switchport block multicast&lt;br /&gt;
	5） 验证结果&lt;br /&gt;
	show interface 接口 switchport&lt;br /&gt;
	案例：&lt;br /&gt;
	Switch# configure terminal&lt;br /&gt;
	Switch(config)# interface fa0/1&lt;br /&gt;
	Switch(config-if)# switchport block multicast&lt;br /&gt;
	Switch(config-if)# switchport block unicast&lt;br /&gt;
	Switch(config-if)# end&lt;br /&gt;
	Switch#show interface f0/1 switchport&lt;br /&gt;
	案例：&lt;br /&gt;
	CCIE-LAB(V160)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	在SW2种fa0/10上阻塞所有未知的组播流量&lt;br /&gt;
	配置：&lt;br /&gt;
	SW2&lt;br /&gt;
	config termi&lt;br /&gt;
	interface f0/10&lt;br /&gt;
	switchport block multicast&lt;br /&gt;
	第二部分 IEEE 802.1X管理网络访问安全&lt;br /&gt;
	IEEE 802.1x访问控制特性是一种基于行业标准的第2层访问控制方法，提供了集中管理功能。IEEE 802.1x访问控制特性还被广泛应用于无线网络。&lt;br /&gt;
	&lt;br /&gt;
	使用802.1x的时候，在交换机接收器端口连接的工作站发送的数据包之前，将请求身份验证服务器对工作站进行身份验证。在身份验证服务器验证工作站的身份之前，802.1x访问控制特性只允许EAPOL(Extensible Authentication Protocol over LAN，LAN上的可扩展身份验证协议)通信流通过工作站连接的端口。通过身份验证后，常规通信流才能通过该端口。&lt;br /&gt;
	基于端口的802.1x身份验证涉及3种设备：&lt;br /&gt;
	* 客户（client）---使用802.1x请求网络对其进行身份验证的工作站。当前，只有Microsoft Windows XP和Windows 2003内置了对802.1x支持功能&lt;br /&gt;
	* 身份验证服务器（Authentication server）---负责验证交换机转发的客户请求。当前，身份验证服务器是安装了EAPOL扩展的RADIUS服务器。&lt;br /&gt;
	* 交换机---负责将客户请求转发给身份验证服务器，并在客户通过身份验证后授予其访问网络的权限。在802.1x运行期间，交换机实际上是代理&lt;br /&gt;
	交换机端口的状态决定了客户是否能够访问网络。端口开始处于未经授权（unauthorized）状态。在这种状态下，除802.1x协议数据包外，端口不允许任何入站通信流和出站通信流通过。客户通过身份验证后，端口将切换到授权（authorized）状态，允许来自客户的通信流通过。如果交换机请求客户表明其身份（证明方发起的），而客户不支持802.1x，端口将保持未经许可状态，客户不能访问网络。&lt;br /&gt;
	相反地，当启用了802.1x的客户连接到端口，并向交换机发送EAPOL启动帧一启动身份验证过程（恳求方发起），而交换机没有运行802.1x协议，无法响应客户时，客户将开始发送数据帧，就像端口处于许可状态一样。&lt;br /&gt;
	2．验证开始和消息交换&lt;br /&gt;
	交换机或客户可以发起验证。如果一个端口上使用dot1x port-control auto接口配置命令启动验证，那么交换机必须在确定该端口链路状态从down转换为UP时发起验证。交换机接着向客户发送一个EAP-请求/身份帧来请求它的身份。根据收到的帧，客户响应一个EAP-响应/身份帧。&lt;br /&gt;
	&lt;br /&gt;
	如果在启动期间客户没有收到一个来自交换机的EAP-请求/身份帧，那么客户可以发送一个EAPOL-开始帧来发起验证。这提示交换机要请求客户的身份。&lt;br /&gt;
	如果网络接入设备上没有启用或支持802.1X，则会丢弃任何来自客户的EAPOL帧。如果客户在尝试开始验证的指定次数之后还未收到EAP-请求/身份帧，那么客户将发送帧如同端口已处于授权状态。出于授权状态的端口实际上意味着客户已被成功验证了。&lt;br /&gt;
	当客户提供其身份是，交换机开始他的中介职责，在客户和验证服务器之间传递EAP帧直到验证成功或失败。如果授权成功，交换端口即被授权&lt;br /&gt;
	EAP帧的详细交换基于所使用的验证方法。如图，由客户发起的与RADIUS服务器一起使用OTP（一次口令）验证方法的消息交换。&lt;br /&gt;
	3．支持的拓扑&lt;br /&gt;
	802.1X基于端口的验证支持在两种拓扑种：&lt;br /&gt;
	* 点对点（单用户）&lt;br /&gt;
	* 无线LAN（多用户）&lt;br /&gt;
	在点对点配置中，只有一个客户能够连接到起用了802.1X的交换机端口上。交换机在端口链路状态变为UP状态时检测客户。如果客户离开或被另一个客户替换，交换机将端口链路状态变为DOWN,端口返回到未授权状态。&lt;br /&gt;
	802.1X交换机端口被配置为一个多主机端口，一旦客户通过验证即变为授权的。当端口是授权的时候，所有其他非直连的主机获准接入网络。如果端口变为未授权的（在重新验证失败或受到一个EAPOL-下线消息时），交换机拒绝所有直连客户的网络访问。&lt;br /&gt;
	&lt;br /&gt;
	这个拓扑中，无线接入点负责验证直连到它的客户，并且该无线接入点作为交换机的一个客户。&lt;br /&gt;
	4．端口身份验证状态：&lt;br /&gt;
	* Force-authorized---禁用基于端口的802.1x身份验证，导致端口切换到许可状态，而不需要交换任何身份验证信息。端口发送和接收常规通信流，而不对客户进行基于802.1x的身份验证，这是默认设置&lt;br /&gt;
	* Force-unauthorized---导致端口保持未经许可状态，并忽略客户的所有身份验证请求。交换机不能通过这种端口为客户提供身份验证服务。&lt;br /&gt;
	* Auto---启用基于端口的802.1x身份验证，导致端口一开始处于未经许可状态，只能接收和发送EAPOL帧。端口的链路状态从down到up(验证方发起)或收到EAPOL启动帧（恳求方发起）后，身份验证过程便开始了。交换机请求客户说明其身份，并在客户和验证服务器之间转发身份验证消息。交换机使用客户的MAC地址来唯一地标识每个试图访问网络的客户。&lt;br /&gt;
	如果客户通过了身份验证（收到来自身份验证服务器的Accept帧），端口状态将变为许可，客户发送的所有帧都被允许通过端口。如果未通过身份验证，端口将保持未经许可状态。在这种状态下，端口只允许用于重新验证身份的通信流通过，而不允许其他用户通信流通过。如果身份验证服务器不可达，交换机可能重传请求。如果重传指定次数后，服务器仍没有响应，身份验证将一失败告终，交换机不允许客户访问网络。此外，客户注销是将发送一条EAPOL注销信息，导致服务器端口切换到未经许可状态。&lt;br /&gt;
	5．802.1X配置指导&lt;br /&gt;
	802.1X协议在第2层的静态接入端口上支持，但在以下类型的端口上不支持：&lt;br /&gt;
	* 中继端口---试图在一个中继端口上启用802.1X会产生错误消息，因而不能激活802.1X。&lt;br /&gt;
	* 动态端口---处于动态模式的端口会与其相邻的邻居协商变成一个中继端口，所以要在动态模式的端口设置802.1X会出错。&lt;br /&gt;
	* VQP端口---试图在一个动态接入（VLAN查询协议[VQP]）端口上启用802.1X会出错&lt;br /&gt;
	* 活动的ETHERCHANNEL端口---在端口启用802.1X之前，首先应将该端口从EtherChannel中移除。试图在一个EtherChannel或一个EtherChannel中的一个活动端口上启用802.1x会产生错误&lt;br /&gt;
	l 安全端口---安全端口不能配置为802.1x&lt;br /&gt;
	l span目的端口---802.1x可以在一个SPAN目的的端口上启用，但802.1X直到该端口不再是SPAN目的时才会生效。802.1X可以再SPAN源端口使用&lt;br /&gt;
	6．配置802.1X&lt;br /&gt;
	默认配置&lt;br /&gt;
	特性 默认设置&lt;br /&gt;
	------------------------------------------&lt;br /&gt;
	交换机IEEE802.1x 禁用&lt;br /&gt;
	AAA验证 禁用&lt;br /&gt;
	RADIUS服务器&lt;br /&gt;
	IP地址 未指定&lt;br /&gt;
	UDP端口 1812&lt;br /&gt;
	密钥 未指定&lt;br /&gt;
	主机模式 点对点（单主机）&lt;br /&gt;
	每个接口的802.1X启用状态 禁用（强制未授权），端口发送和接受正常的流量&lt;br /&gt;
	周期性的重新验证 禁止&lt;br /&gt;
	重新验证尝试之间的次数 3600秒&lt;br /&gt;
	安静周期 60秒（交换机在与客户的一次失败验证交换之后保持安静状态的时间）&lt;br /&gt;
	重传时间 30秒（交换机在重传请求之前等待客户对一个EAP请求/身份帧的响应时间）&lt;br /&gt;
	最大重传次数 2次（交换机在重新开始验证过程之前发送一个EAP请求/身份帧的次数）&lt;br /&gt;
	多主机支持 禁止&lt;br /&gt;
	客户超时周期 30秒（在将一个请求从验证服务器中介给客户时，交换机向客户重传该请求之前等待响应的时间）。该设置不能配置&lt;br /&gt;
	验证服务器超时周期 30秒（在将一个请求从客户中介给验证服务器时，交换机向服务器重传该请求之前等待响应的时间）。该设置不能配置&lt;br /&gt;
	配置IEEE802.1X认证&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 启用AAA&lt;br /&gt;
	aaa new-model&lt;br /&gt;
	3） 建立IEEE802.1x认证列表&lt;br /&gt;
	aaa authentication dot1x {default} method1&lt;br /&gt;
	default:将后面指定的身份验证方法作为默认配置，自动作用于所有IEEE802.1x&lt;br /&gt;
	method1:指定身份验证的方法&lt;br /&gt;
	4） 启用IEEE802.1x授权&lt;br /&gt;
	dot1x system-auth-control&lt;br /&gt;
	5） 建立授权（可选）&lt;br /&gt;
	aaa authorization network {default} group radius&lt;br /&gt;
	指定通过RADIUS服务起来建立授权&lt;br /&gt;
	6） 指定RADIUS服务器的地址&lt;br /&gt;
	radius-server host　IP地址&lt;br /&gt;
	7） 指定密钥&lt;br /&gt;
	radius-server key 密钥&lt;br /&gt;
	8） 进入接口模式 interface 接口&lt;br /&gt;
	9） 启用IEEE802.1x认证&lt;br /&gt;
	switchport mode access dot1x port-control auto&lt;br /&gt;
	10） 验证结果&lt;br /&gt;
	show dot1x&lt;br /&gt;
	配置交换机域RADIUS服务器之间通信&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 配置RADIUS服务器特征&lt;br /&gt;
	radius-server host [主机名|IP地址] auth-port 端口号 key 密钥&lt;br /&gt;
	auth-port:UDP端口号&lt;br /&gt;
	配置主机模式&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置主机模式&lt;br /&gt;
	dot1x host-mode multi-host&lt;br /&gt;
	允许多主机模式&lt;br /&gt;
	4） 配置IEEE802.1x认证&lt;br /&gt;
	dot1x port-control auto&lt;br /&gt;
	配置重认证周期&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 启用IEEE802.1x重认证&lt;br /&gt;
	dot1x reauthentication&lt;br /&gt;
	4） 设置重认证周期&lt;br /&gt;
	dot1x timeout reauth-period 秒数&lt;br /&gt;
	秒数：默认为3600秒，取值为1-65535&lt;br /&gt;
	5） 验证结果&lt;br /&gt;
	show dot1x interface 接口&lt;br /&gt;
	配置安静周期&lt;br /&gt;
	交换机在与客户的一次失败验证交换之后保持安静状态的时间&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置安静周期Quiet period&lt;br /&gt;
	dot1x timeout quiet-period 秒数&lt;br /&gt;
	秒数：默认为60秒，取值为1-65535&lt;br /&gt;
	配置交换机与主机之间重传时间&lt;br /&gt;
	交换机在重传请求之前等待客户对一个EAP请求/身份帧的响应时间&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interfacer 接口&lt;br /&gt;
	3） 配置重传时间&lt;br /&gt;
	dot1x timeout tx-period 秒数&lt;br /&gt;
	秒数为5-65535，默认为5秒&lt;br /&gt;
	配置交换机与主机之间重传最大次数&lt;br /&gt;
	交换机在重新开始验证过程之前发送一个EAP请求/身份帧的次数&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interfacer 接口&lt;br /&gt;
	3） 配置重传最大次数&lt;br /&gt;
	dot1x max- req 次数&lt;br /&gt;
	次数为1-10，默认为2次&lt;br /&gt;
	配置交换机与主机之间重认证最大次数&lt;br /&gt;
	1） 入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interfacer 接口&lt;br /&gt;
	3） 配置重传最大次数&lt;br /&gt;
	dot1x max-reauth-req 次数&lt;br /&gt;
	秒数为1-10，默认为2次&lt;br /&gt;
	案例：&lt;br /&gt;
	CCIE-LAB(V133)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	you want to restrict unauthorized clients form connecting to your network configure sw1 so that the por f0/9 has 802.1x port-based authentication using a RADIUS server heinitial state of this port should be unauthorized ,but when transitions form down to up the authentication process to the Radius SERVER SHOULD BEGIN ,PERFORM ONLY THE MINIMUM AAA configuration pertinent to the 802.1x port-based authentication&lt;br /&gt;
	配置：&lt;br /&gt;
	SW1&lt;br /&gt;
	configure term&lt;br /&gt;
	aaa new-model&lt;br /&gt;
	aaa authentication dot1x default group radius&lt;br /&gt;
	aaa authortication network default group radius&lt;br /&gt;
	dot1x system-auto-control&lt;br /&gt;
	interface f0/9&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	dot1x port-control auto&lt;br /&gt;
	CCIE-LAB(YY)&lt;br /&gt;
	you want to restrict unauthorized clients form connecting to your network configure sw1 so that the por f0/17 has 802.1x port-based authentication using a RADIUS server heinitial state of this port should be unauthorized ,but when transitions form down to up the authentication process to the Radius SERVER SHOULD BEGIN ,PERFORM ONLY THE MINIMUM AAA configuration pertinent to the 802.1x port-based authentication.RADIUS Server address:150.1.1.254,key is cisco.&lt;br /&gt;
	配置：&lt;br /&gt;
	sw1&lt;br /&gt;
	config termi&lt;br /&gt;
	aaa new-model&lt;br /&gt;
	aaa authentication dot1x default group radius&lt;br /&gt;
	aaa authentication network default group raidus&lt;br /&gt;
	radius-server host 150.1.1.254&lt;br /&gt;
	radius-server key cisco&lt;br /&gt;
	dot1x system-auth-control&lt;br /&gt;
	interface f0/17&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	dot1x port-control auto&lt;br /&gt;
	show dot1x&lt;br /&gt;
	show dot1x interface f0/17&lt;br /&gt;
	配置访客vlan(guest vlan)&lt;br /&gt;
	如果端口指定了访客Guest VLAN项，此端口下的接入用户如果认证失败或根本无用户账号的话，会成为Guest VLAN 组的成员，可以享用此组内的相应网络资源，这一种功能同样可为网络应用的某一些群体开放最低限度的资源，并为整个网络提供了一个最外围的接入安全。用户可以去下载客户端，但是不能去上公网，他限制了未拨号用户可以访问的资源。&lt;br /&gt;
	配置过程：&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置接口模式&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	4） 配置dot1x认证&lt;br /&gt;
	dot1x port-control auto&lt;br /&gt;
	5） 配置某个活动vlan成为访客vlan&lt;br /&gt;
	dot1x guest-vlan vlan号&lt;br /&gt;
	vlan号：1-4094，除了RSPAN vlan、私有VLAN的主Vlan、语音vlan&lt;br /&gt;
	案例：&lt;br /&gt;
	CCIE-LAB(210)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	配置sw3上基于802.1X安全的GUEST VLAN，vlan号为999，端口范围为fa0/11-18,RADIUS SERVER地址为150.1.1.254，密码为cisco。&lt;br /&gt;
	配置：&lt;br /&gt;
	SW3:&lt;br /&gt;
	config terminal&lt;br /&gt;
	vlan 999&lt;br /&gt;
	name guestvlan&lt;br /&gt;
	aaa new-model&lt;br /&gt;
	aaa authentication dot1x default group radius&lt;br /&gt;
	aaa authortication network default group radius&lt;br /&gt;
	dot1x system-auth-control&lt;br /&gt;
	radius-server host 150.1.1.254&lt;br /&gt;
	radius-server key cisco&lt;br /&gt;
	interface fa0/11 &amp;ndash;18&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	dot1x port-control auto&lt;br /&gt;
	dot1x guest-vlan 999&lt;br /&gt;
	&lt;br /&gt;
	配置受限vlan&lt;br /&gt;
	可以配置端口指定为受限vlan,当认证失败之后（超过认证次数3次），不能访问guest vlan的客户将加入受限的vlan, 限制了未认证成功的用户可以访问的资源。&lt;br /&gt;
	配置过程：&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置接口模式&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	4） 配置受限vlan&lt;br /&gt;
	dot1x auth-fail vlan vlan号&lt;br /&gt;
	5） 配置最大认证接收次数&lt;br /&gt;
	dot1x auth-fail auth-attwmpts 次数&lt;br /&gt;
	次数：取值为1-3，默认为3&lt;br /&gt;
	配置物理地址认证旁路&lt;br /&gt;
	使用mac地址认证旁路特性，交换机可以使用客户端的mac地址作为客户认证，比如端口上连接一台打印机。当一个802.1x端口上使用mac认证旁路特性，交换机将使用mac地址作为客户端的身份的验证，认证服务器有一张客户mac地址表用作是否允许客户访问网络。交换机等待客户的EAP响应/身份帧的认证时间超时，交换机会尝试使用mac地址作为客户的认证。&lt;br /&gt;
	配置过程：&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置接口&lt;br /&gt;
	dot1x port-control auto&lt;br /&gt;
	dot1x mac-address-bypass [eap]&lt;br /&gt;
	eap:交换机使用eap认证&lt;br /&gt;
	非法IEEE802.1x&lt;br /&gt;
	配置过程：&lt;br /&gt;
	1） 进入接口模式 interface 接口&lt;br /&gt;
	2） 非法ieee802.1x功能&lt;br /&gt;
	no dot1x pae&lt;br /&gt;
	恢复原始配置参数&lt;br /&gt;
	配置过程：&lt;br /&gt;
	1） 进入接口模式&lt;br /&gt;
	2） 恢复原始配置&lt;br /&gt;
	dot1x default&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
	第三部分 访问控制&lt;br /&gt;
	1．RACL&lt;br /&gt;
	针对路由接口的控制通信流量的安全策略。交换机在硬件中支持包含允许和拒绝操作的RACL。RACL的配置方式与常规的ACL相同。&lt;br /&gt;
	在交换机中，用户可以在任何路由接口中应用RACL，其中包括如下接口：&lt;br /&gt;
	*SVI（交换虚拟接口vlan端口）&lt;br /&gt;
	*第3层端口或路由端口&lt;br /&gt;
	*第3层端口通道&lt;br /&gt;
	*其它第3层接口&lt;br /&gt;
	2．VACL&lt;br /&gt;
	VACL又称为VLAN访问映射表，应用于VLAN中的所有通信流。VACL支持基于ethertype和MAC地址的过滤，也支持Ipv4的IP地址过滤。与基于cisco IOS的路由映射表一样，vacl中条目的顺序并非无关紧要。VACL不定义方向（进或出）。一个VACL可以用于多个VLAN中；但一个VLAN只能与一个VACL关联。&lt;br /&gt;
	支持多种VACL操作：&lt;br /&gt;
	* 转发（允许）：这种VACL操作像通常那样转发帧。如果希望配置交换机端口分析器（SPAN）选项，必须采用带capture选项的转发操作；SPAN是一项用于将数据帧复制到监控端口的排错特性。这种VACL对于配置多个SPAN端口并连接网络监控设备（如第三方IDS设备）很有用。&lt;br /&gt;
	* 丢弃（拒绝）：流与某个ACL丢弃（拒绝）条目匹配后，将它同下一个ACL条目进行比较。如果流不予任何ACL条目匹配，且至少配置了一个针对数据包类型的ACL，则流中的数据包将被丢弃&lt;br /&gt;
	* 重定向：VACL重定向操作对于出于监控、安全或交换的目的而重定向特定通信流很有用。&lt;br /&gt;
	&lt;br /&gt;
	配置方法：&lt;br /&gt;
	1） 定义访问控制列表（标准、扩展、命名）&lt;br /&gt;
	a.标准访问控制列表&lt;br /&gt;
	access-list 列表编号 deny|permit 源地址 反掩码 [log]&lt;br /&gt;
	* 列表编号：1-99&lt;br /&gt;
	* deny:拒绝&lt;br /&gt;
	* permit:允许&lt;br /&gt;
	* 源地址：控制访问的源头&lt;br /&gt;
	* 反掩码：any 是指任意主机，host是指某台主机&lt;br /&gt;
	* log:记录到日志文件&lt;br /&gt;
	案例：&lt;br /&gt;
	Switch (config)# access-list 2 deny host 171.69.198.102&lt;br /&gt;
	Switch (config)# access-list 2 permit any&lt;br /&gt;
	Switch(config)# end&lt;br /&gt;
	Switch# show access-lists&lt;br /&gt;
	Standard IP access list 2&lt;br /&gt;
	10 deny 171.69.198.102&lt;br /&gt;
	20 permit any&lt;br /&gt;
	&lt;br /&gt;
	b.扩展访问控制列表&lt;br /&gt;
	access-list 列表编号 deny|permit 协议 源地址 反掩码 [源端口] 目标地址 反掩码 [目标端口] [表达式]&lt;br /&gt;
	* 列表编号：100-199&lt;br /&gt;
	* 协议：IP、TCP、UDP、ICMP等，协议选项是区别标准访问列表的特征之一&lt;br /&gt;
	* 表达式：eq 协议或端口号:等于协议或端口号&lt;br /&gt;
	gq 协议或端口号：小于指定的协议或端口号&lt;br /&gt;
	lq 协议或端口号：大于指定的协议或端口号&lt;/p&gt;
&lt;p&gt;
	案例：&lt;br /&gt;
	Switch(config)# access-list 102 deny tcp 171.69.198.0 0.0.0.255 172.20.52.0 0.0.0.255 eq telnet&lt;br /&gt;
	Switch(config)# access-list 102 permit tcp any any&lt;br /&gt;
	Switch(config)# end&lt;br /&gt;
	Switch# show access-lists&lt;br /&gt;
	Extended IP access list 102&lt;br /&gt;
	10 deny tcp 171.69.198.0 0.0.0.255 172.20.52.0 0.0.0.255 eq telnet&lt;br /&gt;
	20 permit tcp any any&lt;/p&gt;
&lt;p&gt;
	c.命名访问控制列表&lt;br /&gt;
	命名的列表允许使用超过99个标准控制列表和100个扩展控制列表。优于编号的控制列表的特点是可以删除特定的一条语句，而编号访问控制列表只能删除整个访问控制。&lt;br /&gt;
	Ip access-list [standard|extended] 名称&lt;br /&gt;
	Permit|deny 标准和扩展有所不同&lt;/p&gt;
&lt;p&gt;
	案例：&lt;br /&gt;
	Switch(config)# ip access-list extended border-list&lt;br /&gt;
	Switch(config-ext-nacl)# no permit ip host 10.1.1.3 any&lt;br /&gt;
	2） 定义VACL映射表&lt;br /&gt;
	vlan access-map 名称&lt;br /&gt;
	a) 匹配指定的IP访问控制列表 match ip address 访问列表号&lt;br /&gt;
	匹配指定的mac访问控制列表 match mac address 访问控制列表&lt;br /&gt;
	b) 指定对符合条件的流量进行何动作 action drop|forward&lt;/p&gt;
&lt;p&gt;
	案例：&lt;br /&gt;
	switch(config)#vlan access-map test&lt;br /&gt;
	switch(config-access-map)#match ip address 101&lt;br /&gt;
	switch(config-access-map)#action forward&lt;br /&gt;
	3） 将VACL映射表应用到某个VLAN&lt;br /&gt;
	vlan filter 映射表名称 vlan-list vlan列表&lt;/p&gt;
&lt;p&gt;
	案例：&lt;br /&gt;
	vlan filter test vlan-list 10&lt;/p&gt;
&lt;p&gt;
	4） 验证结果&lt;br /&gt;
	show vlan access-map 名称&lt;br /&gt;
	&lt;br /&gt;
	Switch#show vlan access-map&lt;br /&gt;
	Vlan access-map &amp;quot;test&amp;quot; 10&lt;br /&gt;
	Match clauses:&lt;br /&gt;
	ip address: 100&lt;br /&gt;
	Action:&lt;br /&gt;
	drop&lt;br /&gt;
	Vlan access-map &amp;quot;test&amp;quot; 20&lt;br /&gt;
	Match clauses:&lt;br /&gt;
	Action:&lt;br /&gt;
	forward&lt;br /&gt;
	---------------------------------------------------&lt;br /&gt;
	show vlan filter access-map 名称 | vlan vlan号&lt;/p&gt;
&lt;p&gt;
	Switch#show vlan filter&lt;br /&gt;
	VLAN Map test is filtering VLANs:&lt;br /&gt;
	11-13&lt;/p&gt;
&lt;p&gt;
	案例：&lt;br /&gt;
	主机X和主机Y位于不同的VLAN，交换机B已经对这两个VLAN做了vlan间的路由&lt;br /&gt;
	Switch(config)# ip access-list extended http&lt;br /&gt;
	Switch(config-ext-nacl)# permit tcp host 10.1.1.32 host 10.1.1.34 eq www&lt;br /&gt;
	Switch(config-ext-nacl)# exit&lt;/p&gt;
&lt;p&gt;
	Switch(config)# vlan access-map map2 10&lt;br /&gt;
	Switch(config-access-map)# match ip address http&lt;br /&gt;
	Switch(config-access-map)# action drop&lt;br /&gt;
	Switch(config-access-map)# exit&lt;br /&gt;
	Switch(config)# ip access-list extended match_all&lt;br /&gt;
	Switch(config-ext-nacl)# permit ip any any&lt;br /&gt;
	Switch(config-ext-nacl)# exit&lt;br /&gt;
	Switch(config)# vlan access-map map2 20&lt;br /&gt;
	Switch(config-access-map)# match ip address match_all&lt;br /&gt;
	Switch(config-access-map)# action forward&lt;br /&gt;
	Switch(config)# vlan filter map2 vlan 1&lt;br /&gt;
	要注意vlan间的acl和vacl之间的区别&lt;br /&gt;
	&lt;br /&gt;
	3.PACL&lt;br /&gt;
	通过控制端口级别的流量，PACL(Port ACL)端口ACL能够提供另外一种控制机制。PACL可应用于第2层交换机端口、干道端口或EtherChannel端口。&lt;br /&gt;
	在使用PACL的时候，能够在第2层接口上应用如下的ACL:&lt;br /&gt;
	* 标准访控（针对源IP地址）&lt;br /&gt;
	* 扩展访控（针对源IP地址和目标IP地址以及用于第4层协议类型信息）&lt;br /&gt;
	* MAC扩展访控（针对源和目标MAC地址，还可以使用第3层协议类型信息）&lt;br /&gt;
	当PACL应用于trunk端口上时，ACL将过滤trunk端口上所有的vlan的流量。当PACL应用到语音vlan端口的时候，ACL将过滤数据和语音VLAN的流量。&lt;br /&gt;
	对于PACL，通过采用IP访问控制列表，将能够过滤IP流量，通过采用MAC访问控制列表，将能够过滤非IP流量。此外，通过在接口上应用IP访问控制列表和MAC访问列表，将能够过滤相同的第2层接口上IP流量和非IP流量。&lt;/p&gt;
&lt;p&gt;
	配置MAC扩展访控：&lt;br /&gt;
	1）进入全局模式 configure terminal&lt;br /&gt;
	2）定义mac扩展访控名称&lt;br /&gt;
	mac access-list extended 名称&lt;br /&gt;
	3） 定义相应访问控制列表语句&lt;br /&gt;
	deny|permit [any | host 源MAC | 源MAC 源MAC掩码] [any | host 目标MAC | 目标MAC 目标MAC掩码 ] [ aarp | amber | dec-spanning | decnet-iv | diagnostic | dsm | etype-6000 | etype-8042 | lat | lavc-sca | mop-console | mop-dump | msdos | mumps | netbios | vines-echo |vines-ip | xns-idp | 0-65535] [cos cos]&lt;br /&gt;
	4） 应用访问控制列表到第2层接口&lt;br /&gt;
	进入接口模式 interface 接口&lt;br /&gt;
	应用访控 mac access-group 访控名称 in&lt;br /&gt;
	对于端口ACL而言，只有进入的方向可以加访控&lt;br /&gt;
	5） 验证结果&lt;br /&gt;
	show access-lists [列表号|名称]&lt;br /&gt;
	show access-group [interface 接口]&lt;br /&gt;
	&lt;br /&gt;
	案例：&lt;br /&gt;
	switch#configure terminal&lt;br /&gt;
	switch(config)#mac access-list extended cisco&lt;br /&gt;
	switch(config-ext-macl)#permit host 0011.abcd.abcd host 0011.1111.1111&lt;br /&gt;
	switch(config-ext-macl)#exit&lt;br /&gt;
	switch(config)#access-list 101 deny ip 10.10.1.0 0.0.0.255 host 10.10.2.2&lt;br /&gt;
	switch(config)#access-list 101 permit ip any any&lt;br /&gt;
	switch(config)#interface f0/23&lt;br /&gt;
	switch(config-if)#switchport mode trunk&lt;br /&gt;
	switch(config-if)#ip access-group 101 in&lt;br /&gt;
	switch(config-if)#mac access-group cisco in&lt;br /&gt;
	switch(config-if)#end&lt;br /&gt;
	switch#show access-lists&lt;br /&gt;
	switch#show access-group interface f0/23&lt;/p&gt;
&lt;p&gt;
	案例：&lt;br /&gt;
	CCIE-LAB(v133)&lt;br /&gt;
	题目要求：&lt;br /&gt;
	Assume that connected to port f0/15 on SW1 is a host sending Ethernet Type 6000 frames into the network configures an access-list to block only this traffic allowing other frames to enter into the network.Please use &amp;ldquo;Block_eth6000&amp;rdquo; as the name of access-list.&lt;br /&gt;
	配置：&lt;br /&gt;
	SW1&lt;br /&gt;
	configure terminal&lt;br /&gt;
	mac access-list extended Block_eth6000&lt;br /&gt;
	deny any any etype-6000&lt;br /&gt;
	permit any any&lt;br /&gt;
	interface f0/15&lt;br /&gt;
	switchport mode access&lt;br /&gt;
	mac access-group Block_eth6000 in&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
	第四部分 DHCP监听&lt;br /&gt;
	在某些情况下，入侵者可以将一个DHCP 服务器加入网络，令其&amp;ldquo;冒充&amp;rdquo;这个网段的DHCP 服务器。这让入侵者可以为缺省的网关和域名服务器（DNS 和WINS）提供错误的DHCP 信息，从而将客户端指向黑客的主机。这种误导让黑客可以成为&amp;ldquo;中间人&amp;rdquo;，获得对保密信息的访问权限，例如用户名和密码，而最终用户对攻击一无所知。为了防止出现这种情况，您可以使用DHCP 监听。DHCP监听是一种dhcp安全特性，他能够过滤来自网络中主机或其他设备的非信任dhcp报文。通过建立并维护dhcp监听绑定表，dhcp能够实现上述级别的安全。&lt;br /&gt;
	非信任DHCP消息是交换机从外部的网络、防火墙或其他非授权dhcp服务器接收到的dhcp消息，在启用dhcp监听的环境中，当从信任的区域中之外的设备传来的信息都是非信任的消息，这些非信任的消息可能是黑客入侵。&lt;br /&gt;
	DHCP监听建立DHCP绑定表，用来过滤不可信任区域的DHCP信息，其中包括对应交换机上不信任的端口的客户端IP地址、MAC地址、端口号、VLAN编号、租用和绑定类型等消息。交换机支持在每个vlan基础上启用DHCP监听特性。通过这种特性，交换机拦截第2层VLAN域内的所有DHCP报文。&lt;br /&gt;
	通过这种特性，交换机能够限制用户端口（非信任端口）只能够发送dhcp请求，并且将丢弃来自用户端口的所有其它DHCP报文，例如DHCP提供（OFFER）响应报文等。DHCP监听信任端口是连接到已知合法DHCP服务器或与分布层交换机（能够提供到达DHCP服务器的路径）之间的上行链路端口。信任端口能够发送或接收所有的DHCP报文。这种情况下，交换机只允许受信任的dhcp服务器能够通过DHCP响应来分发DHCP地址。&lt;br /&gt;
	当交换机从启用了dhcp监听的vlan中一个不信任端口接收到一个报文，交换机会比较源mac地址和dhcp客户机的硬件地址，如果匹配这个数据报文被转发，如果不匹配这个数据报将被丢弃。&lt;/p&gt;
&lt;p&gt;
	交换机根据以下情况会丢弃报文：&lt;br /&gt;
	* 当收到外网的dhcp服务器发来的DHCPOFFER, DHCPACK, DHCPNAK, DHCPLEASEQUERY报文&lt;br /&gt;
	* 接收到非信任端口报文，源MAC和DHCP客户端硬件地址不匹配&lt;br /&gt;
	* 接收到DHCPRELEASE或DHCPDECLINE广播信息中有dhcp绑定表中某个mac地址，但接口信息和收到的信息中的接口信息不匹配。&lt;br /&gt;
	如果一台支持DHCP监听的汇聚层交换机和一台插入了选项82信息的边界交换机相连，这台交换机会丢弃从非信任的端口收到的插入了选项82的报文信息，如果信任端口收到插入选项82的信息报，汇聚交换机不会为信任端口链接的设备建立DHCP监听绑定表条目。&lt;br /&gt;
	拥有ios12.25或更早版本的边界交换机如果插入了选项82，和它相连的汇聚交换机因为汇聚交换机的dhcp监听绑定表不完整不能使能dhcp监听功能，汇聚交换机也不能使用IP源保护和动态arp，除非你手工指定绑定表和arp的访问控制。&lt;br /&gt;
	在IOS 12.2(25)SE版本之后，汇聚交换机和边界交换机通过一个非信任端口相连时，通过全局模式下命令ip dhcp snooping information allow-untrusted的配置，汇聚交换机会接收从边界交换机发来的插入选项82的信息报，汇聚交换机也会学习和绑定从不信任端口相连的设备信息。&lt;br /&gt;
	选项82&lt;br /&gt;
	当DHCP Relay Agent将客户端的DHCP包转发到DHCP服务器时，可以插入一些选项信息，以便DHCP服务器能更精确的得知PC客户端的信息，从而能更灵活按相应策略分配IP地址和IP地址需要的租约时间。该选项信息的选项号为82，故又称为Option 82，相关标准文档为RFC 3046。Option 82是对DHCP选项的扩展应用，这个新的选项被称为：DHCP relay agent information option（中继代理信息选项），当向一个DHCP中继代理传输客户端发起的DHCP请求时被中继代理嵌入到客户端的DHCP报文中，当服务器识别到中继代理信息选项后就会根据选项中的信息执行IP地址的分配和策略的实施。&lt;br /&gt;
	在一些大型的网络环境中，DHCP服务可以集中管理IP地址指派给大批用户，当交换机的选项82使能后，用户设备可以通过身份鉴定由交换机访问网络（除其mac地址），局域网中多个用户主机通过具有独特的身份鉴定（选项82）由交换机的同一端口访问网络。&lt;br /&gt;
	&lt;br /&gt;
	如上图，因为DHCP服务器和DHCP客户端不在同一网络或子网中，交换机配置DHCP的中继代理，通过ip help-address命令使能在dhcp服务器和客户端之间广播转发和传送dhcp消息。&lt;br /&gt;
	1． 主机（DHCP客户端）发出DHCP请求消息，并广播到网络中&lt;br /&gt;
	2． 交换机收到这条DHCP REQUEST消息，将选项82插入这个消息报中，默认情况下，RemoteID子选项是交换机的mac地址，CircuitID子选项是接收到消息的端口标示符，这些参数是可以配置的。&lt;br /&gt;
	3． 如果中继代理的IP地址有配置，交换机会添加这个IP地址到DHCP包中&lt;br /&gt;
	4． 交换机转发带有选项82的DHCP REQUEST报到DHCP服务器&lt;br /&gt;
	5． DHCP服务器收到这个信息后，如果DHCP服务器启用了选项82，服务器使用RemoteID、CircuitID或者两个子选项来分配IP地址和应用相应的策略。DHCP服务器标识选项82到DHCP回应消息。&lt;br /&gt;
	6． DHCP服务器单播DHCP REPLY到交换机（DHCP中继代理），交换机将选项字段剥去后发送给客户端。&lt;br /&gt;
	&amp;ldquo;中继信息&amp;rdquo;选项被定义为一个包含一个或多个&amp;ldquo;子选项&amp;rdquo;的单独的DHCP选项，并传送可被中继代理识别的信息。Option 82选项如同一个&amp;ldquo;容器&amp;rdquo;选项，为中继代理分配的特定的子选项在DHCP报文中提供了数据空间。&lt;br /&gt;
	CircuitID子选项（SUBOPTION）帧格式&lt;br /&gt;
	子选项类型（1字节）&lt;br /&gt;
	长度（1字节）&lt;br /&gt;
	电路ID类型&lt;br /&gt;
	长度（电路ID）&lt;br /&gt;
	&lt;br /&gt;
	其中电路ID子选项中的端口字段，端口号是从3开始的，比如对于一个24口10/100M的交换机，fa0/1端口在子选项中端口字段表示为3，fa0/2端口表示为4&amp;hellip;&amp;hellip;&lt;br /&gt;
	RemoteID子选项帧格式&lt;br /&gt;
	当交换机使能DHCP SNOOPING和ip dhcp snooping information option命令后，circuitID子选项和remoteID子选项采用以上的帧格式（默认格式）&lt;br /&gt;
	当我们全局模式下使能dhcp 监听，用户全局模式使用命令ip dhcp snooping information option format remote-id和接口模式下使用ip dhcp snooping vlan information option format-type circuit-id string命令配置了remoteID和circuiteID子选项后，circuiteID和remoteID子选项的帧格式有所变化：&lt;br /&gt;
	circuitID子选项帧格式：&lt;br /&gt;
	*circute类型为1&lt;br /&gt;
	*长度是可变的，根据用户配置的字符串扩展&lt;br /&gt;
	&lt;br /&gt;
	remoteID子选项帧格式&lt;br /&gt;
	* remote类型为1&lt;br /&gt;
	*长度是可变的，根据用户配置的字符串扩展&lt;br /&gt;
	&lt;br /&gt;
	配置DHCP 监听&lt;br /&gt;
	默认配置：&lt;br /&gt;
	特性 默认配置&lt;br /&gt;
	------------------------------------------&lt;br /&gt;
	DHCP SERVER 启用，但需要配置&lt;br /&gt;
	DHCP中继代理 启用&lt;br /&gt;
	DHCP包转发地址 没有配置&lt;br /&gt;
	核实中继代理信息 启用&lt;br /&gt;
	DHCP中继代理转发策略 代替现行的DHCP中继代理信息&lt;br /&gt;
	DHCP监听 未启用&lt;br /&gt;
	选项82 启用&lt;br /&gt;
	不信任端口是否接收DHCP监听选项 未启用&lt;br /&gt;
	限速 未配置&lt;br /&gt;
	信任状态 不信任状态&lt;br /&gt;
	VLAN的DHCP监听 未启用&lt;br /&gt;
	DHCP监听MAC地址验证 启用&lt;br /&gt;
	DHCP绑定表 启用&lt;br /&gt;
	DHCP监听绑定表 启用，但需要配置&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
	配置DHCP snooping&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 启用dhcp监听&lt;br /&gt;
	ip dhcp snooping&lt;br /&gt;
	3） 在vlan上启用dhcp 监听，如果在vlan上不启用，dhcp监听是不激活的&lt;br /&gt;
	ip dhcp snooping vlan vlan范围&lt;br /&gt;
	4） 是否插入选项82&lt;br /&gt;
	ip dhcp snooping information option&lt;br /&gt;
	5） 配置remoteID子选项（可选）&lt;br /&gt;
	ip dhcp snooping information option format remote-id [string 字符串|主机名]&lt;br /&gt;
	6） 配置汇聚交换机接收从边界交换机发来的带有选项82的数据包（可选）&lt;br /&gt;
	ip dhcp snooping information option allow-untrusted&lt;br /&gt;
	7） 进入接口模式 interface 接口&lt;br /&gt;
	8） 指定为信任端口（可选）&lt;br /&gt;
	ip dhcp snooping trust&lt;br /&gt;
	9） 配置circuiteID子选项（可选）&lt;br /&gt;
	ip dhcp snooping vlan vlan号information option format-type circuit-id string 字符串&lt;br /&gt;
	10） 设置限速&lt;br /&gt;
	ip dhcp snooping limit rate 速率&lt;br /&gt;
	速率：指定每秒传输包数，取值为1-2048&lt;br /&gt;
	11） 验证结果&lt;br /&gt;
	show ip dhcp snooping //查看dhcp监听状态&lt;br /&gt;
	show ip dhcp snooping binding //查看dhcp监听绑定表&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
	案例：&lt;br /&gt;
	switch#config terminal&lt;br /&gt;
	switch(config)#ip dhcp snooping&lt;br /&gt;
	switch(config)#ip dhcp snooping vlan 10&lt;br /&gt;
	switch(config)#interface f0/1&lt;br /&gt;
	switch(config-if)#ip dhcp snooping trust&lt;br /&gt;
	switch(config-if)#switch access vlan 10&lt;br /&gt;
	switch(config-if)#interface f0/2&lt;br /&gt;
	switch(config-if)#switch access vlan 10&lt;br /&gt;
	switch(config-if)#interface f0/3&lt;br /&gt;
	switch(config-if)#switch access vlan 10&lt;br /&gt;
	---------------------------------------------------&lt;br /&gt;
	配置与交换机f0/1相连的路由器r1为dhcp服务器&lt;br /&gt;
	r1(config)#interface f0/1&lt;br /&gt;
	r1(config-if)#ip address 192.168.1.1 255.255.255.0&lt;br /&gt;
	r1(config)#ip dhcp execlude 192.168.1.1&lt;br /&gt;
	r1(config)#ip dhcp pool cisco&lt;br /&gt;
	r1(dhcp-config)#network 192.168.1.2 255.255.255.0&lt;br /&gt;
	r1(dhcp-config)#default-route 192.168.1.1&lt;br /&gt;
	---------------------------------------------------&lt;br /&gt;
	配置与交换机f0/2相连的路由器r2模拟为主机，从dhcp服务器获得ip&lt;br /&gt;
	r2(config)#no ip routing&lt;br /&gt;
	r2(config)#int f0/0&lt;br /&gt;
	r2(config-if)#ip address dhcp&lt;br /&gt;
	------------------------------------------------------&lt;br /&gt;
	配置与交换机f0/3相连的路由器r3模拟为主机，ip地址配置为dhcp服务器地址，作为攻击者&lt;br /&gt;
	---------------------------------------------------------&lt;br /&gt;
	验证：&lt;br /&gt;
	Switch#show ip dhcp snoopi bind&lt;br /&gt;
	MacAddress IpAddress Lease(sec) Type VLAN Interface&lt;br /&gt;
	------------ ----------- ---------- --------- ------- ------------&lt;br /&gt;
	00:10:7B:3C:01:DA 192.168.1.2 85781 dhcp-snooping 10 FastEthernet0/4&lt;br /&gt;
	Total number of bindings: 2&lt;br /&gt;
	----------------------------------------------------------------------------&lt;br /&gt;
	Switch#show ip dhcp snoopi&lt;br /&gt;
	Switch DHCP snooping is enabled&lt;br /&gt;
	DHCP snooping is configured on following VLANs:&lt;br /&gt;
	10&lt;br /&gt;
	Insertion of option 82 is disabled&lt;br /&gt;
	Option 82 on untrusted port is not allowed&lt;br /&gt;
	Verification of hwaddr field is enabled&lt;br /&gt;
	Interface Trusted Rate limit (pps)&lt;br /&gt;
	------------------------ ------- ----------------&lt;br /&gt;
	FastEthernet0/1 yes unlimited&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
	配置DHCP监听的绑定表代理&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 指定绑定表代理和数据库文件位置（可选）&lt;br /&gt;
	ip dhcp snooping database flash:/文件名|tftp://文件名|ftp://用户名：密码@主机/文件名|http://[[用户名：密码]@]主机名|主机地址/目录/文件.tar&lt;br /&gt;
	3） 指定绑定表数据库传输超时时间&lt;br /&gt;
	ip dhcp snooping database timeout 秒数&lt;br /&gt;
	秒数：取值为0-86400，默认为300秒&lt;br /&gt;
	4） 值定绑定表数据库写入延迟时间&lt;br /&gt;
	ip dhcp snooping database write-delay 秒数&lt;br /&gt;
	秒数：取值为15-86400，默认为300秒（15分钟）&lt;br /&gt;
	5） 进入特权模式 end&lt;br /&gt;
	6） 手工值定绑定表条目&lt;br /&gt;
	ip dhcp snooping binding mac地址 vlan vlan号 IP地址 interface 接口 expiry 秒数&lt;br /&gt;
	expiry:这条静态条目到期的时间，取值为1-4294967295&lt;br /&gt;
	7） 验证结果&lt;br /&gt;
	show ip dhcp snooping database&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
	第五部分 IP源保护（IP Source Guard）&lt;br /&gt;
	IPSG提供检测机制来确保单个接口所接收到的数据包能够被各个接口所接收。如果检查成功通过，那么就将许可数据包；否则就会发生违背策略的活动。IPSG不仅能够确保第2层网络中终端设备的IP地址不会被劫持，而且还能确保非授权设备不能通过自己指定IP地址的方式来访问网络或导致网络崩溃及瘫痪。&lt;br /&gt;
	在DHCP监听绑定表或静态IP源绑定的帮助下，IPSG能够获得有效的源端口信息。在不信任端口上启用dhcp snooping和ip源保护之后，交换机将阻止除了dhcp数据包之外的所有流量。一旦DHCP服务器分配了IP地址，那么就更新dhcp绑定表。IPSG然后会自动在接口加载基于端口的vlan访控（PACL）。这样将客户端流量限定到绑定表中所配置的源IP地址。对于来自源IP绑定之外的其他源IP地址的主机端口的流量，将会被过滤。&lt;br /&gt;
	IP源保护只支持第2层端口，其中包括介入access和干道trunk接口。对于不信任端口（第2层），存在以下两种级别的IP流量安全过滤：&lt;br /&gt;
	* 源IP地址过滤：根据源IP地址对IP流量进行过滤，只有当源IP地址与IP源绑定条目匹配，IP流量才允许通过。&lt;br /&gt;
	当端口创建、修改、删除新的IP源绑定条目的时候，IP源地址过滤器将发生变化。为了能够反映IP源绑定的变更，端口PACL将被重新修改并重新应用到端口上。&lt;br /&gt;
	默认情况下，如果端口没有任何IP源绑定配置的情况下启用了ip源保护，默认的PACL将拒绝端口的所有流量。如果你取消了IP源保护，端口的ACL也会从接口上移除。&lt;br /&gt;
	* 源IP和MAC地址过滤：根据源IP地址和MAC地址对IP流量进行过滤，只有当源IP地址和MAC地址与IP源绑定条目匹配，IP流量才允许通过。&lt;br /&gt;
	当以IP和MAC地址作为过滤的时候，为了确保DHCP协议能够正常的工作，还必须启用DHCP监听选项82，对于没有选项82的数据，交换机不能确定用于转发DHCP服务器响应的客户端主机端口。相反地，DHCP服务器响应将被丢弃，客户机也不能获得ip地址&lt;br /&gt;
	交换机使用端口安全来过滤源maC地址，所以端口上的端口安全的违规处理将关闭。&lt;br /&gt;
	配置过程：&lt;br /&gt;
	注意：&lt;br /&gt;
	1． 在某个VLAN上启用基于源IP地址的IP源保护之前，必须先启用DHCP监听功能&lt;br /&gt;
	2． 如果是在TRUNK接口上对于多个VLAN启用IP源保护，必须在所有的VLAN上启用DHCP监听，同时要应用基于源IP过滤策略在所有的VLAN&lt;br /&gt;
	3． 启用基于源ip和mac地址的IP源保护之前，必须启用DHCP监听和端口安全（Port security）&lt;br /&gt;
	4． 在私有vlan上启用基于源ip和mac地址的IP源保护，端口安全是不支持的&lt;br /&gt;
	5． IP源保护不支持以太通道（EthenChannel）&lt;br /&gt;
	6． 在启用了802.x认证的情况下，也可以使用这种特性。&lt;br /&gt;
	配置：&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 启用IP源保护&lt;br /&gt;
	基于源IP地址的 ip verify source&lt;br /&gt;
	基于源IP和MAC地址的 ip verify source port-security&lt;br /&gt;
	注意：dhcp服务器必须支持选项82，或者客户端没有分配到IP地址。同时MAC地址不能被学习为安全地址&lt;br /&gt;
	5） 进入全局模式，添加静态的IP源绑定&lt;br /&gt;
	ip source binding mac地址 vlan vlan号 ip地址 interface 接口&lt;br /&gt;
	6） 验证结果&lt;br /&gt;
	show ip verify source [interface 接口]&lt;br /&gt;
	show ip source binding [ip地址] [mac地址] [interfac, e 接口] [vlan vlan号] [dhcp snooping|static]&lt;br /&gt;
	案例：&lt;br /&gt;
	我们接着上部分试验继续&lt;br /&gt;
	Switch(config)#interface f0/2&lt;br /&gt;
	Switch(config-if)#switchport port-security&lt;br /&gt;
	Switch(config-if)#ip verify source port-security&lt;br /&gt;
	Switch(config)#interface f0/3&lt;br /&gt;
	Switch(config-if)#switchport port-security&lt;br /&gt;
	Switch(config-if)#ip verify source port-security&lt;br /&gt;
	Switch(config-if)#exit&lt;br /&gt;
	Switch(config)#ip source binding 00e0.1e60.7c86 vlan 10 192.168.1.1 interface f0/1&lt;br /&gt;
	Switch(config)#end&lt;br /&gt;
	Switch#show ip source bind&lt;br /&gt;
	MacAddress IpAddress Lease(sec) Type VLAN Interface&lt;br /&gt;
	---------- ----------- ---------- ------------- ---- ----------------&lt;br /&gt;
	00:10:7B:3C:01:DA 192.168.1.2 85535 dhcp-snooping 10 fastEthernet0/2&lt;br /&gt;
	00:E0:1E:60:7C:86 192.168.1.1 infinite static 10 fastEthernet0/1&lt;br /&gt;
	Total number of bindings: 3&lt;br /&gt;
	----------------------------------------------------------------&lt;br /&gt;
	Switch#show ip verify source&lt;br /&gt;
	Interface Filter-type Filter-mode IP-address Mac-address Vlan&lt;br /&gt;
	--------- ---------- ----------- --------------- ------------- ----------&lt;br /&gt;
	Fa0/2 ip-mac active 192.168.1.2 permit-all 10&lt;br /&gt;
	Fa0/3 ip-mac active deny-all permit-all 10&lt;br /&gt;
	&lt;br /&gt;
	第六部分 动态ARP检测&lt;br /&gt;
	DAI(Dynamic ARP Inspection)动态ARP检测是一种能够验证网络中ARP地址解析协议数据报的安全特性。通过DAI，网络管理员能够拦截、记录和丢弃具有无效MAC地址/IP地址绑定的ARP数据包。&lt;br /&gt;
	&lt;br /&gt;
	如上图，主机A、主机B、主机C连接到交换机中相同的网络或同一个vlan中。主机A需要与主机B进行通信，主机A广播ARP请求通过主机B的IP地址（IB）来获得主机B的MAC地址。因为ARP请求是以广播的形式传送，交换机和主机B收到主机A发出的ARP请求之后，会在自己的ARP缓存中创建或更新主机A的MAC地址（MA）和IP地址（IA），然后主机B一单播得形式发送ARP响应，交换机和主机A收到ARP响应之后，主机A将更新自己的ARP缓存，将主机B的IP地址和MAC地址对应。&lt;br /&gt;
	主机C破坏交换机的ARP缓存，主机C发送伪造的ARP响应（将自己的MAC地址代替真实主机的MAC地址，比如主机C用自己的MAC地址（MC）替代主机B发给主机A的MAC地址（MB）），使得主机A（或主机B）的IP地址和主机C的MAC地址（MC）对应，主机C以中间人的身份发起攻击。这样造成主机A不能拥有主机B真实的MAC地址的ARP条目，同样，主机B也认为主机C的MAC地址是映射到主机A IP地址的真实地址。对于主机A和主机B之间的通信，都会被发往主机C，主机C能够在阅读内容后进行流量的重定向。&lt;br /&gt;
	动态ARP检测是一个安全特性，通过DAI，网络管理员能够检测、拦截、记录和丢弃具有无效MAC地址/IP地址绑定的ARP数据包。能够预防&amp;ldquo;中间人&amp;rdquo;的攻击。&lt;br /&gt;
	动态ARP检测只会转发合法的ARP请求和响应包，他会：&lt;br /&gt;
	* 检测不信任的端口上的所有ARP请求和响应包&lt;br /&gt;
	* 在更新本地的ARP缓存和转发ARP数据包到目的地之前，会检测是否是合法的IP和MAC地址对应内容。&lt;br /&gt;
	* 如果确认是不合法的数据包，他会丢弃数据包并记录这个违规的行为。&lt;br /&gt;
	动态ARP检测依据一个信任的数据库（如手工配置或dhcp监听绑定表）中合法的IP对应MAC地址的条目来判断数据包的合法性。这个数据库可以手工指定配置或者在vlan中启用了dhcp监听动态学习建立。如果ARP数据包是在信任端口上接收到的，交换机不会做任何检测直接转发ARP数据包。如果是从不信任端口上接收到ARP数据包，交换机只会转发合法的数据包。&lt;br /&gt;
	在DHCP服务器存在的环境下，可以在每个VLAN中启用DHCP监听和ip arp inspection vlan命令来启用动态ARP检测。如果没有DHCP环境，用户需要使用arp 访问列表手工配置IP地址来启用动态ARP检测合法的数据包。&lt;br /&gt;
	接口信任状态和网络安全&lt;br /&gt;
	如果ARP数据包是在信任端口上接收到的，交换机不会做任何检测直接转发ARP数据包。如果是从不信任端口上接收到ARP数据包，交换机只会转发合法的数据包。&lt;br /&gt;
	在一个典型的网络中，交换机中所有连接主机的端口配置为不信任端口，所有交换机与交换机相连的端口配置为信任端口。如下图，交换机A和交换机B运行动态ARP检测，主机1和主机2需要从连接到交换机A的dhcp服务器来获得IP地址，交换机1建立主机1和主机2的IP和MAC地址的绑定信息，交换机B建立主机2的IP和MAC地址的绑定信息。如果交换机A和交换机B连接的端口设置为不信任端口，从主机1发出的ARP数据包到达交换机B时，会被交换机B丢弃，这样主机1和主机2的联系就中断了。&lt;br /&gt;
	&lt;br /&gt;
	配置过程：&lt;br /&gt;
	默认配置：&lt;br /&gt;
	特性 默认配置&lt;br /&gt;
	-----------------------------------------&lt;br /&gt;
	动态ARP检测 所有vlan中不启用&lt;br /&gt;
	接口信任状态 所有接口是不信任&lt;br /&gt;
	进入ARP数据包流量限制 不信任端口：15 pps信任端口：没有限制&lt;br /&gt;
	没有dhcp环境下的arp访控 没有定义&lt;br /&gt;
	合法核实 没有核实允许&lt;br /&gt;
	日志缓冲 所有拒绝和丢弃arp数据包的行为都会被记录日志的缓冲大小为32系统信息数被限制为5秒钟一次&lt;br /&gt;
	每个vlan的日志 所有的拒绝和丢弃的行为都被记录&lt;br /&gt;
	配置DHCP环境的DAI&lt;br /&gt;
	1） 配置相应的DHCP监听和IP源保护&lt;br /&gt;
	2） 进入全局模式 configure terminal&lt;br /&gt;
	3） 在指定的vlan上启用动态ARP检测&lt;br /&gt;
	ip arp inspection vlan vlan范围&lt;br /&gt;
	4） 进入接口模式 interface 接口&lt;br /&gt;
	5） 指定信任端口&lt;br /&gt;
	ip arp inspection trust&lt;br /&gt;
	6） 验证结果&lt;br /&gt;
	show ip arp inspection&lt;br /&gt;
	show ip arp inspection database&lt;br /&gt;
	show ip arp inspection vlan vlan号&lt;br /&gt;
	show ip arp inspection statistes vlan vlan号&lt;br /&gt;
	案例：&lt;br /&gt;
	&lt;br /&gt;
	swA#config terminal&lt;br /&gt;
	swA(config)#ip dhcp snooping&lt;br /&gt;
	swA(config)#ip dhcp snooping vlan 10&lt;br /&gt;
	swA(config)#ip arp inspection vlan 10&lt;br /&gt;
	swA(config)#interface f0/1&lt;br /&gt;
	swA(config-if)#ip dhcp snooping trust&lt;br /&gt;
	swA(config-if)#switch access vlan 10&lt;br /&gt;
	swA(config-if)#interface f0/2&lt;br /&gt;
	swA(config-if)#switch access vlan 10&lt;br /&gt;
	swA(config)#interface f0/23&lt;br /&gt;
	swA(config-if)#ip arp inspection trust&lt;br /&gt;
	--------------------------------------------------&lt;br /&gt;
	swB#config terminal&lt;br /&gt;
	swB(config)#ip dhcp snooping&lt;br /&gt;
	swB(config)#ip dhcp snooping vlan 10&lt;br /&gt;
	swB(config)#ip arp inspection vlan 10&lt;br /&gt;
	swB(config-if)#interface f0/3&lt;br /&gt;
	swB(config-if)#switch access vlan 10&lt;br /&gt;
	swB(config)#interface f0/23&lt;br /&gt;
	swB(config-if)#ip arp inspection trust&lt;br /&gt;
	swB(config-if)#ip dhcp snooping trust&lt;br /&gt;
	-----------------------------------------------------------&lt;br /&gt;
	与交换机A fa0/1相连的路由器扮演dhcp服务器的角色&lt;br /&gt;
	dhcpserver#conf ter&lt;br /&gt;
	dhcpserver(config)#ip dhcp excluded-address 192.168.1.1&lt;br /&gt;
	dhcpserver(config)#ip dhcp pool cisco&lt;br /&gt;
	dhcpserver(dhcp-config)#network 192.168.1.0 255.255.255.0&lt;br /&gt;
	dhcpserver(dhcp-config)#default-route 192.168.1.1&lt;br /&gt;
	-------------------------------------------------------------&lt;br /&gt;
	与交换机A fa0/2相连的路由器扮演主机1的角色&lt;br /&gt;
	host1(config)#no ip routing&lt;br /&gt;
	host1(config)#int e0&lt;br /&gt;
	host1(config-if)#ip address dhcp&lt;br /&gt;
	-------------------------------------------------------------&lt;br /&gt;
	与交换机B fa0/3相连的路由器扮演主机2的角色&lt;br /&gt;
	host2(config)#no ip routing&lt;br /&gt;
	host2(config)#int f0/0&lt;br /&gt;
	host2(config-if)#ip address dhcp&lt;br /&gt;
	------------------------------------------------------------&lt;br /&gt;
	SWA#show ip dhcp snoo bind&lt;br /&gt;
	MacAddress IpAddress Lease(sec) Type VLAN Interface&lt;br /&gt;
	------------- -------------- ---------- ---------- ---- ----------------&lt;br /&gt;
	00:E0:1E:60:7C:86 192.168.1.2 83702 dhcp-snooping 10 FastEthernet0/2&lt;br /&gt;
	Total number of bindings: 1&lt;br /&gt;
	-------------------------------------------------------------------------&lt;br /&gt;
	SWA#show ip arp inspection&lt;br /&gt;
	Source Mac Validation : Disabled&lt;br /&gt;
	Destination Mac Validation : Disabled&lt;br /&gt;
	IP Address Validation : Disabled&lt;br /&gt;
	Vlan Configuration Operation ACL Match Static ACL&lt;br /&gt;
	---- ------------- --------- --------- ----------&lt;br /&gt;
	10 Enabled Active&lt;br /&gt;
	Vlan ACL Logging DHCP Logging&lt;br /&gt;
	---- ----------- ------------&lt;br /&gt;
	10 Deny Deny&lt;br /&gt;
	Vlan Forwarded Dropped DHCP Drops ACL Drops&lt;br /&gt;
	---- --------- ------- ---------- ---------&lt;br /&gt;
	10 0 0 0 0&lt;br /&gt;
	Vlan DHCP Permits ACL Permits Source MAC Failures&lt;br /&gt;
	---- ------------ ----------- -------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data&lt;br /&gt;
	---- ----------------- ---------------------- ---------------------&lt;br /&gt;
	&lt;br /&gt;
	Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data&lt;br /&gt;
	---- ----------------- ---------------------- ---------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	------------------------------------------------------------------------&lt;br /&gt;
	SWA#show ip arp inspection statistics vlan 10&lt;br /&gt;
	Vlan Forwarded Dropped DHCP Drops ACL Drops&lt;br /&gt;
	---- --------- ------- ---------- ---------&lt;br /&gt;
	10 0 0 0 0&lt;br /&gt;
	Vlan DHCP Permits ACL Permits Source MAC Failures&lt;br /&gt;
	---- ------------ ----------- -------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data&lt;br /&gt;
	---- ----------------- ---------------------- ---------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	-------------------------------------------------------------------------&lt;br /&gt;
	SWA#show ip arp inspection inter&lt;br /&gt;
	Interface Trust State Rate (pps) Burst Interval&lt;br /&gt;
	--------------- ----------- ---------- --------------&lt;br /&gt;
	Fa0/1 Untrusted 15 1&lt;br /&gt;
	Fa0/2 Untrusted 15 1&lt;br /&gt;
	Fa0/3 Untrusted 15 1&lt;br /&gt;
	Fa0/4 Untrusted 15 1&lt;br /&gt;
	Fa0/5 Untrusted 15 1&lt;br /&gt;
	Fa0/6 Untrusted 15 1&lt;br /&gt;
	Fa0/7 Untrusted 15 1&lt;br /&gt;
	Fa0/8 Untrusted 15 1&lt;br /&gt;
	Fa0/9 Untrusted 15 1&lt;br /&gt;
	Fa0/10 Untrusted 15 1&lt;br /&gt;
	Fa0/11 Untrusted 15 1&lt;br /&gt;
	Fa0/12 Untrusted 15 1&lt;br /&gt;
	Fa0/13 Untrusted 15 1&lt;br /&gt;
	Fa0/14 Untrusted 15 1&lt;br /&gt;
	Fa0/15 Untrusted 15 1&lt;br /&gt;
	Fa0/16 Untrusted 15 1&lt;br /&gt;
	Fa0/17 Untrusted 15 1&lt;br /&gt;
	Fa0/18 Untrusted 15 1&lt;br /&gt;
	Fa0/19 Untrusted 15 1&lt;br /&gt;
	Fa0/20 Untrusted 15 1&lt;br /&gt;
	Fa0/21 Untrusted 15 1&lt;br /&gt;
	Fa0/22 Untrusted 15 1&lt;br /&gt;
	Fa0/23 Trusted None N/A&lt;br /&gt;
	Fa0/24 Untrusted 15 1&lt;br /&gt;
	Gi0/1 Untrusted 15 1&lt;br /&gt;
	Gi0/2 Untrusted 15 1&lt;br /&gt;
	Po13 Untrusted 15 1&lt;br /&gt;
	Po14 Untrusted 15 1&lt;br /&gt;
	--------------------------------------------------------------&lt;br /&gt;
	SWB#show ip arp inspection vlan 10&lt;br /&gt;
	Source Mac Validation : Disabled&lt;br /&gt;
	Destination Mac Validation : Disabled&lt;br /&gt;
	IP Address Validation : Disabled&lt;br /&gt;
	Vlan Configuration Operation ACL Match Static ACL&lt;br /&gt;
	---- ------------- --------- --------- ----------&lt;br /&gt;
	10 Enabled Active&lt;br /&gt;
	Vlan ACL Logging DHCP Logging&lt;br /&gt;
	---- ----------- ------------&lt;br /&gt;
	10 Deny Deny&lt;br /&gt;
	-------------------------------------------------------------------&lt;br /&gt;
	SWA#show ip arp inspection statistics&lt;br /&gt;
	Vlan Forwarded Dropped DHCP Drops ACL Drops&lt;br /&gt;
	---- --------- ------- ---------- ---------&lt;br /&gt;
	10 13 45 45 0&lt;br /&gt;
	Vlan DHCP Permits ACL Permits Source MAC Failures&lt;br /&gt;
	---- ------------ ----------- -------------------&lt;br /&gt;
	10 1 0 0&lt;br /&gt;
	Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data&lt;br /&gt;
	---- ----------------- ---------------------- ---------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	-----------------------------------------------------------------------&lt;br /&gt;
	检测攻击&lt;br /&gt;
	我们将主机2模拟为攻击者，将主机2的IP地址配置为主机1的IP地址&lt;br /&gt;
	Rack11SW2#ping 192.168.1.2&lt;br /&gt;
	Type escape sequence to abort.&lt;br /&gt;
	Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:&lt;br /&gt;
	14:36:50: %SW_DAI-4-DHCP_SNOOPING_DENY: 1 Invalid ARPs (Req) on Fa0/3, vlan 10.([0013.1a7f.8c21/192.168.1.2/0000.0000.0000/11.11.36.6/14:36:49 UTC Mon Mar 1 1993]).&lt;br /&gt;
	14:36:51: %SW_DAI-4-DHCP_SNOOPING_DENY: 1 Invalid ARPs (Res) on Fa0/3, vlan 10.([0013.1a7f.8c21/192.168.1.2/000d.bde6.a880/192.168.1.200/14:36:50 UTC Mon Mar 1 1993]).&lt;br /&gt;
	14:36:55: %SW_DAI-4-DHCP_SNOOPING_DENY: 1 Invalid ARPs (Res) on Fa0/3, vlan 10.([0013.1a7f.8c21/192.168.1.2/000d.bde6.a880/192.168.1.200/14:36:54 UTC Mon Mar 1 1993]).&lt;br /&gt;
	Success rate is 0 percent (0/5)&lt;br /&gt;
	----------------------------------------------------------------------------&lt;br /&gt;
	SWB#show arp&lt;br /&gt;
	Protocol Address Age (min) Hardware Addr Type Interface&lt;br /&gt;
	Internet 192.168.1.2 0 Incomplete ARPA&lt;br /&gt;
	配置非DHCP环境的动态ARP检测&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 定义arp的访问控制列表&lt;br /&gt;
	arp access-list 访控名称&lt;br /&gt;
	3） 定义允许列表内容&lt;br /&gt;
	permit ip host 发送者IP地址 mac host 发送者MAC地址&lt;br /&gt;
	4） 将arp访控应用到指定的vlan&lt;br /&gt;
	ip arp inspection filter arp访控名称 vlan vlan范围 [static]&lt;br /&gt;
	static:使用这个参数，访控将使用隐含的deny语句来拒绝arp数据包&lt;br /&gt;
	5） 验证结果&lt;br /&gt;
	show arp access-list&lt;br /&gt;
	案例：&lt;br /&gt;
	&lt;br /&gt;
	如图，把交换机A上相连的dhcp服务器去除，交换机B也配置了动态ARP检测。如果我们把交换机A的端口1配置为信任端口，因为信任端口是不会对arp数据包做任何的检测，这样交换机B或者主机2对交换机A和主机1会造成arp的攻击。这样交换机A的端口1配置为非信任端口，但为了主机2和主机1之间通信，必须在交换机A上应用一个arp访问控制列表允许主机2访问。如果主机2的IP地址不是静态的，必须将交换机A和交换机B在第3层上分隔开，两者之间添加路由器来路由两者之间的数据包。&lt;br /&gt;
	SwA#config terminal&lt;br /&gt;
	SWA(config)#arp access-list cisco&lt;br /&gt;
	SWA(config-arp-nacl)#permit ip host 192.168.1.3 mac host 0013.1a7f.8c21&lt;br /&gt;
	SWA(config-arp-nacl)#exit&lt;br /&gt;
	SWA(config)#int f0/23&lt;br /&gt;
	SWA(config-if)#no ip arp inspection trust&lt;br /&gt;
	SWA(config-if)#end&lt;br /&gt;
	SWA(config)#ip arp inspection filter cisco vlan 10&lt;br /&gt;
	--------------------------------------------------------------------------&lt;br /&gt;
	SWA#show arp access-list&lt;br /&gt;
	ARP access list cisco&lt;br /&gt;
	permit ip host 192.168.1.3 mac host 0013.1a7f.8c21&lt;br /&gt;
	-------------------------------------------------------------------------&lt;br /&gt;
	SWA#show ip arp inspection&lt;br /&gt;
	Source Mac Validation : Disabled&lt;br /&gt;
	Destination Mac Validation : Disabled&lt;br /&gt;
	IP Address Validation : Disabled&lt;br /&gt;
	Vlan Configuration Operation ACL Match Static ACL&lt;br /&gt;
	---- ------------- --------- --------- ----------&lt;br /&gt;
	10 Enabled Active cisco No&lt;br /&gt;
	Vlan ACL Logging DHCP Logging&lt;br /&gt;
	---- ----------- ------------&lt;br /&gt;
	10 Deny Deny&lt;br /&gt;
	Vlan Forwarded Dropped DHCP Drops ACL Drops&lt;br /&gt;
	---- --------- ------- ---------- ---------&lt;br /&gt;
	10 21 45 45 0&lt;br /&gt;
	Vlan DHCP Permits ACL Permits Source MAC Failures&lt;br /&gt;
	---- ------------ ----------- -------------------&lt;br /&gt;
	10 9 0 0&lt;br /&gt;
	Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data&lt;br /&gt;
	---- ----------------- ---------------------- ---------------------&lt;br /&gt;
	&lt;br /&gt;
	Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data&lt;br /&gt;
	---- ----------------- ---------------------- ---------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	配置ARP数据包的流量限制&lt;br /&gt;
	当进入的ARP数据包超过了配置的流量限定，交换机会将这个端口进入到err-disable状态。这个端口一直保持这种状态到err-disable恢复时间到期&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 进入接口模式 interface 接口&lt;br /&gt;
	3） 配置ARP数据包的流量限制&lt;br /&gt;
	ip arp inspection limit rate 每秒包数 [burst interval 秒数]&lt;br /&gt;
	PPS：每秒多少数据包，取值为0-2048，非信任端口上默认为每秒15数据包，信任端口上没有流量限制&lt;br /&gt;
	Burst interval:突发时间间隔，取值为1-15&lt;br /&gt;
	4） 配置使能端口err-disable状态的恢复&lt;br /&gt;
	errdisable recovery cause arp-inspection interval 秒数&lt;br /&gt;
	默认情况下，err-disable恢复是关闭的，恢复时间为300秒，取值为30-86400&lt;br /&gt;
	5） 验证结果&lt;br /&gt;
	show ip arp inspection interface&lt;br /&gt;
	SWA# show ip arp inspection interface f0/23&lt;br /&gt;
	Interface Trust State Rate (pps) Burst Interval&lt;br /&gt;
	--------------- ----------- ---------- --------------&lt;br /&gt;
	Fa0/23 Untrusted 200 5&lt;br /&gt;
	合法性的检查&lt;br /&gt;
	网络管理员能够根据IP对应MAC地址的绑定的合法性来拦截、记录和丢弃具有无效MAC地址/IP地址绑定的ARP数据包。交换机能够配置以目标的MAC地址、IP地址和源MAC地址来作为核实的依据。&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 配置合法性的检查依据&lt;br /&gt;
	ip arp inspection validate [src-mac|dst-mac|ip]&lt;br /&gt;
	3） 验证结果&lt;br /&gt;
	SWA#show ip arp inspection statistics vlan 10&lt;br /&gt;
	Vlan Forwarded Dropped DHCP Drops ACL Drops&lt;br /&gt;
	---- --------- ------- ---------- ---------&lt;br /&gt;
	10 0 0 0 0&lt;br /&gt;
	Vlan DHCP Permits ACL Permits Source MAC Failures&lt;br /&gt;
	---- ------------ ----------- -------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	Vlan Dest MAC Failures IP Validation Failures Invalid Protocol Data&lt;br /&gt;
	---- ----------------- ---------------------- ---------------------&lt;br /&gt;
	10 0 0 0&lt;br /&gt;
	配置日志的缓冲&lt;br /&gt;
	1） 进入全局模式 configure terminal&lt;br /&gt;
	2） 配置日志缓冲&lt;br /&gt;
	ip arp inspection log-buffer entrie 条数 | logs 数目 interval 秒数&lt;br /&gt;
	entrie 数目：指定日志缓冲的条目个数，取值为0-1024&lt;br /&gt;
	logs 数目 interval 秒数：在指定的时间间隔内，产生系统信息的条目数目&lt;br /&gt;
	3） 指定记录日志的类型，默认情况下，所有拒绝和丢弃的行为都会被记录。&lt;br /&gt;
	ip arp inspection vlan vlan值 logging acl-match [matchlog] | dhcp-bindings [all|none|permit]&lt;br /&gt;
	acl-match:记录符合arp 访控列表条目permit或deny的内容&lt;br /&gt;
	dhcp-bindings:记录匹配dhcp绑定表的内容&lt;br /&gt;
	4） 验证结果&lt;br /&gt;
	show ip arp inspection log&lt;br /&gt;
	案例：&lt;br /&gt;
	SWA(config)#ip arp inspection log-buffer entrie 15&lt;br /&gt;
	SWA(config)#ip arp inspection log-buffer logs 100 interval 60000&lt;br /&gt;
	SWA#show ip arp inspection log&lt;br /&gt;
	Total Log Buffer Size : 15&lt;br /&gt;
	Syslog rate : 100 entries per 60000 seconds.&lt;br /&gt;
	Interface Vlan Sender MAC Sender IP Num Pkts Reason Time&lt;br /&gt;
	---------- ---- -------------- ---------- ------- ----------- ----&lt;br /&gt;
	Fa0/3 10 0013.1a7f.8c21 192.168.1.3 1 DHCP Deny 15:59:31 UTC&lt;br /&gt;
	&lt;br /&gt;
	Mon Mar 1 1993&amp;nbsp;&lt;/p&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/11/22/sysu-nat.html&quot;&gt;出口ip,mark一下&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/03/9/tcp.html&quot;&gt;TCP: SYN ACK FIN RST PSH URG 详解&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/02/24/linux-clear.html&quot;&gt;linux入侵踪迹隐藏攻略&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/01/19//&quot;&gt;一个Linux下的入侵响应案&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2012/01/11/switch-Security.html&quot;&gt;http://blog.hi-suke.com/2012/01/11/switch-Security.html&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/608636251/visionblog/feedsky/s.gif?r=http://blog.hi-suke.com/2012/01/11/switch-Security.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><pubDate>Wed, 11 Jan 2012 17:45:31 +0800</pubDate><guid isPermaLink="false">http://blog.hi-suke.com/entry/switch-Security</guid><dc:creator>vision4fun</dc:creator><fs:srclink>http://blog.hi-suke.com/2012/01/11/switch-Security.html</fs:srclink><fs:srcfeed>http://blog.hi-suke.com/feed</fs:srcfeed><fs:itemid>feedsky/visionblog/~8885042/608636251/5398154</fs:itemid></item><item><title>开源IaaS软件的比较 — 构架、功能、社区、商业及其他</title><link>http://blog.hi-suke.com/2011/12/6/virtualization-compare2.html</link><id xmlns="http://www.w3.org/2005/Atom">http://blog.hi-suke.com/entry/virtualization-compare2</id><content xmlns="http://www.w3.org/2005/Atom" type="html">&lt;p&gt;
	原文地址：&lt;a href=&quot;http://www.qyjohn.net/?p=1624&quot;&gt;http://www.qyjohn.net/?p=1624&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	这一套幻灯片是应CSDN的邀请为12月16-17日在北京举行的&lt;a href=&quot;http://sd2china.csdn.net/&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;软件开发2.0技术大会&lt;/a&gt;准备的。文字部分是在幻灯片制作完毕后起草的发言稿。由于会议延期的原因，就先把幻灯片和文字内容通过博客发布出来，请各位同行不吝指教。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/01.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1629&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/01.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;01&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【讲座主题】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	大家好。感谢CSDN所提供的这个机会，使我能够和在座各位就基础构架服务方面的技术进行交流。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/112/02.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1633&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/02.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;02&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【个人介绍】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	首先做个简单的自我介绍。我叫蒋清野，是个半路出家的程序员。在过去10年中，我为四家公司提供过服务，并且在每一家公司所做的事情都跟上家有很大的不同。在座有一些朋友认识我，可能是参加过我在Sun 公司工作期间组织的各种技术推广活动，也可能是使用过我所提供的&lt;a href=&quot;http://www.unix-center.net/&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;Unix-Center.Net&lt;/a&gt;服务。在过去9 个月中，我短暂地为天涯社区工作，参与了天涯云计算平台的规划和实施。在这段时间里，我学习了一些与云计算 &amp;mdash; 尤其是基础构架服务 &amp;mdash; 有关的知识，也借助天涯社区的硬件条件做了一些测试和评估。今天这个讲座的内容，可以说是对过去9 个月里所学内容的一个总结。虽然这些总结还比较粗浅甚至是幼稚，我还是愿意通过CSDN所提供的这个平台与大家分享，希望能够得到大家的批评和指正。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（2 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/03.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1641&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/03.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;03&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【议题介绍】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	今天这个讲座，主要是从构架、功能、社区和商业的角度来对OpenNebula、Nimbus、OpenStack和Eucalyptus这四个开源IaaS软件进行比较。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在构架方面，我们关心的是它包括哪些组件，各个组件之间的关系以及通讯方式，以及这样的设计会如何影响到整个系统的扩展性和伸缩性。这里我们所说的扩展性，是指为相关软件添加新的功能模块的能力。举个例子说，当新的更好的虚拟化技术出现时，云管理员能不能相对容易地为新的虚拟化技术提供支持。在伸缩性方面，我们更关心的则是相关软件能够管理多大规模的数据中心。如果它不能够管理更大规模的数据中心，其性能瓶颈主要在什么地方。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在功能方面，我们关心的是它是否能够满足用户的需求。 我们所说的用户又可以分成两个类别，一个是IaaS服务的使用者也就是终端用户，另一个是IaaS服务的提供者也就是云管理员。对于终端用户来说，他所关心的是能不能够通过这个系统方便地申请、创建、启动、休眠、唤醒、关闭、销毁虚拟机，以及方便地监控自己账户下所有虚拟机的处理器、内存、磁盘和网络使用状况。对于云管理员来说，他所关心的是能不能够通过这个系统方便地监控整个数据中心 &amp;mdash; 甚至是多个数据中心 &amp;mdash; 所有物理机和虚拟机的资源使用状况，能不能在尽可能少的物理机上运行尽可能多的虚拟机以达到节能减排的目的。从理论上来讲，基础构架服务的终端用户只需要关心自己所使用的虚拟机资源而不必关心虚拟机后面的技术细节。但是当云服务出现故障的时候，我们会发现终端用户比云管理员更关心云服务的高可用性、数据备份策略等等细节，并且迫切地希望存在某些途径让自己的虚拟机和别人的虚拟机得到特殊的照顾和祝福。从工程的角度来讲世界上不存在绝对不会失效的系统，但是这些需求可以转变成功能或者是产品，使得云服务提供商可以为不同的用户提供不同的服务。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	为什么要关心社区？我们知道，大部分企业在选择解决方案的时候，成本是一个很重要的影响因子。最近几年&amp;ldquo;总体拥有成本&amp;rdquo;（Total Cost of Ownership, TCO）这个概念非常流行，意思就是说一个解决方案的成本包括两个部分，一个是初期的购置和安装成本，另外一个是后期的维护和服务成本。卖商业软件的通常会跟我们讲：&amp;ldquo;你买我们的解决方案，出了问题我们给你解决。你用那些开源软件，出了问题怎么办？&amp;rdquo;做我们这一行的都知道，后期的维护和服务成本类似于买保险，在大多数时候起的是心理安慰和推卸责任的作用。但是如果这个保险没有买，出了问题就只能够找社区了。因此，我们在这里专门讨论一下与这几个开源软件所关联的社区的规模、活跃度和参与度。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	最后我们会花一点时间讨论一下开源软件的商业模式问题。这个问题又可以分为两个方面，一方面是开源软件开发者如何盈利，另一方面是开源软件使用者如何获得专业支持和服务。对于基础构架服务这种关键性应用来说，在软件选型过程当中如果不考虑开源软件的商业模式问题，将来可能会遇到一些意想不到的麻烦和困难。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（6 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/04.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1654&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/04.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;04&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【构架/功能 &amp;mdash; 概述】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	首先我们从构架的角度来看看基础构架服务由哪几个层面的技术组成。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	左上角这个图片是虚拟化技术示意图。通过虚拟化技术，一台计算机可以被虚拟成多台计算机，每台虚拟机拥有独立的处理器、内存、硬盘和网络接口。使用虚拟化技术能够提高硬件资源的利用率，使得多个应用能够运行在同一台物理机上但是彼此隔离，各自拥有独立的操作系统和其他运行环境。这张幻灯片上所提到的Xen、KVM和VMWare等等，是已经被业界广泛认可的几种虚拟化技术。还有一些比较小众的虚拟化技术，在这里就不一一列出了。经过这么多年的发展，虚拟化技术已经非常成熟。越来越多的公司正在将虚拟机部署到生产环境中。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	当我们需要在多台物理机上创建多个虚拟机并且维护多个运行环境时，我们就需要一个工具来帮助我们对物理机和虚拟机进行管理，也就是右上角这个图片里的虚拟化管理。一个相对完整的虚拟化管理系统通常会提供如下几个方面的功能。（1）通过资源池的方式对物理资源进行重新组织；（2）虚拟机生命周期管理，例如创建、启动、休眠、唤醒、关闭、迁移、销毁虚拟机；（3）将常用的运行环境保存为虚拟机模板，可以方便地创建一系列相同或者是相似的运行环境；（4）在计算资源允许的情况下提供高可用性、动态负载均衡、备份与恢复；（5）对所有的物理机和虚拟机进行监控，生成报表并在必要的情况下发出预警。这张幻灯片上所提到的Oracle VM、CloudStack和ConVirt等等，是一些比较有代表性的虚拟化管理软件。由于空间有限，很多优秀的虚拟化管理软件我就不在这里一一列出了。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	虚拟化管理软件的用户，通常是运维人员，也就是管理服务器、交换机、存储和数据中心的工程师。对于实行的是集中式IT资源管理的组织来说，虚拟化管理软件大大地提高了运维部门的效率。在互联网这个行业，大家经常抱怨的就是基础设施的建设跟不上项目建设的需要，计算资源申请、采购、安装、上架、开通的流程太长。现在运维人员不再给业务部门分配物理机，而是通过虚拟化管理软件分配虚拟机，因此这个流程被大大缩短了。但是对于需要经常性地重装系统的开发和测试团队来说，他们还是需要经常性地麻烦运维人员给他们重新分配虚拟机、安装操作系统以及配置运行环境。他们迫切地希望有一个环境，能够自己完成创建、启动、休眠、唤醒、关闭、迁移、销毁等虚拟机生命周期管理任务。不仅如此，他们还希望能够通过一系列自定义的程序来自动地完成这些任务，或者是将这些功能和自己日常使用的一些工具整合在一起。与此同时，拥有大量物理服务器的单位在使用虚拟化技术以后突然发现自己的服务器买得太多了，希望通过虚拟机的方式将多余的计算资源租赁给其他单位使用。为了满足这样的需求，就出现了终端用户通过浏览器自助式申请、开通、管理计算资源的解决方案，以及通过Web Service API将虚拟机生命周期管理操作暴露给第三方应用的解决方案。终端用户绕过了运维工程师，以自助服务的方式申请、开通、管理计算资源，就是我们所谓的基础构架服务。这张幻灯片上所提到的OpenNebula、Nimbus、OpenStack和Eucalyptus是一些开源的基础构架服务软件，而Amazon、DreamHost和Linode是一些业界比较知名的基础构架服务提供商。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	现在我们总结一下这张幻灯片上的内容：虚拟化技术利用单台物理机的计算资源提供多台相互独立的虚拟机，虚拟化管理软件使得运维人员能够方便地在大规模的数据中心实施虚拟化技术。而在虚拟化管理软件的基础上进行封装，使终端用户能够以自助服务的方式获得计算资源，就是我们所谓的基础构架服务。为了让大家进一步了解基础构架服务都是怎么实现的，我们接下来以OpenNebula、Nimbus、OpenStack和Eucalyptus为例子，分析一下他们的构架和功能。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（7 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/05.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1699&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/05.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;05&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【构架/功能 &amp;mdash; OpenNebula 3.0】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	接下来我们通过四张图片来展示OpenNebula 3.0在不同层次上的设计思路。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	左上角这张图片是 OpenNebula的整体构架图。（1）前端（FRONT-END）通过浏览器和Web Service向云管理员和终端用户提供服务。（2）ONED是OpenNebula的核心服务进程，包括虚拟化管理模块和任务调度模块。（3）ONED通过SSH方式连接到计算节点，并通过虚拟化驱动（Drivers）来调用计算节点上的虚拟化控制命令。当计算节点使用KVM或者是VMWare ESXi作为虚拟化技术时，OpenNebula使用libvirt所提供的接口远程调用计算节点上的虚拟化控制命令。当计算节点使用Xen作为虚拟化技术时，OpenNebula通过SSH登录到计算节点执行相关的虚拟化控制命令。（4）计算节点通过前端的映像驱动（Images）获得需要运行的操作系统映像文件。需要说明的是，还有一些前端模块没有出现在这个图上。这些前端模块包括监控、用户界面和云服务API。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	左下角这张图片是OpenNebula的存储结构图。OpenNebula使用映像仓库（Image Repository）来保存操作系统映像文件。这个映像仓库要能够被OpenNebula的前端直接访问，可以是SAN、NAS或者是磁盘阵列等其他存储设备。我们创建虚拟机的时候，ONED首先通过任务调度器确定将要运行该虚拟机的计算节点，然后将相应的磁盘映像文件拷贝到计算节点上，最后通过虚拟化驱动调用相应的虚拟化技术创建虚拟机并启动运行。对于一个小型的私有云来讲，可以简单地使用类似于NFS的共享文件系统方式将同一个目录挂载到前端服务器和所有的计算节点上。通过使用共享文件系统，可以缩短部署虚拟机所需要的时间，还可以方便地实现虚拟机的在线迁移。使用共享文件系统的时候需要注意的是，如果某些虚拟机频繁地进行磁盘IO操作的话，部署在同一共享文件系统上的所有虚拟机都会受到影响。在这种情况下，可以考虑将磁盘IO密集型虚拟机的磁盘映像文件缓存在计算节点上，这样只有运行在同一计算节点上的虚拟机会受到影响。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在网络方面，OpenNebula通过在计算节点上配置网桥的方式为虚拟机提供网络连接。在右上角的这张示意图上，一个计算节点配置了两个网桥，其中一个连接到公网，另外一个连接到内网。需要注意的是，在同一个计算集群中，所有计算节点的网桥配置必须是同样的。另外，OpenNebula可以通过配置文件来指定某个网络可用的IP范围，并且在创建虚拟机的时候通过配置文件直接指定虚拟机的IP，因此OpenNebula可以在没有DHCP服务器的情况下为虚拟机分配IP。除此之外，我想在座的各位对网桥的设置都不陌生了，在这里我就不再重复这些常识了。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	刚才我们所提到的构架、存储和网络，都属于虚拟化管理的范畴。在虚拟化管理的基础上，OpenNebula使用一个称为SunStone的用户界面，使得云管理员和终端用户都能够通过浏览器访问被OpenNebula所管理的基础构架，在各自的权限范围内执行虚拟机生命周期管理操作，就形成了一个完整的基础构架服务系统。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（7 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/061.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1720&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/061.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;06&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【构架/功能 &amp;mdash; Nimbus 2.8】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	接下来我们看一看Nimbus这个项目。从左上角的构架图来看，Nimbus的构架设计和OpenNebula是非常相像的。用户通过浏览器界面访问Nimbus服务，管理节点通过SSH和libvirt调用计算节点上的Xen或者KVM命令。不同的地方主要有两个，一个是它通过DHCP服务器为虚拟机分配IP，另外一个是它使用了一个名为Cumulus的云存储服务。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	左下角这张图是Cumulus云存储的构架图。可以看出，Cumulus由多个功能模块组成。从顶层看，它是一个与Amazon S3相兼容的云存储服务； 从底层看，它可以搭建在简单的本地硬盘或者是负责的HDFS上。在云计算这个领域，Amazon S3是事实上的云存储标准。Nimbus使用云存储来提供存储服务，从构架上来说比使用共享文件系统的OpenNebula更接近于Amazon EC2/S3。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	各位可能会问，用云存储来作为基础构架服务的关键组件，在性能上会不会有问题呢？右边这两张图展示的分别是Culumus、scp、gridFtp和本地文件系统在上载和下载不同大小的文件时的吞吐量。从这两张图可以看出，当被操作的文件较小的情况下，Culumus的性能较差，但是与scp和gridFtp的性能在同一水平上；当被操作的文件大小超过1 GB的时候，Culumus的性能与本地文件系统接近。考虑到操作系统应先文件的大小通常会超过1 GB，可以认为使用Culumus来存储操作系统映像文件是没有问题的。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（3 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/07.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1742&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/07.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;07&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【构架/功能 &amp;mdash; Eucalyptus 2.0.3】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	接下来我们看一看Eucalyptus这个项目。Eucalyptus的构架和OpenNebula以及Nimbus相比有两个明显的不同。首先，在计算节点（Node Controller）和云控制器（Cloud Controller）之间，多了一个叫做集群控制器（Cluster Controller）的组件。其次，在Eucalyptus中有两个负责存储的组件，一个叫做Walrus存储控制器（Walrus Storage Controller，缩写成WS3），另外一个叫做弹性块存储（Elastic Block Storage，缩写成EBS）。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	引入集群控制器这个组件后，Eucalyptus中的虚拟化管理功能就由集群控制器来承担。也就是说，当用户向Eucalyptus的云控制器请求计算资源的时候，Eucalyptus的云控制器根据各个计算集群的资源使用状况将用户的请求转发给某个计算集群的集群控制器，集群控制器再根据本集群中各个计算节点的资源使用状况决定在哪个计算节点上创建和运行虚拟机。我们把Eucalyptus的构架和OpenNebula以及Nimbus的构架来做个比较，可以看出Eucalyptus的计算集群和OpenNebula以及Nimbus在功能上基本是等价的。我们知道，当计算节点的数量较多的时候，虚拟化管理模块以及系统监控模块的压力就会比较大，可能会影响到整个系统的性能。我们假定Eucalyptus、OpenNebula以及Nimbus的虚拟化管理模块的实现水平是相当的，当OpenNebula和Nimbus由于计算节点数量增加而出现性能问题的时候，Eucalyptus可以通过增加计算集群的方法来实现横向扩展。从这个意义上说，Eucalyptus的构架设计提供了更大程度的扩展性，能够支撑更大规模的基础构架。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	刚才我们说到，Eucalyptus中有两个负责存储的组件。一个是WS3，与Amazon的简单存储服务（Simple Storage Service，S3）相对应；另外一个是EBS，与Amazon的弹性块存储（Elastic Block Store，EBS）相对应。EBS可以被当做块设备挂载到虚拟机上，相当于云硬盘。EBS能够提供较大的容量，具有较好的IO性能。S3则是一种基于Key-Value的网络存储，有人也把它叫做云存储。S3使得用户能够通过简单的API在网络上存储和读取数据。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在我们已经提到的三个IaaS软件中，OpenNebula直接使用共享文件系统作为存储，Nimbus使用了一个类似于S3的Cumulus存储服务，Eucalyptus则进一步将云硬盘和云存储分开。从构架上来看，Eucalyptus的构架和Amazon 的EC2/S3服务最为接近。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	类似于S3的云存储服务使得用户能够通过简单的API在网络上存储和读取数据，但是对于数据密集型应用来说，使用S3服务可能会出现性能方面的问题。最近卡耐基梅隆大学（Carnegie Mellon University，CMU）的并行数据实验室（Parallel Data Labs）基于Walrus云存储实现了pWalrus云存储服务。大家看幻灯片上右下角这张图，可以看出pWalrus把数据存放在一个并行的文件系统上。对于互联网用户来讲，他可以通过简单的PUT和GET来读写数据；对于计算节点来讲，它既可以通过PUT和GET来读写数据，还可以直接用文件IO的模式来读写数据。经过这样的改进后，pWalrus能够提供更好的IO性能，也能够进一步保障数据的安全性。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（8 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/081.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1750&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/081.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;08&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【构架/功能 &amp;mdash; OpenStack】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	接下来我们看一看OpenStack这个项目。这个构架图看起来有点费劲，因为它不符合从上到下、从左到右的阅读习惯。另外，这张图里面的组件太多了，看起来有点眼花缭乱。这里我用几个不同颜色的方框给这些组件做一下分组，包含在橙色方框里面的是前端，包含在蓝色方框里面的是计算节点，包含在绿色方框里面的是存储服务。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	我们首先看一看前端这个部分。终端用户通过nova-api访问OpenStack请求计算资源。OpenStack首先对用户进行身份认证，然后通过任务调度器（nova-scheduler）确定在哪一个计算节点上创建新的虚拟机。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在计算节点这个部分，OpenStack通过libvirt和Xen API来进行虚拟机生命周期管理。计算节点上的网络界面，是通过nova-network这个组件来管理的。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在存储服务这个部分，OpenStack提供了两个存储组件。其中，nova-volume提供弹性块设备服务，相当于Amazon EBS；nova-objectstore提供简单存储服务，相当于Amazon S3。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	OpenStack的各个组件之间不共享任何状态，各个组件之间通过中间这张图中间用红色圈出的消息队列（MQ）来进行异步通讯。OpenStack中的任意组件可以安装在任意服务器上，只需要在配置文件里面指定MQ服务器的地址即可。因此，MQ可能成为整个系统的性能瓶颈。在这种情况下，可以通过增加一台MQ服务器来解决。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	到现在为止，我们已经能够全面了解了OpenNebula、Nimbus、Eucalyptus和OpenStack的构架。尽管每个软件的设计思路和实现细节各有千秋，但是都可以归结为三个比较大的模块：一是通常被称为云控制器的前端，包括用户界面、编程接口和任务调度组件；二是虚拟化管理，包括网络管理和虚拟机管理；三是存储服务，包括弹性块设备和简单存储服务。在这三大模块的基础上，还可以添加监控、报表、分析、计费等等外围组件。这些组件往往是运营方面的要求，不是基础构架服务的核心技术，在这里我们就不详细讨论了。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（4 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/092.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1764&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/092.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;09&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【构架/功能 &amp;mdash; 综合比较】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在了解过OpenNebula、Nimbus、Eucalyptus和OpenStack在构架上的差异之后，我们简单地比较一下这四个系统在功能上的差异。这里所说的功能，是指缺省的基本组件安装配置完毕后即可立即使用的功能，不包括尚未正式发布的试验性组件。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	首先我们从终端用户的角度来看，这个系统是不是有一个方便好用的门户或者是客户端去进行各种各样的操作。OpenNebula提供了基于浏览器的用户门户，Nimbus则提供了一个基于Java的桌面客户端，Eucalyptus和OpenStack则需要利用命令行工具或者是第三方解决方案。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在云主机、云硬盘和云存储着三类基础构架服务中，OpenNebula仅提供云主机服务，Nimbus增加了云存储服务，Eucalyptus和OpenStack都能够提供全面的服务。此外，OpenNebula的用户能够直接通过基于浏览器的VNC访问虚拟机的控制台（console），其他三个系统的终端用户暂时无法直接访问虚拟机的控制台。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	四个系统的终端用户均可创建自定义的虚拟机模板，但是实现的难易程度有较大差别。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	只有OpenNebula提供了简单的监控报表，能够报告虚拟机的处理器核内存使用状况。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在备份、恢复和用户账单等方面，基本还是空白。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	由于缺少存储方面的某些组件，OpenNebula和Nimbus所提供的服务并不完全兼容于Amazon EC2/S3，Eucalyptus和Nimbus则是和Amazon EC2/S3完全兼容的。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	其次我们从云管理员的角度去考察， 这个系统是不是有一个方便好用的门户或者是客户端去进行各种各样的操作。只有OpenNebula通过SunStone提供了基本上能够用的管理门户，Nimbus干脆就没有管理员门户，Eucalyptus有一个管理员门户但是能够做的事情非常有限，OpenStack有一个正在开发中的Dashboard但是不能够算数。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在服务器监控、虚拟机监控和监控报表这个领域，只有OpenNebula提供了凑合能用的解决方案，其他三个系统都没有这方面的功能。有人会说服务器和虚拟机的监控可以通过Nagios或者是Zabbix等等监控框架来实现。但是从基础构架服务的发展趋势来看，将监控组件纳入IaaS管理系统，是非常有必要的。这一点我接下来还会讲到。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	OpenNebula和OpenStack提供了基于命令行的虚拟机在线迁移功能，Nimbus和Eucalyptus则没有提供这个功能。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在物理机动态负载调整、虚拟机高可用性、备份与恢复、报警机制和运营计费等方面，基本还是空白。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在一个成熟的虚拟化管理系统（例如ConVirt）中，必然会有对物理机和虚拟机的监控模块。监控模块以一定的频率记录物理机和虚拟机的处理器、内存、磁盘、网络使用状况，并以图表的方式展现给用户。当虚拟机的运行状况有问题的时候，可以自动地重启（甚至是在另外的物理服务器上重启）虚拟机，从而实现虚拟机的高可用性。在这些监控数据的基础上，可以手动甚至是自动地对物理机的负载进行调整，譬如说通过在线迁移把某些负载比较轻的虚拟机整合到数量较少的服务器上，空闲出来的服务器就可以进入休眠状态从而达到节能的目的。当虚拟机的负载比较重的时候，系统又可以自动唤醒某些处于休眠状态的服务器，并通过在线迁移把一些虚拟机迁移到新的服务器上。大多数VPS用户都知道他们的虚拟机是和别人的虚拟机共享一台物理机的，但是他们可能不知道在同一台物理机上所运行的虚拟机的处理器总和是超过这台物理机的处理器总和的。同样，运营商卖出去的内存总和，也是超过物理机的内存总和的。这种情况我们叫做超售，也就是over-commit。对于一个基础构架服务提供商来说，必须要有一套监控分析、在线迁移、负载调整的工具才能够在实现超售的同时提供较好的用户体验。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	随着服务器性能的不断提高，数据中心虚拟化以及基础构架服务是一个不可阻挡的趋势。对于终端用户来说，他们需要的是一个简单易用的界面，只需要选择自己需要的软硬件配置即可立即开通自己所需要的计算资源，并且随时可以看在自己账户下所有计算资源的使用状况。对于云管理员来说，他们同样需要一个的简单易用界面，能够管理一个跨越多个数据中心的基础构架，能够基于系统的运行情况自动地进行负载调整，从而实现最大的投资收益。从目前的状况来看，与其他几个IaaS软件相比较，OpenNebula能够给终端用户和云管理员提供更多的功能。但是从基础构架服务提供商的角度来看，开放源代码的IaaS解决方案要进入生产环境，还有很长的路要走。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（8 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/10.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1781&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/10.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;10&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【社区/商业 &amp;mdash; 数据】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	现在我们花一点时间从社区和商业的角度来对开源IaaS软件进行一下比较。Nimbus这个项目的社区规模很小，没有明显的商业诉求，我们暂时把它放在这个分析比较之外。这张幻灯片上的四个图表，是我在今年9 月份根据2009年1月以来Eucalyptus、OpenNebula和OpenStack社区的邮件列表和论坛数据整理出来的。左边的这两张图，分别是每个月当中所产生的讨论主题数和帖子总数。右上方的这张图，则是当月参与了讨论的总人数。右下方的这张图，是每个月的帖子总数与讨论主题数的比值，我们暂且称之为参与度。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	显而易见，OpenNebula社区自2009年以来一直保持良好的发展势头，其讨论主题数、讨论帖子数和参与讨论的总人数都在稳步增长。但是该项目在 2011年4 月之后开始呈现衰落的势头。Eucalyptus社区在2010年6 月之前发展迅猛，无论是讨论主题数、讨论帖子数和参与讨论的总人数都是OpenNebula社区的两到三倍左右。但是Eucalyptus社区自2010 年6 月之后逐步衰落，尽管在2010年10月前后有过数次复兴的趋势，但是最终日渐式微并于2011年5 月前后降低到OpenNebula社区的同等水平。新兴的OpenStack社区在创立初期发展缓慢，但是从2011年1 月起呈现出爆发的势头。目前OpenStack社区的讨论主题数、讨论帖子数和参与讨论的总人数都在OpenNebula社区和Eucalyptus社区 之上，但是尚未达到Eucalyptus社区在2010年6 月的规模。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	通常来讲，一个讨论主题得到的回复数越多，表明该主题的讨论越深入。一个论坛或者邮件列表如果只有主帖而没有回复，说明这个社区的参与程度很低。因此，平均意义上的&amp;ldquo;讨论帖子数/讨论主题数&amp;rdquo;则反映了一个社区的参与程度。从右下方这张图表可以看出，OpenNebula社区和Eucalyptus社区的参与度基本上是接近的。在2010年8 月以前，Eucalyptus社区的参与度略高于OpenNebula社区。在2010年8 月以后，OpenNebula社区的参与度略高于Eucalyptus社区。但是OpenStack社区的参与度从2010年6 月项目开始之日起就高于OpenNebula社区和Ecualyptus社区。除了个别异常月份之外，OpenStack社区的参与度通常是其他两者的两 倍甚至是更高。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（5 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/11.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1794&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/11.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;11&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【社区/商业 &amp;mdash; 人物】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	说到OpenStack社区的迅猛成长，就不能不提到OpenStack的社区经理（Community Manager）Stephen Spector。Stephen Spector在1997年到2010年之间一直在Citrix工作，负责软件联盟并担任Xen.org的社区经理，在社区管理方面可以说是拥有丰富的经验。他于2010年9 月跳槽到Rackspace担任OpenStack的社区经理，立即开始了一系列的广告、公关、宣传、结盟活动。通过论坛和邮件列表讨论OpenStack的人数，从无到有直到超越已经运营了两年多的Eucalyptus和OpenNebula社区，仅仅用了6 个月的时间。声明要参与OpenStack项目的公司和机构，在短短的12个月内就达到了140个之多。不过Stephen Spector在今年10月份跳槽到了戴尔（DELL）负责产品和市场，未来OpenStack社区会朝哪个方向发展，还是个未知数。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	很巧的是，Eucalyptus项目的社区经理Mark Atwood也是2010年9月入职的。在他入职之前，Eucalyptus社区已经开始呈现下滑的趋势。Mark Atwood入职之后，侧重于Eucalyptus企业版的宣传和推广，在开发者和用户社区这个领域并没有太大作为，导致Eucalyptus的社区活跃度进一步下滑。Eucalyptus显然已经注意到了这个问题，并且于今年10月雇佣了Greg DeKoenigsburg来负责社区方面的工作。Greg DeKoenigsburg在2004到2010年之间在RedHat工作，负责Fedora的社区工作。至于Greg DeKoenigsburg上任之后Eucalyptus社区的状况是否会有所改善，我们还需要一段时间来慢慢观察。（很有意思的是，在Greg DeKoenigsburg加盟Eucalyptus的一个月之前，Mark Atwood就跑到Red Hat去负责开发者社区了，可见这个圈子真的是很小很小。）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在社区运营这一块，OpenNebula和Eucalyptus和OpenStack项目有所不同。OpenNebula项目的社区经理是一个志愿者的角色，从2009年9 月起一直由芝加哥大学（University of Chicago）的Borja Sotomayor担任。在2004到2010年之间，Borja Sotomayor在芝加哥大学计算机系读硕士和博士，并在拿到博士学位后在芝加哥大学担任讲师。可以认为，OpenNebula项目在社区建设方面的投入并不大，但它的社区发展显然是良性的，并且在近期逐步超越了曾经是如日中天的Eucalyptus社区。如果一定要为此寻找一个原因的话，我们只能够说是OpenNebula这个项目做得实在是太好了。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（5 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/12.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1797&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/12.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;12&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【社区/商业 &amp;mdash; 趋势】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	刚才我们在构架和功能的综合比较里面提到，开源IaaS解决方案要进入生产环境，还有很长的路要走。那么，开源IaaS软件将来会朝什么方向去发展，投资开发开源IaaS软件的机构的商业模式又是怎样的呢？让我们看一看这几个开源IaaS背后的机构都在提供什么样的产品和服务吧。Eucalyptus公司一直在维护社区版和商业版两个不同的版本，今年8 月份刚刚发布的Eucalyptus 3企业版提供了高可用性、负载管理、RBAC权限管理、配额管理、运营计费等等在社区版中缺失的功能。与此类似，拥有OpenNebula项目的C12G Labs同时在维护社区版和专业版两个不同的版本，并且在今年11月发布了可供商用的OpenNebula Pro 3.0。OpenStack项目的后台老板RackSpace则推出了称为RackSpace Cloud Private Edition的服务，既可以为客户建设数据中心，又可以提供私有云解决方案。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	鸠摩罗什大师所译的《维摩诘所说经》中有这么一句话：&amp;ldquo;先以欲勾牵，后令入佛智。&amp;rdquo;我想，这句话完美地阐释了开源IaaS软件的发展趋势。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（2 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/13.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1803&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/13.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;13&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【致谢/参考资料】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	今天我的讲座到这里就结束了。各位如果需要更多的资料，包括今天这个讲座的幻灯片和文本，都可以从我的博客获得。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	谢谢大家。&lt;/p&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/12/6/virtualization-compare.html&quot;&gt;虚拟化管理软件比较&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/12/6/virtualization-compare2.html&quot;&gt;http://blog.hi-suke.com/2011/12/6/virtualization-compare2.html&lt;/a&gt;&lt;/p&gt;</content><author xmlns="http://www.w3.org/2005/Atom"><name>vision4fun</name></author><content:encoded>&lt;p&gt;
	原文地址：&lt;a href=&quot;http://www.qyjohn.net/?p=1624&quot;&gt;http://www.qyjohn.net/?p=1624&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	这一套幻灯片是应CSDN的邀请为12月16-17日在北京举行的&lt;a href=&quot;http://sd2china.csdn.net/&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;软件开发2.0技术大会&lt;/a&gt;准备的。文字部分是在幻灯片制作完毕后起草的发言稿。由于会议延期的原因，就先把幻灯片和文字内容通过博客发布出来，请各位同行不吝指教。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/01.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1629&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/01.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;01&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【讲座主题】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	大家好。感谢CSDN所提供的这个机会，使我能够和在座各位就基础构架服务方面的技术进行交流。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/112/02.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1633&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/02.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;02&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【个人介绍】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	首先做个简单的自我介绍。我叫蒋清野，是个半路出家的程序员。在过去10年中，我为四家公司提供过服务，并且在每一家公司所做的事情都跟上家有很大的不同。在座有一些朋友认识我，可能是参加过我在Sun 公司工作期间组织的各种技术推广活动，也可能是使用过我所提供的&lt;a href=&quot;http://www.unix-center.net/&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;Unix-Center.Net&lt;/a&gt;服务。在过去9 个月中，我短暂地为天涯社区工作，参与了天涯云计算平台的规划和实施。在这段时间里，我学习了一些与云计算 &amp;mdash; 尤其是基础构架服务 &amp;mdash; 有关的知识，也借助天涯社区的硬件条件做了一些测试和评估。今天这个讲座的内容，可以说是对过去9 个月里所学内容的一个总结。虽然这些总结还比较粗浅甚至是幼稚，我还是愿意通过CSDN所提供的这个平台与大家分享，希望能够得到大家的批评和指正。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（2 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/03.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1641&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/03.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;03&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【议题介绍】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	今天这个讲座，主要是从构架、功能、社区和商业的角度来对OpenNebula、Nimbus、OpenStack和Eucalyptus这四个开源IaaS软件进行比较。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在构架方面，我们关心的是它包括哪些组件，各个组件之间的关系以及通讯方式，以及这样的设计会如何影响到整个系统的扩展性和伸缩性。这里我们所说的扩展性，是指为相关软件添加新的功能模块的能力。举个例子说，当新的更好的虚拟化技术出现时，云管理员能不能相对容易地为新的虚拟化技术提供支持。在伸缩性方面，我们更关心的则是相关软件能够管理多大规模的数据中心。如果它不能够管理更大规模的数据中心，其性能瓶颈主要在什么地方。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在功能方面，我们关心的是它是否能够满足用户的需求。 我们所说的用户又可以分成两个类别，一个是IaaS服务的使用者也就是终端用户，另一个是IaaS服务的提供者也就是云管理员。对于终端用户来说，他所关心的是能不能够通过这个系统方便地申请、创建、启动、休眠、唤醒、关闭、销毁虚拟机，以及方便地监控自己账户下所有虚拟机的处理器、内存、磁盘和网络使用状况。对于云管理员来说，他所关心的是能不能够通过这个系统方便地监控整个数据中心 &amp;mdash; 甚至是多个数据中心 &amp;mdash; 所有物理机和虚拟机的资源使用状况，能不能在尽可能少的物理机上运行尽可能多的虚拟机以达到节能减排的目的。从理论上来讲，基础构架服务的终端用户只需要关心自己所使用的虚拟机资源而不必关心虚拟机后面的技术细节。但是当云服务出现故障的时候，我们会发现终端用户比云管理员更关心云服务的高可用性、数据备份策略等等细节，并且迫切地希望存在某些途径让自己的虚拟机和别人的虚拟机得到特殊的照顾和祝福。从工程的角度来讲世界上不存在绝对不会失效的系统，但是这些需求可以转变成功能或者是产品，使得云服务提供商可以为不同的用户提供不同的服务。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	为什么要关心社区？我们知道，大部分企业在选择解决方案的时候，成本是一个很重要的影响因子。最近几年&amp;ldquo;总体拥有成本&amp;rdquo;（Total Cost of Ownership, TCO）这个概念非常流行，意思就是说一个解决方案的成本包括两个部分，一个是初期的购置和安装成本，另外一个是后期的维护和服务成本。卖商业软件的通常会跟我们讲：&amp;ldquo;你买我们的解决方案，出了问题我们给你解决。你用那些开源软件，出了问题怎么办？&amp;rdquo;做我们这一行的都知道，后期的维护和服务成本类似于买保险，在大多数时候起的是心理安慰和推卸责任的作用。但是如果这个保险没有买，出了问题就只能够找社区了。因此，我们在这里专门讨论一下与这几个开源软件所关联的社区的规模、活跃度和参与度。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	最后我们会花一点时间讨论一下开源软件的商业模式问题。这个问题又可以分为两个方面，一方面是开源软件开发者如何盈利，另一方面是开源软件使用者如何获得专业支持和服务。对于基础构架服务这种关键性应用来说，在软件选型过程当中如果不考虑开源软件的商业模式问题，将来可能会遇到一些意想不到的麻烦和困难。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（6 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/04.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1654&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/04.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;04&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【构架/功能 &amp;mdash; 概述】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	首先我们从构架的角度来看看基础构架服务由哪几个层面的技术组成。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	左上角这个图片是虚拟化技术示意图。通过虚拟化技术，一台计算机可以被虚拟成多台计算机，每台虚拟机拥有独立的处理器、内存、硬盘和网络接口。使用虚拟化技术能够提高硬件资源的利用率，使得多个应用能够运行在同一台物理机上但是彼此隔离，各自拥有独立的操作系统和其他运行环境。这张幻灯片上所提到的Xen、KVM和VMWare等等，是已经被业界广泛认可的几种虚拟化技术。还有一些比较小众的虚拟化技术，在这里就不一一列出了。经过这么多年的发展，虚拟化技术已经非常成熟。越来越多的公司正在将虚拟机部署到生产环境中。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	当我们需要在多台物理机上创建多个虚拟机并且维护多个运行环境时，我们就需要一个工具来帮助我们对物理机和虚拟机进行管理，也就是右上角这个图片里的虚拟化管理。一个相对完整的虚拟化管理系统通常会提供如下几个方面的功能。（1）通过资源池的方式对物理资源进行重新组织；（2）虚拟机生命周期管理，例如创建、启动、休眠、唤醒、关闭、迁移、销毁虚拟机；（3）将常用的运行环境保存为虚拟机模板，可以方便地创建一系列相同或者是相似的运行环境；（4）在计算资源允许的情况下提供高可用性、动态负载均衡、备份与恢复；（5）对所有的物理机和虚拟机进行监控，生成报表并在必要的情况下发出预警。这张幻灯片上所提到的Oracle VM、CloudStack和ConVirt等等，是一些比较有代表性的虚拟化管理软件。由于空间有限，很多优秀的虚拟化管理软件我就不在这里一一列出了。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	虚拟化管理软件的用户，通常是运维人员，也就是管理服务器、交换机、存储和数据中心的工程师。对于实行的是集中式IT资源管理的组织来说，虚拟化管理软件大大地提高了运维部门的效率。在互联网这个行业，大家经常抱怨的就是基础设施的建设跟不上项目建设的需要，计算资源申请、采购、安装、上架、开通的流程太长。现在运维人员不再给业务部门分配物理机，而是通过虚拟化管理软件分配虚拟机，因此这个流程被大大缩短了。但是对于需要经常性地重装系统的开发和测试团队来说，他们还是需要经常性地麻烦运维人员给他们重新分配虚拟机、安装操作系统以及配置运行环境。他们迫切地希望有一个环境，能够自己完成创建、启动、休眠、唤醒、关闭、迁移、销毁等虚拟机生命周期管理任务。不仅如此，他们还希望能够通过一系列自定义的程序来自动地完成这些任务，或者是将这些功能和自己日常使用的一些工具整合在一起。与此同时，拥有大量物理服务器的单位在使用虚拟化技术以后突然发现自己的服务器买得太多了，希望通过虚拟机的方式将多余的计算资源租赁给其他单位使用。为了满足这样的需求，就出现了终端用户通过浏览器自助式申请、开通、管理计算资源的解决方案，以及通过Web Service API将虚拟机生命周期管理操作暴露给第三方应用的解决方案。终端用户绕过了运维工程师，以自助服务的方式申请、开通、管理计算资源，就是我们所谓的基础构架服务。这张幻灯片上所提到的OpenNebula、Nimbus、OpenStack和Eucalyptus是一些开源的基础构架服务软件，而Amazon、DreamHost和Linode是一些业界比较知名的基础构架服务提供商。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	现在我们总结一下这张幻灯片上的内容：虚拟化技术利用单台物理机的计算资源提供多台相互独立的虚拟机，虚拟化管理软件使得运维人员能够方便地在大规模的数据中心实施虚拟化技术。而在虚拟化管理软件的基础上进行封装，使终端用户能够以自助服务的方式获得计算资源，就是我们所谓的基础构架服务。为了让大家进一步了解基础构架服务都是怎么实现的，我们接下来以OpenNebula、Nimbus、OpenStack和Eucalyptus为例子，分析一下他们的构架和功能。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（7 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/05.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1699&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/05.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;05&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【构架/功能 &amp;mdash; OpenNebula 3.0】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	接下来我们通过四张图片来展示OpenNebula 3.0在不同层次上的设计思路。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	左上角这张图片是 OpenNebula的整体构架图。（1）前端（FRONT-END）通过浏览器和Web Service向云管理员和终端用户提供服务。（2）ONED是OpenNebula的核心服务进程，包括虚拟化管理模块和任务调度模块。（3）ONED通过SSH方式连接到计算节点，并通过虚拟化驱动（Drivers）来调用计算节点上的虚拟化控制命令。当计算节点使用KVM或者是VMWare ESXi作为虚拟化技术时，OpenNebula使用libvirt所提供的接口远程调用计算节点上的虚拟化控制命令。当计算节点使用Xen作为虚拟化技术时，OpenNebula通过SSH登录到计算节点执行相关的虚拟化控制命令。（4）计算节点通过前端的映像驱动（Images）获得需要运行的操作系统映像文件。需要说明的是，还有一些前端模块没有出现在这个图上。这些前端模块包括监控、用户界面和云服务API。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	左下角这张图片是OpenNebula的存储结构图。OpenNebula使用映像仓库（Image Repository）来保存操作系统映像文件。这个映像仓库要能够被OpenNebula的前端直接访问，可以是SAN、NAS或者是磁盘阵列等其他存储设备。我们创建虚拟机的时候，ONED首先通过任务调度器确定将要运行该虚拟机的计算节点，然后将相应的磁盘映像文件拷贝到计算节点上，最后通过虚拟化驱动调用相应的虚拟化技术创建虚拟机并启动运行。对于一个小型的私有云来讲，可以简单地使用类似于NFS的共享文件系统方式将同一个目录挂载到前端服务器和所有的计算节点上。通过使用共享文件系统，可以缩短部署虚拟机所需要的时间，还可以方便地实现虚拟机的在线迁移。使用共享文件系统的时候需要注意的是，如果某些虚拟机频繁地进行磁盘IO操作的话，部署在同一共享文件系统上的所有虚拟机都会受到影响。在这种情况下，可以考虑将磁盘IO密集型虚拟机的磁盘映像文件缓存在计算节点上，这样只有运行在同一计算节点上的虚拟机会受到影响。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在网络方面，OpenNebula通过在计算节点上配置网桥的方式为虚拟机提供网络连接。在右上角的这张示意图上，一个计算节点配置了两个网桥，其中一个连接到公网，另外一个连接到内网。需要注意的是，在同一个计算集群中，所有计算节点的网桥配置必须是同样的。另外，OpenNebula可以通过配置文件来指定某个网络可用的IP范围，并且在创建虚拟机的时候通过配置文件直接指定虚拟机的IP，因此OpenNebula可以在没有DHCP服务器的情况下为虚拟机分配IP。除此之外，我想在座的各位对网桥的设置都不陌生了，在这里我就不再重复这些常识了。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	刚才我们所提到的构架、存储和网络，都属于虚拟化管理的范畴。在虚拟化管理的基础上，OpenNebula使用一个称为SunStone的用户界面，使得云管理员和终端用户都能够通过浏览器访问被OpenNebula所管理的基础构架，在各自的权限范围内执行虚拟机生命周期管理操作，就形成了一个完整的基础构架服务系统。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（7 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/061.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1720&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/061.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;06&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【构架/功能 &amp;mdash; Nimbus 2.8】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	接下来我们看一看Nimbus这个项目。从左上角的构架图来看，Nimbus的构架设计和OpenNebula是非常相像的。用户通过浏览器界面访问Nimbus服务，管理节点通过SSH和libvirt调用计算节点上的Xen或者KVM命令。不同的地方主要有两个，一个是它通过DHCP服务器为虚拟机分配IP，另外一个是它使用了一个名为Cumulus的云存储服务。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	左下角这张图是Cumulus云存储的构架图。可以看出，Cumulus由多个功能模块组成。从顶层看，它是一个与Amazon S3相兼容的云存储服务； 从底层看，它可以搭建在简单的本地硬盘或者是负责的HDFS上。在云计算这个领域，Amazon S3是事实上的云存储标准。Nimbus使用云存储来提供存储服务，从构架上来说比使用共享文件系统的OpenNebula更接近于Amazon EC2/S3。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	各位可能会问，用云存储来作为基础构架服务的关键组件，在性能上会不会有问题呢？右边这两张图展示的分别是Culumus、scp、gridFtp和本地文件系统在上载和下载不同大小的文件时的吞吐量。从这两张图可以看出，当被操作的文件较小的情况下，Culumus的性能较差，但是与scp和gridFtp的性能在同一水平上；当被操作的文件大小超过1 GB的时候，Culumus的性能与本地文件系统接近。考虑到操作系统应先文件的大小通常会超过1 GB，可以认为使用Culumus来存储操作系统映像文件是没有问题的。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（3 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/07.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1742&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/07.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;07&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【构架/功能 &amp;mdash; Eucalyptus 2.0.3】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	接下来我们看一看Eucalyptus这个项目。Eucalyptus的构架和OpenNebula以及Nimbus相比有两个明显的不同。首先，在计算节点（Node Controller）和云控制器（Cloud Controller）之间，多了一个叫做集群控制器（Cluster Controller）的组件。其次，在Eucalyptus中有两个负责存储的组件，一个叫做Walrus存储控制器（Walrus Storage Controller，缩写成WS3），另外一个叫做弹性块存储（Elastic Block Storage，缩写成EBS）。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	引入集群控制器这个组件后，Eucalyptus中的虚拟化管理功能就由集群控制器来承担。也就是说，当用户向Eucalyptus的云控制器请求计算资源的时候，Eucalyptus的云控制器根据各个计算集群的资源使用状况将用户的请求转发给某个计算集群的集群控制器，集群控制器再根据本集群中各个计算节点的资源使用状况决定在哪个计算节点上创建和运行虚拟机。我们把Eucalyptus的构架和OpenNebula以及Nimbus的构架来做个比较，可以看出Eucalyptus的计算集群和OpenNebula以及Nimbus在功能上基本是等价的。我们知道，当计算节点的数量较多的时候，虚拟化管理模块以及系统监控模块的压力就会比较大，可能会影响到整个系统的性能。我们假定Eucalyptus、OpenNebula以及Nimbus的虚拟化管理模块的实现水平是相当的，当OpenNebula和Nimbus由于计算节点数量增加而出现性能问题的时候，Eucalyptus可以通过增加计算集群的方法来实现横向扩展。从这个意义上说，Eucalyptus的构架设计提供了更大程度的扩展性，能够支撑更大规模的基础构架。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	刚才我们说到，Eucalyptus中有两个负责存储的组件。一个是WS3，与Amazon的简单存储服务（Simple Storage Service，S3）相对应；另外一个是EBS，与Amazon的弹性块存储（Elastic Block Store，EBS）相对应。EBS可以被当做块设备挂载到虚拟机上，相当于云硬盘。EBS能够提供较大的容量，具有较好的IO性能。S3则是一种基于Key-Value的网络存储，有人也把它叫做云存储。S3使得用户能够通过简单的API在网络上存储和读取数据。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在我们已经提到的三个IaaS软件中，OpenNebula直接使用共享文件系统作为存储，Nimbus使用了一个类似于S3的Cumulus存储服务，Eucalyptus则进一步将云硬盘和云存储分开。从构架上来看，Eucalyptus的构架和Amazon 的EC2/S3服务最为接近。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	类似于S3的云存储服务使得用户能够通过简单的API在网络上存储和读取数据，但是对于数据密集型应用来说，使用S3服务可能会出现性能方面的问题。最近卡耐基梅隆大学（Carnegie Mellon University，CMU）的并行数据实验室（Parallel Data Labs）基于Walrus云存储实现了pWalrus云存储服务。大家看幻灯片上右下角这张图，可以看出pWalrus把数据存放在一个并行的文件系统上。对于互联网用户来讲，他可以通过简单的PUT和GET来读写数据；对于计算节点来讲，它既可以通过PUT和GET来读写数据，还可以直接用文件IO的模式来读写数据。经过这样的改进后，pWalrus能够提供更好的IO性能，也能够进一步保障数据的安全性。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（8 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/081.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1750&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/081.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;08&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【构架/功能 &amp;mdash; OpenStack】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	接下来我们看一看OpenStack这个项目。这个构架图看起来有点费劲，因为它不符合从上到下、从左到右的阅读习惯。另外，这张图里面的组件太多了，看起来有点眼花缭乱。这里我用几个不同颜色的方框给这些组件做一下分组，包含在橙色方框里面的是前端，包含在蓝色方框里面的是计算节点，包含在绿色方框里面的是存储服务。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	我们首先看一看前端这个部分。终端用户通过nova-api访问OpenStack请求计算资源。OpenStack首先对用户进行身份认证，然后通过任务调度器（nova-scheduler）确定在哪一个计算节点上创建新的虚拟机。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在计算节点这个部分，OpenStack通过libvirt和Xen API来进行虚拟机生命周期管理。计算节点上的网络界面，是通过nova-network这个组件来管理的。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在存储服务这个部分，OpenStack提供了两个存储组件。其中，nova-volume提供弹性块设备服务，相当于Amazon EBS；nova-objectstore提供简单存储服务，相当于Amazon S3。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	OpenStack的各个组件之间不共享任何状态，各个组件之间通过中间这张图中间用红色圈出的消息队列（MQ）来进行异步通讯。OpenStack中的任意组件可以安装在任意服务器上，只需要在配置文件里面指定MQ服务器的地址即可。因此，MQ可能成为整个系统的性能瓶颈。在这种情况下，可以通过增加一台MQ服务器来解决。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	到现在为止，我们已经能够全面了解了OpenNebula、Nimbus、Eucalyptus和OpenStack的构架。尽管每个软件的设计思路和实现细节各有千秋，但是都可以归结为三个比较大的模块：一是通常被称为云控制器的前端，包括用户界面、编程接口和任务调度组件；二是虚拟化管理，包括网络管理和虚拟机管理；三是存储服务，包括弹性块设备和简单存储服务。在这三大模块的基础上，还可以添加监控、报表、分析、计费等等外围组件。这些组件往往是运营方面的要求，不是基础构架服务的核心技术，在这里我们就不详细讨论了。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（4 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/092.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1764&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/11/092.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;09&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【构架/功能 &amp;mdash; 综合比较】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在了解过OpenNebula、Nimbus、Eucalyptus和OpenStack在构架上的差异之后，我们简单地比较一下这四个系统在功能上的差异。这里所说的功能，是指缺省的基本组件安装配置完毕后即可立即使用的功能，不包括尚未正式发布的试验性组件。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	首先我们从终端用户的角度来看，这个系统是不是有一个方便好用的门户或者是客户端去进行各种各样的操作。OpenNebula提供了基于浏览器的用户门户，Nimbus则提供了一个基于Java的桌面客户端，Eucalyptus和OpenStack则需要利用命令行工具或者是第三方解决方案。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在云主机、云硬盘和云存储着三类基础构架服务中，OpenNebula仅提供云主机服务，Nimbus增加了云存储服务，Eucalyptus和OpenStack都能够提供全面的服务。此外，OpenNebula的用户能够直接通过基于浏览器的VNC访问虚拟机的控制台（console），其他三个系统的终端用户暂时无法直接访问虚拟机的控制台。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	四个系统的终端用户均可创建自定义的虚拟机模板，但是实现的难易程度有较大差别。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	只有OpenNebula提供了简单的监控报表，能够报告虚拟机的处理器核内存使用状况。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在备份、恢复和用户账单等方面，基本还是空白。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	由于缺少存储方面的某些组件，OpenNebula和Nimbus所提供的服务并不完全兼容于Amazon EC2/S3，Eucalyptus和Nimbus则是和Amazon EC2/S3完全兼容的。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	其次我们从云管理员的角度去考察， 这个系统是不是有一个方便好用的门户或者是客户端去进行各种各样的操作。只有OpenNebula通过SunStone提供了基本上能够用的管理门户，Nimbus干脆就没有管理员门户，Eucalyptus有一个管理员门户但是能够做的事情非常有限，OpenStack有一个正在开发中的Dashboard但是不能够算数。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在服务器监控、虚拟机监控和监控报表这个领域，只有OpenNebula提供了凑合能用的解决方案，其他三个系统都没有这方面的功能。有人会说服务器和虚拟机的监控可以通过Nagios或者是Zabbix等等监控框架来实现。但是从基础构架服务的发展趋势来看，将监控组件纳入IaaS管理系统，是非常有必要的。这一点我接下来还会讲到。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	OpenNebula和OpenStack提供了基于命令行的虚拟机在线迁移功能，Nimbus和Eucalyptus则没有提供这个功能。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在物理机动态负载调整、虚拟机高可用性、备份与恢复、报警机制和运营计费等方面，基本还是空白。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在一个成熟的虚拟化管理系统（例如ConVirt）中，必然会有对物理机和虚拟机的监控模块。监控模块以一定的频率记录物理机和虚拟机的处理器、内存、磁盘、网络使用状况，并以图表的方式展现给用户。当虚拟机的运行状况有问题的时候，可以自动地重启（甚至是在另外的物理服务器上重启）虚拟机，从而实现虚拟机的高可用性。在这些监控数据的基础上，可以手动甚至是自动地对物理机的负载进行调整，譬如说通过在线迁移把某些负载比较轻的虚拟机整合到数量较少的服务器上，空闲出来的服务器就可以进入休眠状态从而达到节能的目的。当虚拟机的负载比较重的时候，系统又可以自动唤醒某些处于休眠状态的服务器，并通过在线迁移把一些虚拟机迁移到新的服务器上。大多数VPS用户都知道他们的虚拟机是和别人的虚拟机共享一台物理机的，但是他们可能不知道在同一台物理机上所运行的虚拟机的处理器总和是超过这台物理机的处理器总和的。同样，运营商卖出去的内存总和，也是超过物理机的内存总和的。这种情况我们叫做超售，也就是over-commit。对于一个基础构架服务提供商来说，必须要有一套监控分析、在线迁移、负载调整的工具才能够在实现超售的同时提供较好的用户体验。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	随着服务器性能的不断提高，数据中心虚拟化以及基础构架服务是一个不可阻挡的趋势。对于终端用户来说，他们需要的是一个简单易用的界面，只需要选择自己需要的软硬件配置即可立即开通自己所需要的计算资源，并且随时可以看在自己账户下所有计算资源的使用状况。对于云管理员来说，他们同样需要一个的简单易用界面，能够管理一个跨越多个数据中心的基础构架，能够基于系统的运行情况自动地进行负载调整，从而实现最大的投资收益。从目前的状况来看，与其他几个IaaS软件相比较，OpenNebula能够给终端用户和云管理员提供更多的功能。但是从基础构架服务提供商的角度来看，开放源代码的IaaS解决方案要进入生产环境，还有很长的路要走。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（8 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/10.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1781&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/10.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;10&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【社区/商业 &amp;mdash; 数据】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	现在我们花一点时间从社区和商业的角度来对开源IaaS软件进行一下比较。Nimbus这个项目的社区规模很小，没有明显的商业诉求，我们暂时把它放在这个分析比较之外。这张幻灯片上的四个图表，是我在今年9 月份根据2009年1月以来Eucalyptus、OpenNebula和OpenStack社区的邮件列表和论坛数据整理出来的。左边的这两张图，分别是每个月当中所产生的讨论主题数和帖子总数。右上方的这张图，则是当月参与了讨论的总人数。右下方的这张图，是每个月的帖子总数与讨论主题数的比值，我们暂且称之为参与度。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	显而易见，OpenNebula社区自2009年以来一直保持良好的发展势头，其讨论主题数、讨论帖子数和参与讨论的总人数都在稳步增长。但是该项目在 2011年4 月之后开始呈现衰落的势头。Eucalyptus社区在2010年6 月之前发展迅猛，无论是讨论主题数、讨论帖子数和参与讨论的总人数都是OpenNebula社区的两到三倍左右。但是Eucalyptus社区自2010 年6 月之后逐步衰落，尽管在2010年10月前后有过数次复兴的趋势，但是最终日渐式微并于2011年5 月前后降低到OpenNebula社区的同等水平。新兴的OpenStack社区在创立初期发展缓慢，但是从2011年1 月起呈现出爆发的势头。目前OpenStack社区的讨论主题数、讨论帖子数和参与讨论的总人数都在OpenNebula社区和Eucalyptus社区 之上，但是尚未达到Eucalyptus社区在2010年6 月的规模。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	通常来讲，一个讨论主题得到的回复数越多，表明该主题的讨论越深入。一个论坛或者邮件列表如果只有主帖而没有回复，说明这个社区的参与程度很低。因此，平均意义上的&amp;ldquo;讨论帖子数/讨论主题数&amp;rdquo;则反映了一个社区的参与程度。从右下方这张图表可以看出，OpenNebula社区和Eucalyptus社区的参与度基本上是接近的。在2010年8 月以前，Eucalyptus社区的参与度略高于OpenNebula社区。在2010年8 月以后，OpenNebula社区的参与度略高于Eucalyptus社区。但是OpenStack社区的参与度从2010年6 月项目开始之日起就高于OpenNebula社区和Ecualyptus社区。除了个别异常月份之外，OpenStack社区的参与度通常是其他两者的两 倍甚至是更高。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（5 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/11.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1794&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/11.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;11&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【社区/商业 &amp;mdash; 人物】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	说到OpenStack社区的迅猛成长，就不能不提到OpenStack的社区经理（Community Manager）Stephen Spector。Stephen Spector在1997年到2010年之间一直在Citrix工作，负责软件联盟并担任Xen.org的社区经理，在社区管理方面可以说是拥有丰富的经验。他于2010年9 月跳槽到Rackspace担任OpenStack的社区经理，立即开始了一系列的广告、公关、宣传、结盟活动。通过论坛和邮件列表讨论OpenStack的人数，从无到有直到超越已经运营了两年多的Eucalyptus和OpenNebula社区，仅仅用了6 个月的时间。声明要参与OpenStack项目的公司和机构，在短短的12个月内就达到了140个之多。不过Stephen Spector在今年10月份跳槽到了戴尔（DELL）负责产品和市场，未来OpenStack社区会朝哪个方向发展，还是个未知数。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	很巧的是，Eucalyptus项目的社区经理Mark Atwood也是2010年9月入职的。在他入职之前，Eucalyptus社区已经开始呈现下滑的趋势。Mark Atwood入职之后，侧重于Eucalyptus企业版的宣传和推广，在开发者和用户社区这个领域并没有太大作为，导致Eucalyptus的社区活跃度进一步下滑。Eucalyptus显然已经注意到了这个问题，并且于今年10月雇佣了Greg DeKoenigsburg来负责社区方面的工作。Greg DeKoenigsburg在2004到2010年之间在RedHat工作，负责Fedora的社区工作。至于Greg DeKoenigsburg上任之后Eucalyptus社区的状况是否会有所改善，我们还需要一段时间来慢慢观察。（很有意思的是，在Greg DeKoenigsburg加盟Eucalyptus的一个月之前，Mark Atwood就跑到Red Hat去负责开发者社区了，可见这个圈子真的是很小很小。）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	在社区运营这一块，OpenNebula和Eucalyptus和OpenStack项目有所不同。OpenNebula项目的社区经理是一个志愿者的角色，从2009年9 月起一直由芝加哥大学（University of Chicago）的Borja Sotomayor担任。在2004到2010年之间，Borja Sotomayor在芝加哥大学计算机系读硕士和博士，并在拿到博士学位后在芝加哥大学担任讲师。可以认为，OpenNebula项目在社区建设方面的投入并不大，但它的社区发展显然是良性的，并且在近期逐步超越了曾经是如日中天的Eucalyptus社区。如果一定要为此寻找一个原因的话，我们只能够说是OpenNebula这个项目做得实在是太好了。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（5 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/12.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1797&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/12.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;12&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【社区/商业 &amp;mdash; 趋势】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	刚才我们在构架和功能的综合比较里面提到，开源IaaS解决方案要进入生产环境，还有很长的路要走。那么，开源IaaS软件将来会朝什么方向去发展，投资开发开源IaaS软件的机构的商业模式又是怎样的呢？让我们看一看这几个开源IaaS背后的机构都在提供什么样的产品和服务吧。Eucalyptus公司一直在维护社区版和商业版两个不同的版本，今年8 月份刚刚发布的Eucalyptus 3企业版提供了高可用性、负载管理、RBAC权限管理、配额管理、运营计费等等在社区版中缺失的功能。与此类似，拥有OpenNebula项目的C12G Labs同时在维护社区版和专业版两个不同的版本，并且在今年11月发布了可供商用的OpenNebula Pro 3.0。OpenStack项目的后台老板RackSpace则推出了称为RackSpace Cloud Private Edition的服务，既可以为客户建设数据中心，又可以提供私有云解决方案。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	鸠摩罗什大师所译的《维摩诘所说经》中有这么一句话：&amp;ldquo;先以欲勾牵，后令入佛智。&amp;rdquo;我想，这句话完美地阐释了开源IaaS软件的发展趋势。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	（2 分钟）&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/13.jpg&quot; style=&quot;font-weight: 800; text-decoration: none; color: rgb(69, 70, 115); &quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-1803&quot; src=&quot;http://www.qyjohn.net/wp-content/uploads/2011/12/13.jpg&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; title=&quot;13&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	【致谢/参考资料】&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	今天我的讲座到这里就结束了。各位如果需要更多的资料，包括今天这个讲座的幻灯片和文本，都可以从我的博客获得。&lt;/p&gt;
&lt;p style=&quot;margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; text-align: left; &quot;&gt;
	谢谢大家。&lt;/p&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/12/6/virtualization-compare.html&quot;&gt;虚拟化管理软件比较&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/12/6/virtualization-compare2.html&quot;&gt;http://blog.hi-suke.com/2011/12/6/virtualization-compare2.html&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/608636252/visionblog/feedsky/s.gif?r=http://blog.hi-suke.com/2011/12/6/virtualization-compare2.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><pubDate>Tue, 06 Dec 2011 11:36:07 +0800</pubDate><guid isPermaLink="false">http://blog.hi-suke.com/entry/virtualization-compare2</guid><dc:creator>vision4fun</dc:creator><fs:srclink>http://blog.hi-suke.com/2011/12/6/virtualization-compare2.html</fs:srclink><fs:srcfeed>http://blog.hi-suke.com/feed</fs:srcfeed><fs:itemid>feedsky/visionblog/~8885042/608636252/5398154</fs:itemid></item><item><title>虚拟化管理软件比较</title><link>http://blog.hi-suke.com/2011/12/6/virtualization-compare.html</link><id xmlns="http://www.w3.org/2005/Atom">http://blog.hi-suke.com/entry/virtualization-compare</id><content xmlns="http://www.w3.org/2005/Atom" type="html">&lt;p&gt;
	原文地址：&lt;a href=&quot;http://www.qyjohn.net/&quot;&gt;http://www.qyjohn.net/&lt;/a&gt;&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td id=&quot;text&quot;&gt;
				&lt;p&gt;
					最近笼统地学习和试用了几款比较有名的虚拟化管理软件。学习的内容包括Eucalyptus, OpenNebula, OpenStack, OpenQRM, XenServer, Oracle VM, CloudStack, ConVirt。借这一系列文章，对过去一个月的学习内容作一个阶段性的总结。&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（1）授权协议、许可证管理、购买价格等方面的比较&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;授权协议&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;许可证管理&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;商业模式&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								社区版采用GPLv3授权协议
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版使用自定义的商业授权协议&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								社区版不需要安装许可证
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版需要在云控制器（CLC）节点上安装许可证&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								社区版免费使用
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版按处理器核心总数收费，用户购买的许可证针对特定版本永久有效。&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Apache 2.0授权协议&lt;/td&gt;
							&lt;td&gt;
								不需要许可证&lt;/td&gt;
							&lt;td&gt;
								免费使用&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Apache 2.0授权协议&lt;/td&gt;
							&lt;td&gt;
								不需要许可证&lt;/td&gt;
							&lt;td&gt;
								社区版免费使用
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版将社区版重新打包，提供补丁等程序的访问权限，使得用户能够更容易的安装、配置和管理，以订阅的模式提供服务。&lt;/p&gt;
								&lt;p&gt;
									企业版按物理服务器总数收费，每台物理服务器器的服务价格为250欧元每年。&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								社区版使用GPLv2授权协议
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版使用自定义的商业授权协议&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								不需要许可证&lt;/td&gt;
							&lt;td&gt;
								社区版免费使用
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版将社区版重新打包，提供补丁等程序的访问权限，使得用户能够更容易的安装、配置和管理，以订阅的模式提供服务。基本、标准和高级服务的价格分别为480、960、1920欧元每月。&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Citrix XenServer系列产品均使用自定义的商业授权协议
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									基于XenServer的Xen Cloud Platform使用GPLv2授权协议&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								不管是XenServer还是Xen Cloud Platform都需要在每台服务器安装许可证
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									许可证每年更新一次&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								XenServer免费版本和开源版本的Xen Cloud Platform可以免费使用
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									XenServer高级版、企业版和白金版按物理服务器数量收费，分别是1000、2500和5000美元。购买的许可证针对特定版本永久有效&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Oracle VM Server是基于Xen开发的，使用GPLv2协议发布，从Oracle的网站可以下载到源代码，但是Oracle并不宣传这一点。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									Oracle VM Manager使用自定义的商业授权协议。&lt;/p&gt;
								&lt;p&gt;
									Oracle VM VirtualBox的二进制版本使用自定义的商业授权协议，源代码使用GPLv2授权协议。&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								不需要许可证&lt;/td&gt;
							&lt;td&gt;
								免费使用，可以购买技术支持。技术支持的费用为每台物理服务器8184人民币每年。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								社区版采用GPLv3授权协议企业版使用自定义的商业授权协议&lt;/td&gt;
							&lt;td&gt;
								社区版不需要安装许可证
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版需要在管理服务器上安装许可证&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								社区版免费使用企业版提供增强功能和技术支持，收费模式不详。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								社区版使用GPLv2授权协议
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版使用自定义的商业授权协议&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								社区版不需要安装许可证
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版需要在管理服务器上安装许可证&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								社区版免费使用
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版提供增强功能和技术支持，按物理服务器数量收费，每个节点费用1090美元。购买的许可证针对特定版本永久有效。&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（2）项目历史与运营团队、社区规模和活跃程度、沟通交流等方面的比较&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;项目历史与运营团队&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;社区规模和活跃程度&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;沟通交流&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								最初是UCSB的HPC研究项目，2009年初成立公司来支持该项目的商业化运营。现任CEO是曾担任MySQL CEO的Marten Mickos，现任工程部门SVP的Tim Cramerc曾担任 Sun公司NetBeans和OpenSolaris项目的执行总监。整个管理团队对开放源代码项目的管理和运营方面具有丰富的经验。&lt;/td&gt;
							&lt;td&gt;
								在同类开放源代码项目当中，Eucalyptus的社区规模最大，活跃程度也最高。主要原因是该项目起源于大学研究项目，次要原因是管理团队对开放源代码理念的高度认同。Ubuntu 10.04服务器版选择Eucalyptus作为UEC的基础构架，大大地促进了Eucalyptu的推广。&lt;/td&gt;
							&lt;td&gt;
								社区发表在论坛上的问题通常在48小时内得到回应，通过技术支持电子邮件提出的问题通常在24小时内得到回应。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									Eucalyptus在北京和深圳设有办事处，在中国有工程师提供支持团队。&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								OpenStack是服务器托管公司RackSpace与NASA共同发起的开放源代码项目。在开放源代码项目的管理和运营方面，RackSpace和NASA显然缺乏足够的经验。针对OpenStack项目的批评集中在（1）RackSpace对项目有过于强烈的控制欲，（2）OpenStack项目的运作对于社区成员来说基本上是不透明的，（3）OpenStack项目对同类开放源代码项目的攻击性过強。&lt;/td&gt;
							&lt;td&gt;
								社区规模较小，主要参与者为支持／参与该项目的公司人员。有几个公开的邮件列表，流量很小。由于该项目比较新，在网络上可以参考的安装与配置方面的文章不多。Ubuntu 11.04服务器版同时支持Eucalyptus和OpenStack作为UEC的基础构架，将有助于OpenStack的推广。&lt;/td&gt;
							&lt;td&gt;
								通过邮件列表进行技术方面的沟通，通常在48小时内得到回应。商务方面的邮件沟通，没有得到回应。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								2005年启动的研究性项目，2008年初发布第一个开放源代码版本，2010年初大力推进开源社区的建设。&lt;/td&gt;
							&lt;td&gt;
								社区规模较小，主要参与者为支持／参与该项目的公司人员，以及少量的用户。有几个公开的邮件列表，流量比OpenStack项目的流量稍大。在网络上搜索到一些中文版安装和配置方面的文章，基本上是以讹传讹，缺乏可操作性。英文版的相关文章也不多，可操作的更少。&lt;/td&gt;
							&lt;td&gt;
								通过邮件列表进行技术方面的沟通，通常在48小时内得到回应。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								起源于集群管理方面的软件，2006年公开源代码，2008年免费发布，目前版本为4.8。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									项目的运营团队较小，似乎只有Matt Rechenburg一个人。&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								有一些零星的用户，基本上没有形成社区。虽然功能还在不断更新，但是用户文档的日期是2008年的。相关论坛的活跃程度比OpenStack和OpenNebula更差。&lt;/td&gt;
							&lt;td&gt;
								在论坛发布的问题，大约有50％左右没有得到回应。通过电子邮件进行商务沟通，反应迅速，在24小时以内得到回应。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Citrix公司的产品，与Xen项目的发展基本同步。&lt;/td&gt;
							&lt;td&gt;
								围绕Xen Cloud Platform有一些开放源代码的项目，用于替代XenCentor提供基于桌面或者是浏览器的管理功能。&lt;/td&gt;
							&lt;td&gt;
								初期商务沟通的速度比较快。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Oracle公司的产品，用户量较小。Oracle VM仅仅是Oracle用户生态系统中的一部分，不是Oracle的关键业务。&lt;/td&gt;
							&lt;td&gt;
								有一定数量的用户，但是没有形成社区。在网络上缺少与Oracle相关的讨论与交流。Oracle VM团队有一个博客网站，但是最近两篇文章的日期分别是2010年11月和2008年1 月。产品下载的速度很慢。&lt;/td&gt;
							&lt;td&gt;
								初期商务沟通的速度比较快。在技术方面的沟通，Oracle在国内没有相应的技术人员提供支持。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								源于2008年成立的VMOps公司，2010年五月启用cloud.com域名，2010年6 月共同启动OpenStack项目。&lt;/td&gt;
							&lt;td&gt;
								用户数量较少，论坛不是很活跃。官方文档非常完备，按照文档操作至少能够顺利地完成安装和配置过程。网络上可以搜索到一些可操作的安装和配置文档（得益于CloudStack的安装和配置比较简单）。&lt;/td&gt;
							&lt;td&gt;
								商务沟通比较困难，通过社区论坛和电子邮件提出的问题都没有得到回应。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								起源于2006年发起的XenMan项目，与Xen项目的发展基本同步。目前的版本为ConVirt 2.0。现任CEO和工程部门EVP均来自Oracle。&lt;/td&gt;
							&lt;td&gt;
								用户规模与Eucalyptus相当，论坛的活跃程度很高。官方文档非常完备，按照文档操作至少能够顺利地完成安装和配置过程。在网络上搜索到的中英文的安装配置教程也基本可用。&lt;/td&gt;
							&lt;td&gt;
								商务沟通非常顺畅，社区发表在论坛上的问题通常在48小时内得到回应，通过技术支持电子邮件提出的问题通常在24小时内得到回应。&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（3）综合评估&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					总的来说，虚拟化管理软件的用户还不是很多。大部分虚拟化管理软件的社区规模较小，活跃程度也不高。除了Eucalyptus积极地鼓励社区用户参与项目的开发与测试之外，其他项目选择开放源代码只是一种营销策略。如果排除技术和价格方面的因素，最值得选择的软件无疑是Eucalyptus和ConVirt。这两个项目拥有最大和最活跃的用户社区，其开发／运营团队与潜在客户之间的沟通最为顺畅。XenServer也是一个值得考虑的对象，但是XenServer社区版要求对每台物理服务器都要每年更新一次许可证。对于拥有大量物理服务器的公司来说，管理和维护成千上百个许可证将是一个令人头疼的问题。&lt;/p&gt;
				&lt;p&gt;
					架构篇：&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（1）系统构架比较&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td width=&quot;90%&quot;&gt;
								&lt;strong&gt;系统构架&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Eucalyptus是一个与Amazon EC2兼容的IaaS系统。Eucalyptus包括云控制器（CLC）、Walrus、集群控制器（CC）、存储控制器（SC）和节点控制器（NC）。CLC是整个Eucalyptu系统的核心，负责高层次的资源调度，例如向CC请求计算资源。Walrus是 一个与Amazon S3类似的存储服务，主要用于存储虚拟机映像和用户数据。CC是一个集群的前端，负责协调一个集群内的计算资源，并且管理集群内的网络流量。SC是一个与Amazon EBS类似的存储块设备服务，可以用来存储业务数据。NC是最终的计算节点，通过调用操作系统层的虚拟化技术来启动和关闭虚拟机。在同一个集群（CC）内的所有计算节点（NC）必须在同一个子网内。 在一个集群（CC）内通常需要部署一台存储服务器（SC），为该集群内的计算节点提供数据存储服务。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									Eucalyptus通过Agent的方式来管理计算资源。在每一个计算节点上，都需要运行一个eucalyptus-nc的服务。该服务在集群控制器（CC）上注册后，云控制器（CLC）即可通过集群控制器（CLC）将需要运行的虚拟机映像文件（EMI）拷贝到该计算节点上运行。&lt;/p&gt;
								&lt;p&gt;
									Eucalyptus将虚拟机映像文件存储在Walrus上。当用户启动一个虚拟机实例的时候，Eucalyptus首先将相应的虚拟机映像（EMI）从Walrus拷贝到将要运行该实例的计算节点（NC）上。当用户关闭（或者是由于意外而重启）一个虚拟机实例的时候，对虚拟机所做的修改并不会被写回到Walrus上原来的虚拟机映像（EMI）上，所有对该虚拟机的修改都会丢失。如果用户需要保存修改过的虚拟机，就需要利用工具（euca2ools）将该虚拟机实例保存为新的虚拟机映像（EMI）。如果用户需要保存数据，则需要利用存储服务器（SC）所提供的弹性块设备来完成。&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/eee_arch.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/8358bb16be5112ffbbffbcddaa4f8d00.jpg&quot; title=&quot;eee_arch&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								OpenStack是一个与Amazon EC2兼容的IaaS系统。OpenStack包括OpenStack Compute和OpenStack Object Storage两个部分。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									OpenStack Compute又包含Web前端、计算服务、存储服务、身份认证服务、存储块设备（卷）服务、网络服务、任务调度等多个模块。OpenStack Compute的不同模块之间不共享任何信息，通过消息传递进行通讯。因此，不同的模块可以运行在不同的服务器上，也可以运行在同一台服务器上。&lt;br /&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/NOVA_ARCH.png&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/2ad1d20138e35c1172f7b225c1e03a23.png&quot; title=&quot;NOVA_ARCH&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									OpenStack Object Store可以利用通用服务器搭建可扩展的海量数据仓库，并且通过冗余来保证数据的安全性。同一份数据的在多台服务器上都有副本，将出现故障的服务器从集群中撤除不会影响数据的完整性，加入新的服务器后系统会自动地在新的服务器上为相应的文件创建新的副本。从功能上讲，OpenStack Object Store同时具备Eucalyptus中的Walrus服务和弹性块设备（SC）服务。不过OpenStack Object Store不是一个文件系统，不能够保证数据的实时性。从这个方面来考虑，OpenStack Object Store更适合用于存储需要长期保存的静态数据，例如操作系统映像文件和多媒体数据。&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/os-os.png&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/f2100daed76e917ba48ce1477db0afbb.png&quot; title=&quot;os-os&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									OpenStack通过Agent的方式来管理计算资源。在每一个计算节点上，都需要运行nova-network服务和nova-compute服务。这些服务启动之后，就可以通过消息队列来与云控制器进行交互。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								OpenNebula的构架包括三个部分：驱动层、核心层、工具层。驱动层直接与操作系统打交道，负责虚拟机的创建、启动和关闭，为虚拟机分配存储，监控物理机和虚拟机的运行状况。核心层负责对虚拟机、存储设备、虚拟网络等进行管理。工具层通过命令行界面／浏览器界面方式提供用户交互接口，通过API方式提供程序调用接口。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/one-architecture.png&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/4da93ee27a8be995acedb411b75929de.png&quot; title=&quot;one-architecture&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									OpenNebula使用共享存储设备（例如NFS）来提供虚拟机映像服务，使得每一个计算节点都能够访问到相同的虚拟机映像资源。当用户需要启动或者是关闭某个虚拟机时，OpenNebula通过SSH登陆到计算节点，在计算节点上直接运行相对应的虚拟化管理命令。这种模式也称为无代理模式，由于不需要在计算节点上安装额外的软件（或者服务），系统的复杂度也相对降低了。&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/one-sample-arch2.png&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/6952a83ccc072bfa35f4d9f4f42d5736.png&quot; title=&quot;one-sample-arch2&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								OpenQRM是为了管理混合虚拟化环境而开发的一个虚拟化管理框架，包括基础层（框架层）和插件。基础层（框架）的作用是管理不同的插件，而对虚拟资源的管理（计算资源，存储资源，映像资源）都是通过插件来实现的。OpenQRM的框架类似于Java语言中的Interface，定义了一系列虚拟机资源生命周期管理的方法，例如创建、启动、关闭虚拟机等等。在个框架的基础上，OpenQRM针对不同的虚拟化平台（Xen、KVM)实现了不同的插件，用来管理不同的物理和虚拟资源。当出现新的资源需要支持的时候，只需要为OpenQRM编写新的插件，就可以无缝地整合到原来的环境中去。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/openqrm-architecture.png&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/207840c4e7a84c070808689ba9ed6c13.png&quot; title=&quot;openqrm-architecture&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									OpenQRM插件也是使用无代理模式工作的。当需要管理的目标节点提供SSH登录方式时，OpenQRM插件通过SSH登陆到计算节点，在计算节点上直接运行相对应的虚拟化管理命令。当需要管理的目标节点提供HTTP／HTTPS／XML－RPC远程调用接口时，OpenQRM插件通过目标节点所提供的远程调用接口实现对目标平台的管理。&lt;/p&gt;
								&lt;p&gt;
									OpenQRM是一个虚拟化管理平台，不提供与Amazon EC2兼容的云管理接口。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								XenServer是对Xen虚拟化技术的进一步封装，在Dom0上提供一系列命令行和远程调用接口，独立的管理软件XenCenter通过远程调用这些接口来管理多台物理服务器。XenSever在标准Xen实现之上所实现的远程调用接口类似于其他虚拟化管理平台中所实现的Agent，因此XenServer是通过Agent方式工作的。由于只考虑对Xen虚拟化技术的支持，XenServer的构架相对简单。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/xcp-architecture.png&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/4c445cd11ee461b11e8d13e32e481255.png&quot; title=&quot;xcp-architecture&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									XenServer是一个虚拟化管理平台，不提供与Amazon EC2兼容的云管理接口。管理软件XenCenter是运行在Windows操作系统上的，对于需要随时随地访问管理功能的系统管理员来说有点不便。目前有一些第三方提供的开放源代码的基于浏览器的XenServer管理工具，但是都还处于比较早期的阶段。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Oracle VM包括Oracle VM Server和Oracle VM Manager两个部分。Oracle VM Server在支持Xen的Oracle Linux上（Dom0）运行一个与Xen交互的Agent，该Agent为Oracle VM Manager提供了远程调用接口。Oracle VM Manager通过一个Java应用程序来对多台Oracle VM Server上的虚拟资源进行管理和调度，同时提供基于浏览器的管理界面。由于只考虑对Xen虚拟化技术的支持，Oracle VM Server / Manager的构架相对简单。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/GW430.gif&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/6e74a213e20a48c91e017d429a6364c6.gif&quot; title=&quot;GW430&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									Oracle VM是一个虚拟化管理平台，不提供与Amazon EC2兼容的云管理接口。&lt;/p&gt;
								&lt;p&gt;
									值得注意的是，Oracle VM Manager还通过Web Service的方式提供了虚拟机软件生命周期管理的所有接口，使得用户可以自己使用不同的编程语言来调用这些接口来开发自己的虚拟化管理平台。不过由于Oracle在开放源代码方面的负面形象，似乎没有看到有这方面的尝试。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								与OpenQRM类似，CloudStack采用了&amp;ldquo;框架 ＋ 插件&amp;rdquo;的系统构架，通过不同的插件来提供对不同虚拟化技术的支持。对于标准的Xen / KVM计算节点，CloudStack需要在计算节点上安装Agent与控制节点进行交互；对于XenServer / VMWare计算节点，CloudStack通过XenServer / VMWare所提供的XML-RPC远程调用接口与计算节点进行交互。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Cloud.com-Architecture.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/54a93dfe3d1b06510f36b3e83fb0ae5f.jpg&quot; title=&quot;Cloud.com Architecture&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									CloudStack本身是一个虚拟化管理平台，但是它通过CloudBridge提供了与Amazon EC2相兼容的云管理接口，对外提供IaaS服务。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								ConVirt是一个虚拟化管理平台，使用无代理模式工作。当需要管理的目标节点提供SSH登录方式时，ConVirt通过SSH登陆到计算节点，在计算节点上直接运行相对应的虚拟化管 理命令。当需要管理的目标节点提供HTTP／HTTPS／XML－RPC远程调用接口时，ConVirt插件通过目标节点所提供的远程调用接口实现对目标平台的管理。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/799px-Architecture.png&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/d6dd5fca6e1dde72e62f01457babbf68.png&quot; title=&quot;799px-Architecture&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									ConVirt是一个虚拟化管理平台，不提供与Amazon EC2兼容的云管理接口。但是ConVirt 3.0提供了与Amazon EC2 / Eucalyptus的用户接口，使得ConVirt用户能够在同一个Web 管理界面下同时管理Amazon EC2 / Eucalyptus提供的虚拟计算资源。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（2）云管理平台还是虚拟化管理平台？&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					在IaaS这个层面，云管理和虚拟化管理的概念非常接近，但是有一些细微的差别。&lt;/p&gt;
				&lt;p&gt;
					虚拟化是指在同一台物理机器上提供多台虚拟机器（包括CPU、内存、存储、网络等计算资源）的能力。每一台虚拟机器都能够像普通的物理机器一样运行完整的操作系统以及执行正常的应用程序。当需要管理的物理机器数量较小时，虚拟机生命周期管理（资源配置、启动、关闭等等）可以通过手工去操作。当需要管理的物理机器数量较大时，就需要写一些脚本／程序来提高虚拟机生命周期管理的自动化程度。以管理和调度大量物理／虚拟计算资源为目的系统，属于虚拟化管理系统。这样一个系统，通常用于管理企业内部计算资源。&lt;/p&gt;
				&lt;p&gt;
					云计算是指通过网络访问物理／虚拟计算机并利用其计算资源的实践。通常来讲，云计算提供商以虚拟机的方式向用户提供计算资源。用户无须了解虚拟机背后实际的物理资源状况，只需了解自己所能够使用的计算资源配额。因此，虚拟化技术是云计算的基础。任何一个云计算管理平台，都是构建在虚拟化管理平台的基础之上的。如果某个虚拟化管理平台仅对某个集团内部提供服务，那么这个虚拟化管理平台也可以被称为&amp;ldquo;私有云&amp;rdquo;；如果某个虚拟化管理平台对公众提供服务，那么这个虚拟化管理平台也可以被称为&amp;ldquo;公有云&amp;rdquo;。服务对象的不同，对虚拟化管理平台的构架和功能提出了不同的需求。&lt;/p&gt;
				&lt;p&gt;
					私有云服务于集团内部的不同部门（或者应用），强调虚拟资源调度的灵活性。系统管理员需要为不同的部门（或者应用）定制不同的虚拟机，根据部门（或者应用）对计算资源的需求对分配给某些虚拟机的计算资源进行调整。从这个意义上来讲，OpenQRM、XenServer、Oracle VM、CloudStack和ConVirt比较适合提供私有云服务。&lt;/p&gt;
				&lt;p&gt;
					公有云服务于公众，强调虚拟资源的标准性。通过将计算资源切割成标准化的虚拟机配置（多个系列的产品，每个产品配置相同数量的CPU、内存、磁盘空间、网络流量配额），公有云提供商可以通过标准的服务合同（Service Level Agreement, SLA）以标准的价格出售计算资源。当用户对计算资源的需求出现改变的时候，用户只需要缩减或者是增加自己所使用的产品数量。由于Amazon EC2是目前比较成功的公有云提供商，大部分云管理平台都在某种程度上模仿Amazon EC2的构架。从这个意义上来讲，Eucalyptus、OpenNebula和OpenStack提供了与Amazon EC2兼容或者是类似的接口，比较适合提供公有云服务。&lt;/p&gt;
				&lt;p&gt;
					公有云和私有云之间的界限，就像&amp;ldquo;内部／外部&amp;rdquo;和&amp;ldquo;部门／合作伙伴&amp;rdquo;的概念一样，并不十分明显。根据项目需求的不同，可能会有不同的解释。&lt;/p&gt;
				&lt;p&gt;
					功能篇：&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（1）&lt;/strong&gt;&lt;strong&gt;支持的虚拟化技术&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;Xen&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;KVM&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;XenServer / XCP&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;VMWare&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;LXC&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;openVZ&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;br /&gt;
								&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					可以看出，Xen和KVM是目前获得最广泛的厂商虚拟化技术，紧随其后的是VMWare。需要注意的是，XenServer是对Xen的进一步封装，可以认为是一种新的虚拟化平台（用户在XenServer上不能直接执行Xend相关命令）。&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（2）系统安装和配置&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;前端&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;计算节点&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;备注&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								使用Ubuntu 10.04或者CentOS 5.5操作系统，通过apt-get install或者yum install的方式直接安装二进制包，构建一个包含CLC、 Walrus、SC、CC的前端。根据官方网站提供的文档进行操作，是比较容易实现的。&lt;/td&gt;
							&lt;td&gt;
								使用Ubuntu 10.04或者CentOS 5.5操作系统，通过apt-get install或者yum install的方式直接安装二进制包，构建一个提供NC服务的计算节点。根据官方网站提供的文档进行操作，是比较容易实现的。&lt;/td&gt;
							&lt;td&gt;
								Eucalyptus包含了一个dhcpd，如果配置不好的话，会造成一定的麻烦。另外，计算节点（NC）与集群控制器（CC）必须在一个C类子网里（例如，掩码为255.255.255.0）。如果NC和CC在一个超网里（例如，掩码为255.255.0.0），在注册服务的时候会出现一些问题。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								在Ubuntu 10.04上利用官方网站提供的nova-install脚本进行安装，基本上没有遇到问题。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								在Ubuntu 10.04上利用官方网站提供的nova-install脚本进行安装，基本上没有遇到问题。&lt;/td&gt;
							&lt;td&gt;
								对于一个简单的系统，安装配置比较简单。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								使用CentOS 5.5操作系统，配置好CentOS Karan源，启用kbs-CentOS-Testing条目。下载对应的rpm包，直接yum localinstall &amp;ndash;nogpgcheck opennebula*.rpm，就可以直接完成安装过程。按照官方文档创建/srv/cloud/one和/srv/cloud/images目录，通过NFS共享/srv/cloud目录。创建cloud用户组和属于cloud用户组的oneadmin用户。&lt;/td&gt;
							&lt;td&gt;
								按照官方文档创建/srv/cloud/one和/srv/cloud/images目录，通过NFS共享/srv/cloud目录。创建cloud用户组和属于cloud用户组的oneadmin用户。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									将前端服务器上oneadmin用户的ssh key拷贝到计算节点上oneadmin用户的authorized_keys中。这样前端服务器才可以通过SSH登陆到计算节点上。&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								在CentOS 5.5 x86_64上进行安装的时候，如果按照官方网站提供的文档进行操作，先配置好必要的软件依赖关系再安装opennebula，就会出现xmlrpc-c包版本不对的错误。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									网络上可以搜索到一些安装配置方面的文档和教程，但是对于熟悉Linux但是不熟悉OpenNebula的开发人员来说，很难按照这些文档完成安装和配置过程。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								在Ubuntu 10.04上通过SVN下载OpenQRM源代码，进入源代码目录后依次执行make / make install / make start命令。按照官方文档的描述创建数据库，然后通过Web界面进行下一步的安装和配置。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								计算节点配置好网桥和虚拟化支持之外不需要特别的安装和配置。在OpenQRM管理界面中启用相对应的插件即可通过插件对计算节点进行管理。&lt;/td&gt;
							&lt;td&gt;
								在Ubuntu 10.04上安装前端时，可能需要手工安装dhcp3-server。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									启用插件管理虚拟资源的操作流程不够直观，并且缺乏详细的文档。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								前端为基于Windows操作系统的XenCenter。在Windows XP上可以安装，需要.NET Framework Update 2的支持。安转过程非常简单，基本上不需要配置。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								从Citrix的网站下载ISO，刻盘直接安装在裸机上即可。计算节点安装完毕后，在XenCenter中把新增计算资源添加到资源池即可。&lt;/td&gt;
							&lt;td&gt;
								每一台XenServer服务器都需要安装从Citrix获得License，并且每年更新一次。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								在CentOS 5.5 x86_64上进行安装。将ISO文件mount起来后，执行runinstaller.sh即可。&lt;/td&gt;
							&lt;td&gt;
								从Oracle的网站下载ISO，刻盘直接安装在裸机上即可。计算节点安装完毕后，在Oracle VM Manager中把新增计算资源添加到资源池即可。&lt;/td&gt;
							&lt;td&gt;
								最好从Oracle的官方网站下载，不过速度很慢。通过迅雷等途径下载的文件，看起来似乎没有问题，但是ISO刻盘后在启动操作系统安装过程中会出现错误。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									如果在Oracle VM Server上安装Oracle VM Manager，建议分区的时候把/ 分得大一点，不然的话会由于磁盘空间不够而无法安装Oracle VM Manager。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								在CentOS 5.5和Ubuntu 10.4上，按照官方网站的安装文档顺序操作，基本没有问题。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								计算节点上必须安装相应的Agent。&lt;/td&gt;
							&lt;td&gt;
								安装配置相对简单，但是在删除物理资源的时候存在较多的问题。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								在CentOS 5.5和Ubuntu 10.4上，按照官方网站的安装文档顺序操作，基本没有问题。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									在Ubuntu 10.04上安装企业版，需要手工sudo apt-get install libmysqlclient-dev。&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								在计算节点上的root用户必须允许管理节点上运行ConVirt服务的用户通过key auth方式登录。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								安装配置相对简单。&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					不同的虚拟化管理软件有不同的设计理念，采用不同的系统构架，类似的概念也采用不同的术语来表述，其学习曲线也各不相同。对于大部分用户来说，虚拟化管理软件还是个新生事物。即使是粗略地尝试一下利用不同的虚拟化管理软件来安装、配置和测试一个最小规模的私有云系统，也需要花费不少的时间和精力。在这个过程当中，遇见各种各样的问题都在所难免。不过，也只有亲身经验过这些形形色色的问题，才能够切身体会不同虚拟化管理软件的优点和缺点，并且在分析、总结、归纳的基础上形成自己独特的观点。&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（3）用户界面&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;概述&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;用户权限&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;资源池和虚拟机管理&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Eucalyptus提供了一个基于浏览器的简单用户界面，可以完成用户注册，下载credentials，对提供的产品类型进行简单配置等。资源池和虚拟机生命周期管理需要通过euca2ools在命令行模式下完成。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									euca2ools是一组基于命令行的工具，可以与Amazon EC2/S3相兼容的Web Service进行交互。该用具可以管理基于Amazon EC2、Eucalyptus和OpenStack，OpenNebula的云计算服务。&lt;/p&gt;
								&lt;p&gt;
									euca2tools的主要功能包括：&lt;/p&gt;
								&lt;p&gt;
									&amp;ndash; 查询可以使用的域&lt;br /&gt;
									&amp;ndash; 管理SSH Key&lt;br /&gt;
									&amp;ndash; 虚拟机生命周期管理&lt;br /&gt;
									&amp;ndash; 安全组管理&lt;br /&gt;
									&amp;ndash; 管理卷和快照&lt;br /&gt;
									&amp;ndash; 管理虚拟机映像&lt;br /&gt;
									&amp;ndash; 管理IP&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								在Eucalyptus社区版中只有两种类型的用户：管理员，普通用户。在Eucalyptus企业版中进一步提供了用户组，属于某个用户组的用户可以管理属于该用户组的计算资源。&lt;/td&gt;
							&lt;td&gt;
								管理员可以通过注册或者是撤销注册某个计算节点，配置标准产品类型的计算资源（CPU、内存、存储）。普通用户只能够在标准配置的基础上创建、启动、关闭虚拟机，不能够定制化自己所需要的计算资源。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									虚拟机映像文件（EMI）的制作，以及虚拟机生命周期管理等等操作，需要通过euca2ools在命令行模式下完成。在FireFox浏览器中，可以利用ElasticFox插件，在浏览器中启动、监控和关闭虚拟机。ElasticFox的界面不够美观，并且提供的功能非常有限。&lt;/p&gt;
								&lt;p&gt;
									Eucalyptus不提供console功能。用户可以通过SSH连接到自己所管理的虚拟机。&lt;/p&gt;
								&lt;p&gt;
									每一个公开发布的虚拟机映像（EMI），都是一个模板。用户创建虚拟机实例的时候，系统根据用户选择的EMI将相应的虚拟机映像拷贝到目标计算节点上运行。Eucalyptus根据某种算法自动决定用户的虚拟机将在哪个物理服务器上运行，用户对物理服务器的状况一无所知。&lt;/p&gt;
								&lt;p&gt;
									Eucalyptus中的虚拟机实例只是原虚拟机映像（EMI）的一个副本，用户在运行的实例中对虚拟机所做的任何修改，不会被保存到原来的虚拟机映像中。如果用户将运行的虚拟机实例关闭（例如：shutdown），用户对虚拟机所作的任何修改都会丢失。如果用户需要保存自己对虚拟机所做的修改，用户可以选择使用弹性块设备来保存数据，或者将正在运行的虚拟机实例发布为新的EMI。（Amazon EC2自动地将停止运行的虚拟机实例保存为新的AMI，直到用户销毁该虚拟机实例为止。因此，用户可以shutdown自己的虚拟机实例，但是保存自己对虚拟机所作的修改，直到用户选择销毁该虚拟机实例为止。）&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								OpenStack不缺省地提供基于浏览器的用户界面。系统管理员需要手工创建用户。大部分的管理操作，需要在命令行下进行。 尽管OpenStack和Eucalyptus在构架上有很大的不同，但是所暴露给用户的界面是类似的（两者都模仿了Amazon EC2的用户接口规范）。因此，OpenStack同样可以使用Eucalyptus所提供的euca2ools进行管理。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									OpenStack的openstack-dashboard项目和django-nova项目提供了一个基于浏览器的用户界面，没有被集成到OpenStack安装脚本中，需要单独安装。&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								OpenStack将用户分成如下几个类别：
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									admin &amp;mdash; 云服务管理员，拥有所有管理权限。&lt;/p&gt;
								&lt;p&gt;
									itsec &amp;mdash; IT安全管理员，具有隔离有问题的虚拟机实例的权限。&lt;/p&gt;
								&lt;p&gt;
									projectmanager &amp;mdash; 项目管理员，可以增加属于该项目的新用户，管理虚拟机映像，管理虚拟机生命周期。&lt;/p&gt;
								&lt;p&gt;
									netadmin &amp;mdash; 网络管理员，负责IP分配，管理防火墙。&lt;/p&gt;
								&lt;p&gt;
									developer &amp;mdash; 开发人员，可以登录进入属于本项目的虚拟机，管理虚拟机生命周期&lt;/p&gt;
								&lt;p&gt;
									在模仿Amazon EC2的云平台（Eucalyptus, OpenStack, OpenNebula）中，OpenStack提供了颗粒度最细的用户权限管理模式。&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								与Eucalyptus类似，虚拟机映像文件（EMI）的制作，以及虚拟机生命周期管理等等操作，需要通过euca2ools在命令行模式下完成。同样，在FireFox浏览器中，可 以利用ElasticFox插件，在浏览器中启动、监控和关闭虚拟机。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									OpenStack不提供虚拟机console功能。用户可以通过SSH连接到自己所管理的虚拟机。&lt;/p&gt;
								&lt;p&gt;
									正在开发中的openstack-dashboard，基于浏览器提供了比较完整的资源池管理功能和虚拟机生命周期管理功能。虽然界面还比较简单，但是已经处于可用的状态。&lt;/p&gt;
								&lt;p&gt;
									OpenStack的模板和虚拟机实例机制与Eucalyptus类似。与Eucalyptus类似，OpenStack根据某种算法自动决定用户的虚拟机将在哪个物理服务器上运行，用户对物理服务器的状况一无所知。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								OpenNebula不缺省地提供基于浏览器的用户界面。系统管理员需要手工创建用户。大部分的管理操作，需要在命令行下进行。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									OpenNebula目前有两个基于浏览器的用户界面：SunStone和OneMC。这两个项目需要单独安装。&lt;/p&gt;
								&lt;p&gt;
									同样，OpenNebula提供了与Amazon EC2相兼容的Web Service接口。因此，可以通过FireFox所提供的ElasticFox插件和Eucalyptus提供的euca2ools工具集与OpenNebula云平台进行交互。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								OpenNebula只有两种类型的用户：管理员，普通用户。&lt;/td&gt;
							&lt;td&gt;
								在早期版本中，OpenNebula管理员可以在后台通过命令行来管理资源池和虚拟机生命周期。 同样，在FireFox浏览器中，可 以利用ElasticFox插件，在浏览器中启动、监控和关闭虚拟机。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									SunStone和OneMC这两个项目都提供了比较完整的资源池管理和虚拟机生命周期管理功能。两个项目的界面都比较简单，但是基本上处于可用的状态。SunStone没有提供虚拟机console功能，OneMC通过VNC协议提供了虚拟机console功能。&lt;/p&gt;
								&lt;p&gt;
									OpenNebula的模板和虚拟机实例机制与Eucalyptus类似。但是并不缺省地使用euca2ools作为工具。&lt;/p&gt;
								&lt;p&gt;
									与Eucalyptus类似，OpenNebula根据某种算法自动决定用户的虚拟机将在哪个物理服务器上运行，用户对物理服务器的状况一无所知。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								基于浏览器的用户界面，功能比较丰富。&lt;/td&gt;
							&lt;td&gt;
								OpenQRM的管理界面只有两种用户：管理用户，普通用户。普通用户只有查看权限，没有管理权限。&lt;/td&gt;
							&lt;td&gt;
								通过启用不同的插件，可以管理不同的计算资源。所有的资源池和虚拟机生命周期管理操作都可以通过浏览器界面完成。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									OpenQRM的novnc插件可以提供基于VNC协议的虚拟机console功能。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								XenCenter是基于Windows的桌面应用，安装与操作都非常简单，界面美观，功能强大。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									在参与评测的8 个软件中，XenCenter的用户界面是表现最出色的。基于Windows桌面的应用能够迅速地对用户的点击动作作出反应，从而提高用户体验的满意度。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								系统管理员登录XenCenter之后，可以结合Active Directory在用户和用户组的层面分配管理权限。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								授权用户可以通过图形界面方便地进行资源池和虚拟机生命周期管理。在图形界面上可以直观地监控物理服务器和虚拟机的计算资源使用情况（CPU、内存、存储、网络活动）。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									提供基于VNC的虚拟机console。&lt;/p&gt;
								&lt;p&gt;
									可以基于模板的部署新的虚拟机。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Oracle VM Manager提供了基于浏览器的管理界面。&lt;/td&gt;
							&lt;td&gt;
								Oracle VM Manager同时提供了role和group的概念。其中role定义了用户所具备的权限，属于同一个group的用户拥有该group所被授予的权限。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									Oracle VM Manager提供了三种role：&lt;/p&gt;
								&lt;p&gt;
									user &amp;mdash; 拥有指定资源池的虚拟机生命周期管理权限。&lt;/p&gt;
								&lt;p&gt;
									manager &amp;mdash; 拥有除了用户管理之外的所有管理权限。&lt;/p&gt;
								&lt;p&gt;
									administrator &amp;mdash; 拥有整个系统的管理权限。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								授权用户可以通过图形界面方便地进行资源池和虚拟机生命周期管理。在图形界面上可以直观地监控物理服务器和虚拟机的计算资源使用情况（CPU、内存、存储、网络活动）。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									提供基于VNC的虚拟机console。&lt;/p&gt;
								&lt;p&gt;
									可以基于模板的部署新的虚拟机。&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								基于浏览器的用户界面，功能丰富，美观大方。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								CloudStack根据用户的role将用户分成三个类型：
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									admin &amp;mdash; 全局管理员。&lt;/p&gt;
								&lt;p&gt;
									domain－admin &amp;mdash; 域管理员，可以对某个域下的物理和虚拟资源进行管理。&lt;/p&gt;
								&lt;p&gt;
									user &amp;mdash; 个体用户，可以管理自己名下的虚拟机资源。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								CloudStack对物理资源的管理完整地模拟了一个物理机房的实际情况，按照&amp;ldquo;机房（Zones）－》机柜（Pods）－》集群（Cluster）－》服务器（Server）&amp;rdquo;的结构对物理服务器进行组织，使得管理员能够在管理界面里面的计算资源和机房里面的计算资源建立起直观的一一对应关系。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									授权用户可以通过图形界面方便地进行资源池和虚拟机生命周期管理。在图形界面上可以直观地监控物理服务器和虚拟机的计算资源使用情况（CPU、内存、存储、网络活动）。&lt;/p&gt;
								&lt;p&gt;
									提供基于VNC的虚拟机console。&lt;/p&gt;
								&lt;p&gt;
									可以基于模板的部署新的虚拟机。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								基于浏览器的用户界面，功能丰富，美观大方。&lt;/td&gt;
							&lt;td&gt;
								社区版可以注册多个用户，并可将用户按照用户组进行分类，但是所有的用户拥有相同的全局管理权限。企业版则提供了更细致的用户权限管理机制。除此之外，企业版还提供了对LDAP的支持。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								授权用户可以通过图形界面方便地进行资源池和虚拟机生命周期管理。在图形界面上可以直观地监控物理服务器和虚拟机的计算资源使用情况（CPU、内存、存储、网络活动）。提供基于VNC的虚拟机console。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									可以基于模板的部署新的虚拟机。&lt;/p&gt;
								&lt;p&gt;
									ConVirt的最大优点，在于其通过时程图的方式在不同的层次上直观地展示计算资源（包括物理资源和虚拟资源）的利用情况和健康状况。在整个数据中心和资源池的层面，ConVirt实时显示资源池数量、物理服务器和虚拟机数量、虚拟机密度、存储资源使用状况、负载最高的N 台物理服务器和虚拟机。在物理服务器和虚拟机的层面，ConVirt实时显示CPU和内存使用情况，监控人员可以通过CPU和内存时程图及时地发现或者是调查系统异常情况。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					在所有参与评测的虚拟化管理软件中，XenServer / XCP和ConVirt的图形用户界面是做的最好的。XenCenter的图形界面的优点在于提供了独一无二的用户体验，ConVirt的图形界面的优点在于以图形的方式直观地展示了从机房到虚拟机的健康状况。CloudStack的图形界面非常大气，但是在功能上不如ConVirt那么实用。不过按照CloudStack的目前的发展势头来看，下一个版本可能比较值得期待。&lt;/p&gt;
				&lt;p&gt;
					由于进行评测的时间较短，并且测试系统规模较小的原因，暂时无法对各个软件的稳定性、健壮性、扩展性等等关键问题作出评估。&lt;/p&gt;
				&lt;p&gt;
					商务篇：&lt;/p&gt;
				&lt;p&gt;
					目前市面上形形色色的虚拟化管理软件总数很多，这一系列文章所提及的几个软件仅仅其中的几个代表。作为一个机构、或者是一家企业，在向虚拟化过渡时都不可避免地要面临软件选型的问题。本文作为这一系列文章的最后一篇，从商务和功能两个方面提出自己的一点粗浅意见。&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（1）商务评估&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					从商务上进行软件选型，性价比通常是一个决定性的因素。在假定参与选型的软件全部满足技术要求的前提下，企业（机构）需要考虑的因素包括软件的授权协议是否友好、许可证管理的难易程度、软件和服务的价格高低、运营团队在业界的声誉、开发者社区和用户社区的规模和活跃程度、商业与技术沟通的难易程度。&lt;strong&gt; &lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					授权协议/许可证管理 &amp;mdash; 以全部开放源代码为10分，部分开放源代码（例如以企业版的形式提供某些高级功能，或者以服务的形式提供特别版本的安装包和补丁）扣1 分。商业版本需要在控制节点安装许可证不扣分，需要在所有计算节点安装许可证扣1 分，许可证需要每年更新者扣1 分。&lt;/p&gt;
				&lt;p&gt;
					价格指数 &amp;mdash; 以全部功能免费使用为10分，以企业版的模式提供全部功能的软件，每台物理服务器每花费500美元扣1 分。&lt;/p&gt;
				&lt;p&gt;
					运营团队 &amp;mdash; 以运营团队的规模、背景、影响力评分，存在的主观因素较多。&lt;/p&gt;
				&lt;p&gt;
					社区因素 &amp;mdash; 以开发者和用户社区的规模和活跃程度评分，存在的主观因素较多。&lt;/p&gt;
				&lt;p&gt;
					沟通交流 &amp;mdash; 以个人与运营团队、开发者社区、用户社区之间的沟通顺畅程度评分，存在的主观因素较多。&lt;br /&gt;
					&lt;strong&gt; &lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;授权协议&lt;/strong&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&lt;strong&gt;许可证管理&lt;br /&gt;
									&lt;/strong&gt;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;价格指数&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;运营团队&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;社区因素&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;沟通交流&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;总分&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								10&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								45&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								10&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								10&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								43&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								42&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								6&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								37&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								10&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								43&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;br /&gt;
								&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								6&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								36&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								6&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								37&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								10&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								44&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（2）功能评估&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					从功能上进行虚拟化管理软件选型，需要考虑的因素包括该软件所支持的虚拟化技术、安装配置的难易程度、开发和使用文档的详尽程度、所提供的功能是否全面以及用户界面是否直观友好、二次开发的难易程度、是否提供物理资源和虚拟资源的监控报表等等。&lt;/p&gt;
				&lt;p&gt;
					虚拟化技术支持 &amp;mdash; 仅支持一种虚拟化技术为6 分，每增加一种虚拟化技术加1 分，10分封顶。&lt;/p&gt;
				&lt;p&gt;
					安装配置 &amp;mdash; 以按照官方文档进行安装配置的难易程度评分，存在的主观因素较多。&lt;/p&gt;
				&lt;p&gt;
					开发/使用文档 &amp;mdash; 以官方所提供的开发与使用文档的详尽程度评分，文档详尽程度越高者得分越高。&lt;/p&gt;
				&lt;p&gt;
					功能与界面 &amp;mdash; 综合评分，涵盖用户进行物理资源和虚拟资源管理、虚拟机生命周期管理、访问虚拟机资源和存储资源的难易程度，用户界面的美观易用程度，以及综合用户体验。&lt;/p&gt;
				&lt;p&gt;
					二次开发 &amp;mdash; 基础得分6 分，提供与Amazon EC2相兼容的程序调用接口者加3 分，提供二次开发接口但是与Amazon EC2不兼容者加2 分。&lt;/p&gt;
				&lt;p&gt;
					监控报表 &amp;mdash; 基础得分6 分，依系统所提供监控与分析功能的详尽程度加分。&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;13%&quot;&gt;
								&lt;strong&gt;虚拟化技术支持&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;13%&quot;&gt;
								&lt;strong&gt;安装配置&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;13%&quot;&gt;
								&lt;strong&gt;开发／使用文档&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;13%&quot;&gt;
								&lt;strong&gt;功能与界面&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;13%&quot;&gt;
								&lt;strong&gt;二次开发&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;12%&quot;&gt;
								&lt;strong&gt;监控报表&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;12%&quot;&gt;
								&lt;strong&gt;总分&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								9&lt;/td&gt;
							&lt;td&gt;
								4&lt;/td&gt;
							&lt;td&gt;
								9 (Amazon WS)&lt;/td&gt;
							&lt;td&gt;
								6&lt;/td&gt;
							&lt;td&gt;
								44&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								4&lt;/td&gt;
							&lt;td&gt;
								9 (Amazon WS)&lt;/td&gt;
							&lt;td&gt;
								6&lt;/td&gt;
							&lt;td&gt;
								45&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								7&lt;/td&gt;
							&lt;td&gt;
								4&lt;/td&gt;
							&lt;td&gt;
								9 (Amazon WS)&lt;/td&gt;
							&lt;td&gt;
								6&lt;/td&gt;
							&lt;td&gt;
								42&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								9&lt;/td&gt;
							&lt;td&gt;
								5&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								6 (OS)&lt;/td&gt;
							&lt;td&gt;
								7&lt;/td&gt;
							&lt;td&gt;
								47&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								6&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								8 (Plugin)&lt;/td&gt;
							&lt;td&gt;
								9&lt;/td&gt;
							&lt;td&gt;
								53&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;br /&gt;
								&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								6&lt;/td&gt;
							&lt;td&gt;
								9&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								7&lt;/td&gt;
							&lt;td&gt;
								8 (WS)&lt;/td&gt;
							&lt;td&gt;
								7&lt;/td&gt;
							&lt;td&gt;
								45&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								9&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								6 (OS)&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								49&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								7&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								8 (API)&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								55&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（3）综合评估&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					从商务上考虑，Eucalyptus和ConVirt以微弱 的优势领先于其他选项。Eucalyptus是私有云管理平台的先行者。Ubuntu 10.04选择捆绑Eucalyptus作为UEC的基础构架，使得Ecualyptus比其他的私有云管理平台拥有更多的用户和更加活跃的社区。此外，Ecualyptus在中国国内有销售和技术支持人员，在沟通上比选择其他软件要更加容易。ConVirt排名第二，根本原因在于其销售和技术支持团队与（潜在的）客户保持积极而有效的沟通。Citrix XenServer仅仅与其他两个选项并列排名第三，输在其过于严苛的许可证管理政策。的确，要给100台以上的服务器单独安装许可证并且每年更新一次，可不是一件有意思的事情。&lt;/p&gt;
				&lt;p&gt;
					从功能上考虑，ConVirt与XenServer遥遥领先于其他选项。虽然ConVirt仅仅支持Xen和KVM两种虚拟化技术，但是其安装配置相对简单，文档详尽、功能齐全、界面美观、是比较容易上手的虚拟化管理软件。更重要的是，ConVirt的监控报表功能直观地展示了从数据中心到虚拟机的CPU、内存利用情况，使得用户对整个数据中心的健康状况一目了然。同样，XenServer虽然仅支持Xen一种虚拟化技术，但是在安装配置、操作文档、用户界面等方面都不亚于ConVirt。如果用户对基于Windows的界面没有强烈的抵触情绪的话，XenServer是比较值得考虑的一个选型。&lt;/p&gt;
				&lt;p&gt;
					综合如上考虑，对于希望利用虚拟化管理软件提高硬件资源利用率和虚拟化管理自动化程度的企业（机构）来说，建议使用ConVirt来管理企业（机构）的计算资源。如果网管人员不希望深入了解Linux操作系统，并且所管理的物理服务器数量有限的话，XenServer也是一个不错的选择。ConVirt的浏览器界面是开放源代码的，用户可以对其进行定制化，将自己所需要的其他功能添加到同一个用户界面中去。XenCenter则提供了一种插件机制，用户可以通过插件的方式讲自己的功能集成到XenCenter中。&lt;/p&gt;
				&lt;p&gt;
					不过，你的基础设施是否需要与Amazon EC2相兼容呢？也就是说，你的用户是否需要使用他们用于访问和操作Amazon EC2的脚本和工具来访问你的计算资源呢？如果是这样的话，你可能需要在Eucalyptus和OpenStack之间作一个选择（CloudStack和OpenNebula同样提供了与Amazon EC2兼容的操作接口，但是CloudStack在商务方面得分不高，OpenNebula在功能方面得分不高）。Eucalyptus的历史比OpenStack稍长，用户群比OpenStack要大，社区的活跃程度也比OpenStack要高。不过OpenStack的后台老板NASA比Eucalyptus要财大气粗，Ubuntu 11.04也集成了OpenStack作为其UEC的基础构架之一，表明OpenStack已经得到了社区的重视和支持。总的来说，开放源代码的云构架，还是一个不断发展之中的新生食物。笔者只能够建议用户亲自去安装使用每一个软件，最终基于自己的经验以及需求达到一个最适合自己的选择。&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/?p=1391&quot;&gt;&lt;strong&gt;&lt;font color=&quot;#454673&quot;&gt;虚拟化管理软件比较 －－ 幻灯片&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					结合前段时间对不同虚拟化管理软件的评测工作，准备了一套讲座用的幻灯片。PDF版本的文件可以从&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virtualization_Management_Technologies1.pdf&quot;&gt;&lt;strong&gt;&lt;font color=&quot;#454673&quot;&gt;这里&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;下载。如果有人需要ODP版本的文件，直接跟我联系吧。&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_01.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/edd632c190700f9bd4bef00f09f72a16.jpg&quot; title=&quot;Virt_01&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_021.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/e0ae003e1e4a299687b6f123b370a99b.jpg&quot; title=&quot;Virt_02&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_03.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/67c829ed234d7b185bdd37cef2ac6372.jpg&quot; title=&quot;Virt_03&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_04.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/d07808687528d7d8da794bbf78a4d8cd.jpg&quot; title=&quot;Virt_04&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_05.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/41ad103108c1b490a2230e290e150c6b.jpg&quot; title=&quot;Virt_05&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_06.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/a85aff98dc0cf7f882aec108acdcd145.jpg&quot; title=&quot;Virt_06&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_07.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/9d2a74f371518c25d5309ae0b49751ea.jpg&quot; title=&quot;Virt_07&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_08.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/7decfdbd9c2be75f0e100760c4639893.jpg&quot; title=&quot;Virt_08&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_09.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/f6add8ff8838ced803ced0d8818bb5ac.jpg&quot; title=&quot;Virt_09&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_10.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/ce05836808c3dd0696d0310ada772483.jpg&quot; title=&quot;Virt_10&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_11.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/a472a1976994e6633181ccdf240dd325.jpg&quot; title=&quot;Virt_11&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_12.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/0c9abce65a86581beef7b7668c9c0708.jpg&quot; title=&quot;Virt_12&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_13.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/224104b111312f2729e448fb88739927.jpg&quot; title=&quot;Virt_13&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_14.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/926e6b6274f801265fde3ab99fde9712.jpg&quot; title=&quot;Virt_14&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_15.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/595b35d71ad3bb594fc4af116510192e.jpg&quot; title=&quot;Virt_15&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_16.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/be5db88e528164360e1115e8480be310.jpg&quot; title=&quot;Virt_16&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_17.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/bd00c20e96536ec8461d41a70785e1b4.jpg&quot; title=&quot;Virt_17&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_18.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/90d2670f5d45ec03dc90ae852359f039.jpg&quot; title=&quot;Virt_18&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_19.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/43e9c53490270db5ead6bca56685d663.jpg&quot; title=&quot;Virt_19&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_20.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/665543bc4f1dde2c0ff222d606623430.jpg&quot; title=&quot;Virt_20&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p align=&quot;center&quot; class=&quot;pageLink&quot;&gt;
					&amp;nbsp;&lt;/p&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/12/6/virtualization-compare2.html&quot;&gt;开源IaaS软件的比较 — 构架、功能、社区、商业及其他&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/12/6/virtualization-compare.html&quot;&gt;http://blog.hi-suke.com/2011/12/6/virtualization-compare.html&lt;/a&gt;&lt;/p&gt;</content><author xmlns="http://www.w3.org/2005/Atom"><name>vision4fun</name></author><content:encoded>&lt;p&gt;
	原文地址：&lt;a href=&quot;http://www.qyjohn.net/&quot;&gt;http://www.qyjohn.net/&lt;/a&gt;&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td id=&quot;text&quot;&gt;
				&lt;p&gt;
					最近笼统地学习和试用了几款比较有名的虚拟化管理软件。学习的内容包括Eucalyptus, OpenNebula, OpenStack, OpenQRM, XenServer, Oracle VM, CloudStack, ConVirt。借这一系列文章，对过去一个月的学习内容作一个阶段性的总结。&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（1）授权协议、许可证管理、购买价格等方面的比较&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;授权协议&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;许可证管理&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;商业模式&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								社区版采用GPLv3授权协议
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版使用自定义的商业授权协议&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								社区版不需要安装许可证
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版需要在云控制器（CLC）节点上安装许可证&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								社区版免费使用
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版按处理器核心总数收费，用户购买的许可证针对特定版本永久有效。&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Apache 2.0授权协议&lt;/td&gt;
							&lt;td&gt;
								不需要许可证&lt;/td&gt;
							&lt;td&gt;
								免费使用&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Apache 2.0授权协议&lt;/td&gt;
							&lt;td&gt;
								不需要许可证&lt;/td&gt;
							&lt;td&gt;
								社区版免费使用
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版将社区版重新打包，提供补丁等程序的访问权限，使得用户能够更容易的安装、配置和管理，以订阅的模式提供服务。&lt;/p&gt;
								&lt;p&gt;
									企业版按物理服务器总数收费，每台物理服务器器的服务价格为250欧元每年。&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								社区版使用GPLv2授权协议
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版使用自定义的商业授权协议&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								不需要许可证&lt;/td&gt;
							&lt;td&gt;
								社区版免费使用
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版将社区版重新打包，提供补丁等程序的访问权限，使得用户能够更容易的安装、配置和管理，以订阅的模式提供服务。基本、标准和高级服务的价格分别为480、960、1920欧元每月。&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Citrix XenServer系列产品均使用自定义的商业授权协议
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									基于XenServer的Xen Cloud Platform使用GPLv2授权协议&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								不管是XenServer还是Xen Cloud Platform都需要在每台服务器安装许可证
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									许可证每年更新一次&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								XenServer免费版本和开源版本的Xen Cloud Platform可以免费使用
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									XenServer高级版、企业版和白金版按物理服务器数量收费，分别是1000、2500和5000美元。购买的许可证针对特定版本永久有效&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Oracle VM Server是基于Xen开发的，使用GPLv2协议发布，从Oracle的网站可以下载到源代码，但是Oracle并不宣传这一点。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									Oracle VM Manager使用自定义的商业授权协议。&lt;/p&gt;
								&lt;p&gt;
									Oracle VM VirtualBox的二进制版本使用自定义的商业授权协议，源代码使用GPLv2授权协议。&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								不需要许可证&lt;/td&gt;
							&lt;td&gt;
								免费使用，可以购买技术支持。技术支持的费用为每台物理服务器8184人民币每年。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								社区版采用GPLv3授权协议企业版使用自定义的商业授权协议&lt;/td&gt;
							&lt;td&gt;
								社区版不需要安装许可证
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版需要在管理服务器上安装许可证&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								社区版免费使用企业版提供增强功能和技术支持，收费模式不详。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								社区版使用GPLv2授权协议
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版使用自定义的商业授权协议&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								社区版不需要安装许可证
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版需要在管理服务器上安装许可证&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								社区版免费使用
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									企业版提供增强功能和技术支持，按物理服务器数量收费，每个节点费用1090美元。购买的许可证针对特定版本永久有效。&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（2）项目历史与运营团队、社区规模和活跃程度、沟通交流等方面的比较&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;项目历史与运营团队&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;社区规模和活跃程度&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;沟通交流&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								最初是UCSB的HPC研究项目，2009年初成立公司来支持该项目的商业化运营。现任CEO是曾担任MySQL CEO的Marten Mickos，现任工程部门SVP的Tim Cramerc曾担任 Sun公司NetBeans和OpenSolaris项目的执行总监。整个管理团队对开放源代码项目的管理和运营方面具有丰富的经验。&lt;/td&gt;
							&lt;td&gt;
								在同类开放源代码项目当中，Eucalyptus的社区规模最大，活跃程度也最高。主要原因是该项目起源于大学研究项目，次要原因是管理团队对开放源代码理念的高度认同。Ubuntu 10.04服务器版选择Eucalyptus作为UEC的基础构架，大大地促进了Eucalyptu的推广。&lt;/td&gt;
							&lt;td&gt;
								社区发表在论坛上的问题通常在48小时内得到回应，通过技术支持电子邮件提出的问题通常在24小时内得到回应。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									Eucalyptus在北京和深圳设有办事处，在中国有工程师提供支持团队。&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								OpenStack是服务器托管公司RackSpace与NASA共同发起的开放源代码项目。在开放源代码项目的管理和运营方面，RackSpace和NASA显然缺乏足够的经验。针对OpenStack项目的批评集中在（1）RackSpace对项目有过于强烈的控制欲，（2）OpenStack项目的运作对于社区成员来说基本上是不透明的，（3）OpenStack项目对同类开放源代码项目的攻击性过強。&lt;/td&gt;
							&lt;td&gt;
								社区规模较小，主要参与者为支持／参与该项目的公司人员。有几个公开的邮件列表，流量很小。由于该项目比较新，在网络上可以参考的安装与配置方面的文章不多。Ubuntu 11.04服务器版同时支持Eucalyptus和OpenStack作为UEC的基础构架，将有助于OpenStack的推广。&lt;/td&gt;
							&lt;td&gt;
								通过邮件列表进行技术方面的沟通，通常在48小时内得到回应。商务方面的邮件沟通，没有得到回应。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								2005年启动的研究性项目，2008年初发布第一个开放源代码版本，2010年初大力推进开源社区的建设。&lt;/td&gt;
							&lt;td&gt;
								社区规模较小，主要参与者为支持／参与该项目的公司人员，以及少量的用户。有几个公开的邮件列表，流量比OpenStack项目的流量稍大。在网络上搜索到一些中文版安装和配置方面的文章，基本上是以讹传讹，缺乏可操作性。英文版的相关文章也不多，可操作的更少。&lt;/td&gt;
							&lt;td&gt;
								通过邮件列表进行技术方面的沟通，通常在48小时内得到回应。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								起源于集群管理方面的软件，2006年公开源代码，2008年免费发布，目前版本为4.8。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									项目的运营团队较小，似乎只有Matt Rechenburg一个人。&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								有一些零星的用户，基本上没有形成社区。虽然功能还在不断更新，但是用户文档的日期是2008年的。相关论坛的活跃程度比OpenStack和OpenNebula更差。&lt;/td&gt;
							&lt;td&gt;
								在论坛发布的问题，大约有50％左右没有得到回应。通过电子邮件进行商务沟通，反应迅速，在24小时以内得到回应。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Citrix公司的产品，与Xen项目的发展基本同步。&lt;/td&gt;
							&lt;td&gt;
								围绕Xen Cloud Platform有一些开放源代码的项目，用于替代XenCentor提供基于桌面或者是浏览器的管理功能。&lt;/td&gt;
							&lt;td&gt;
								初期商务沟通的速度比较快。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Oracle公司的产品，用户量较小。Oracle VM仅仅是Oracle用户生态系统中的一部分，不是Oracle的关键业务。&lt;/td&gt;
							&lt;td&gt;
								有一定数量的用户，但是没有形成社区。在网络上缺少与Oracle相关的讨论与交流。Oracle VM团队有一个博客网站，但是最近两篇文章的日期分别是2010年11月和2008年1 月。产品下载的速度很慢。&lt;/td&gt;
							&lt;td&gt;
								初期商务沟通的速度比较快。在技术方面的沟通，Oracle在国内没有相应的技术人员提供支持。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								源于2008年成立的VMOps公司，2010年五月启用cloud.com域名，2010年6 月共同启动OpenStack项目。&lt;/td&gt;
							&lt;td&gt;
								用户数量较少，论坛不是很活跃。官方文档非常完备，按照文档操作至少能够顺利地完成安装和配置过程。网络上可以搜索到一些可操作的安装和配置文档（得益于CloudStack的安装和配置比较简单）。&lt;/td&gt;
							&lt;td&gt;
								商务沟通比较困难，通过社区论坛和电子邮件提出的问题都没有得到回应。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								起源于2006年发起的XenMan项目，与Xen项目的发展基本同步。目前的版本为ConVirt 2.0。现任CEO和工程部门EVP均来自Oracle。&lt;/td&gt;
							&lt;td&gt;
								用户规模与Eucalyptus相当，论坛的活跃程度很高。官方文档非常完备，按照文档操作至少能够顺利地完成安装和配置过程。在网络上搜索到的中英文的安装配置教程也基本可用。&lt;/td&gt;
							&lt;td&gt;
								商务沟通非常顺畅，社区发表在论坛上的问题通常在48小时内得到回应，通过技术支持电子邮件提出的问题通常在24小时内得到回应。&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（3）综合评估&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					总的来说，虚拟化管理软件的用户还不是很多。大部分虚拟化管理软件的社区规模较小，活跃程度也不高。除了Eucalyptus积极地鼓励社区用户参与项目的开发与测试之外，其他项目选择开放源代码只是一种营销策略。如果排除技术和价格方面的因素，最值得选择的软件无疑是Eucalyptus和ConVirt。这两个项目拥有最大和最活跃的用户社区，其开发／运营团队与潜在客户之间的沟通最为顺畅。XenServer也是一个值得考虑的对象，但是XenServer社区版要求对每台物理服务器都要每年更新一次许可证。对于拥有大量物理服务器的公司来说，管理和维护成千上百个许可证将是一个令人头疼的问题。&lt;/p&gt;
				&lt;p&gt;
					架构篇：&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（1）系统构架比较&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td width=&quot;90%&quot;&gt;
								&lt;strong&gt;系统构架&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Eucalyptus是一个与Amazon EC2兼容的IaaS系统。Eucalyptus包括云控制器（CLC）、Walrus、集群控制器（CC）、存储控制器（SC）和节点控制器（NC）。CLC是整个Eucalyptu系统的核心，负责高层次的资源调度，例如向CC请求计算资源。Walrus是 一个与Amazon S3类似的存储服务，主要用于存储虚拟机映像和用户数据。CC是一个集群的前端，负责协调一个集群内的计算资源，并且管理集群内的网络流量。SC是一个与Amazon EBS类似的存储块设备服务，可以用来存储业务数据。NC是最终的计算节点，通过调用操作系统层的虚拟化技术来启动和关闭虚拟机。在同一个集群（CC）内的所有计算节点（NC）必须在同一个子网内。 在一个集群（CC）内通常需要部署一台存储服务器（SC），为该集群内的计算节点提供数据存储服务。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									Eucalyptus通过Agent的方式来管理计算资源。在每一个计算节点上，都需要运行一个eucalyptus-nc的服务。该服务在集群控制器（CC）上注册后，云控制器（CLC）即可通过集群控制器（CLC）将需要运行的虚拟机映像文件（EMI）拷贝到该计算节点上运行。&lt;/p&gt;
								&lt;p&gt;
									Eucalyptus将虚拟机映像文件存储在Walrus上。当用户启动一个虚拟机实例的时候，Eucalyptus首先将相应的虚拟机映像（EMI）从Walrus拷贝到将要运行该实例的计算节点（NC）上。当用户关闭（或者是由于意外而重启）一个虚拟机实例的时候，对虚拟机所做的修改并不会被写回到Walrus上原来的虚拟机映像（EMI）上，所有对该虚拟机的修改都会丢失。如果用户需要保存修改过的虚拟机，就需要利用工具（euca2ools）将该虚拟机实例保存为新的虚拟机映像（EMI）。如果用户需要保存数据，则需要利用存储服务器（SC）所提供的弹性块设备来完成。&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/eee_arch.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/8358bb16be5112ffbbffbcddaa4f8d00.jpg&quot; title=&quot;eee_arch&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								OpenStack是一个与Amazon EC2兼容的IaaS系统。OpenStack包括OpenStack Compute和OpenStack Object Storage两个部分。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									OpenStack Compute又包含Web前端、计算服务、存储服务、身份认证服务、存储块设备（卷）服务、网络服务、任务调度等多个模块。OpenStack Compute的不同模块之间不共享任何信息，通过消息传递进行通讯。因此，不同的模块可以运行在不同的服务器上，也可以运行在同一台服务器上。&lt;br /&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/NOVA_ARCH.png&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/2ad1d20138e35c1172f7b225c1e03a23.png&quot; title=&quot;NOVA_ARCH&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									OpenStack Object Store可以利用通用服务器搭建可扩展的海量数据仓库，并且通过冗余来保证数据的安全性。同一份数据的在多台服务器上都有副本，将出现故障的服务器从集群中撤除不会影响数据的完整性，加入新的服务器后系统会自动地在新的服务器上为相应的文件创建新的副本。从功能上讲，OpenStack Object Store同时具备Eucalyptus中的Walrus服务和弹性块设备（SC）服务。不过OpenStack Object Store不是一个文件系统，不能够保证数据的实时性。从这个方面来考虑，OpenStack Object Store更适合用于存储需要长期保存的静态数据，例如操作系统映像文件和多媒体数据。&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/os-os.png&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/f2100daed76e917ba48ce1477db0afbb.png&quot; title=&quot;os-os&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									OpenStack通过Agent的方式来管理计算资源。在每一个计算节点上，都需要运行nova-network服务和nova-compute服务。这些服务启动之后，就可以通过消息队列来与云控制器进行交互。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								OpenNebula的构架包括三个部分：驱动层、核心层、工具层。驱动层直接与操作系统打交道，负责虚拟机的创建、启动和关闭，为虚拟机分配存储，监控物理机和虚拟机的运行状况。核心层负责对虚拟机、存储设备、虚拟网络等进行管理。工具层通过命令行界面／浏览器界面方式提供用户交互接口，通过API方式提供程序调用接口。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/one-architecture.png&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/4da93ee27a8be995acedb411b75929de.png&quot; title=&quot;one-architecture&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									OpenNebula使用共享存储设备（例如NFS）来提供虚拟机映像服务，使得每一个计算节点都能够访问到相同的虚拟机映像资源。当用户需要启动或者是关闭某个虚拟机时，OpenNebula通过SSH登陆到计算节点，在计算节点上直接运行相对应的虚拟化管理命令。这种模式也称为无代理模式，由于不需要在计算节点上安装额外的软件（或者服务），系统的复杂度也相对降低了。&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/one-sample-arch2.png&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/6952a83ccc072bfa35f4d9f4f42d5736.png&quot; title=&quot;one-sample-arch2&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								OpenQRM是为了管理混合虚拟化环境而开发的一个虚拟化管理框架，包括基础层（框架层）和插件。基础层（框架）的作用是管理不同的插件，而对虚拟资源的管理（计算资源，存储资源，映像资源）都是通过插件来实现的。OpenQRM的框架类似于Java语言中的Interface，定义了一系列虚拟机资源生命周期管理的方法，例如创建、启动、关闭虚拟机等等。在个框架的基础上，OpenQRM针对不同的虚拟化平台（Xen、KVM)实现了不同的插件，用来管理不同的物理和虚拟资源。当出现新的资源需要支持的时候，只需要为OpenQRM编写新的插件，就可以无缝地整合到原来的环境中去。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/openqrm-architecture.png&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/207840c4e7a84c070808689ba9ed6c13.png&quot; title=&quot;openqrm-architecture&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									OpenQRM插件也是使用无代理模式工作的。当需要管理的目标节点提供SSH登录方式时，OpenQRM插件通过SSH登陆到计算节点，在计算节点上直接运行相对应的虚拟化管理命令。当需要管理的目标节点提供HTTP／HTTPS／XML－RPC远程调用接口时，OpenQRM插件通过目标节点所提供的远程调用接口实现对目标平台的管理。&lt;/p&gt;
								&lt;p&gt;
									OpenQRM是一个虚拟化管理平台，不提供与Amazon EC2兼容的云管理接口。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								XenServer是对Xen虚拟化技术的进一步封装，在Dom0上提供一系列命令行和远程调用接口，独立的管理软件XenCenter通过远程调用这些接口来管理多台物理服务器。XenSever在标准Xen实现之上所实现的远程调用接口类似于其他虚拟化管理平台中所实现的Agent，因此XenServer是通过Agent方式工作的。由于只考虑对Xen虚拟化技术的支持，XenServer的构架相对简单。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/xcp-architecture.png&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/4c445cd11ee461b11e8d13e32e481255.png&quot; title=&quot;xcp-architecture&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									XenServer是一个虚拟化管理平台，不提供与Amazon EC2兼容的云管理接口。管理软件XenCenter是运行在Windows操作系统上的，对于需要随时随地访问管理功能的系统管理员来说有点不便。目前有一些第三方提供的开放源代码的基于浏览器的XenServer管理工具，但是都还处于比较早期的阶段。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Oracle VM包括Oracle VM Server和Oracle VM Manager两个部分。Oracle VM Server在支持Xen的Oracle Linux上（Dom0）运行一个与Xen交互的Agent，该Agent为Oracle VM Manager提供了远程调用接口。Oracle VM Manager通过一个Java应用程序来对多台Oracle VM Server上的虚拟资源进行管理和调度，同时提供基于浏览器的管理界面。由于只考虑对Xen虚拟化技术的支持，Oracle VM Server / Manager的构架相对简单。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/GW430.gif&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/6e74a213e20a48c91e017d429a6364c6.gif&quot; title=&quot;GW430&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									Oracle VM是一个虚拟化管理平台，不提供与Amazon EC2兼容的云管理接口。&lt;/p&gt;
								&lt;p&gt;
									值得注意的是，Oracle VM Manager还通过Web Service的方式提供了虚拟机软件生命周期管理的所有接口，使得用户可以自己使用不同的编程语言来调用这些接口来开发自己的虚拟化管理平台。不过由于Oracle在开放源代码方面的负面形象，似乎没有看到有这方面的尝试。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								与OpenQRM类似，CloudStack采用了&amp;ldquo;框架 ＋ 插件&amp;rdquo;的系统构架，通过不同的插件来提供对不同虚拟化技术的支持。对于标准的Xen / KVM计算节点，CloudStack需要在计算节点上安装Agent与控制节点进行交互；对于XenServer / VMWare计算节点，CloudStack通过XenServer / VMWare所提供的XML-RPC远程调用接口与计算节点进行交互。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Cloud.com-Architecture.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/54a93dfe3d1b06510f36b3e83fb0ae5f.jpg&quot; title=&quot;Cloud.com Architecture&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									CloudStack本身是一个虚拟化管理平台，但是它通过CloudBridge提供了与Amazon EC2相兼容的云管理接口，对外提供IaaS服务。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								ConVirt是一个虚拟化管理平台，使用无代理模式工作。当需要管理的目标节点提供SSH登录方式时，ConVirt通过SSH登陆到计算节点，在计算节点上直接运行相对应的虚拟化管 理命令。当需要管理的目标节点提供HTTP／HTTPS／XML－RPC远程调用接口时，ConVirt插件通过目标节点所提供的远程调用接口实现对目标平台的管理。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/799px-Architecture.png&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/d6dd5fca6e1dde72e62f01457babbf68.png&quot; title=&quot;799px-Architecture&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
								&lt;p&gt;
									ConVirt是一个虚拟化管理平台，不提供与Amazon EC2兼容的云管理接口。但是ConVirt 3.0提供了与Amazon EC2 / Eucalyptus的用户接口，使得ConVirt用户能够在同一个Web 管理界面下同时管理Amazon EC2 / Eucalyptus提供的虚拟计算资源。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（2）云管理平台还是虚拟化管理平台？&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					在IaaS这个层面，云管理和虚拟化管理的概念非常接近，但是有一些细微的差别。&lt;/p&gt;
				&lt;p&gt;
					虚拟化是指在同一台物理机器上提供多台虚拟机器（包括CPU、内存、存储、网络等计算资源）的能力。每一台虚拟机器都能够像普通的物理机器一样运行完整的操作系统以及执行正常的应用程序。当需要管理的物理机器数量较小时，虚拟机生命周期管理（资源配置、启动、关闭等等）可以通过手工去操作。当需要管理的物理机器数量较大时，就需要写一些脚本／程序来提高虚拟机生命周期管理的自动化程度。以管理和调度大量物理／虚拟计算资源为目的系统，属于虚拟化管理系统。这样一个系统，通常用于管理企业内部计算资源。&lt;/p&gt;
				&lt;p&gt;
					云计算是指通过网络访问物理／虚拟计算机并利用其计算资源的实践。通常来讲，云计算提供商以虚拟机的方式向用户提供计算资源。用户无须了解虚拟机背后实际的物理资源状况，只需了解自己所能够使用的计算资源配额。因此，虚拟化技术是云计算的基础。任何一个云计算管理平台，都是构建在虚拟化管理平台的基础之上的。如果某个虚拟化管理平台仅对某个集团内部提供服务，那么这个虚拟化管理平台也可以被称为&amp;ldquo;私有云&amp;rdquo;；如果某个虚拟化管理平台对公众提供服务，那么这个虚拟化管理平台也可以被称为&amp;ldquo;公有云&amp;rdquo;。服务对象的不同，对虚拟化管理平台的构架和功能提出了不同的需求。&lt;/p&gt;
				&lt;p&gt;
					私有云服务于集团内部的不同部门（或者应用），强调虚拟资源调度的灵活性。系统管理员需要为不同的部门（或者应用）定制不同的虚拟机，根据部门（或者应用）对计算资源的需求对分配给某些虚拟机的计算资源进行调整。从这个意义上来讲，OpenQRM、XenServer、Oracle VM、CloudStack和ConVirt比较适合提供私有云服务。&lt;/p&gt;
				&lt;p&gt;
					公有云服务于公众，强调虚拟资源的标准性。通过将计算资源切割成标准化的虚拟机配置（多个系列的产品，每个产品配置相同数量的CPU、内存、磁盘空间、网络流量配额），公有云提供商可以通过标准的服务合同（Service Level Agreement, SLA）以标准的价格出售计算资源。当用户对计算资源的需求出现改变的时候，用户只需要缩减或者是增加自己所使用的产品数量。由于Amazon EC2是目前比较成功的公有云提供商，大部分云管理平台都在某种程度上模仿Amazon EC2的构架。从这个意义上来讲，Eucalyptus、OpenNebula和OpenStack提供了与Amazon EC2兼容或者是类似的接口，比较适合提供公有云服务。&lt;/p&gt;
				&lt;p&gt;
					公有云和私有云之间的界限，就像&amp;ldquo;内部／外部&amp;rdquo;和&amp;ldquo;部门／合作伙伴&amp;rdquo;的概念一样，并不十分明显。根据项目需求的不同，可能会有不同的解释。&lt;/p&gt;
				&lt;p&gt;
					功能篇：&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（1）&lt;/strong&gt;&lt;strong&gt;支持的虚拟化技术&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;Xen&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;KVM&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;XenServer / XCP&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;VMWare&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;LXC&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;openVZ&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;br /&gt;
								&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								Y&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td&gt;
								&amp;nbsp;&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					可以看出，Xen和KVM是目前获得最广泛的厂商虚拟化技术，紧随其后的是VMWare。需要注意的是，XenServer是对Xen的进一步封装，可以认为是一种新的虚拟化平台（用户在XenServer上不能直接执行Xend相关命令）。&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（2）系统安装和配置&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;前端&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;计算节点&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;备注&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								使用Ubuntu 10.04或者CentOS 5.5操作系统，通过apt-get install或者yum install的方式直接安装二进制包，构建一个包含CLC、 Walrus、SC、CC的前端。根据官方网站提供的文档进行操作，是比较容易实现的。&lt;/td&gt;
							&lt;td&gt;
								使用Ubuntu 10.04或者CentOS 5.5操作系统，通过apt-get install或者yum install的方式直接安装二进制包，构建一个提供NC服务的计算节点。根据官方网站提供的文档进行操作，是比较容易实现的。&lt;/td&gt;
							&lt;td&gt;
								Eucalyptus包含了一个dhcpd，如果配置不好的话，会造成一定的麻烦。另外，计算节点（NC）与集群控制器（CC）必须在一个C类子网里（例如，掩码为255.255.255.0）。如果NC和CC在一个超网里（例如，掩码为255.255.0.0），在注册服务的时候会出现一些问题。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								在Ubuntu 10.04上利用官方网站提供的nova-install脚本进行安装，基本上没有遇到问题。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								在Ubuntu 10.04上利用官方网站提供的nova-install脚本进行安装，基本上没有遇到问题。&lt;/td&gt;
							&lt;td&gt;
								对于一个简单的系统，安装配置比较简单。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								使用CentOS 5.5操作系统，配置好CentOS Karan源，启用kbs-CentOS-Testing条目。下载对应的rpm包，直接yum localinstall &amp;ndash;nogpgcheck opennebula*.rpm，就可以直接完成安装过程。按照官方文档创建/srv/cloud/one和/srv/cloud/images目录，通过NFS共享/srv/cloud目录。创建cloud用户组和属于cloud用户组的oneadmin用户。&lt;/td&gt;
							&lt;td&gt;
								按照官方文档创建/srv/cloud/one和/srv/cloud/images目录，通过NFS共享/srv/cloud目录。创建cloud用户组和属于cloud用户组的oneadmin用户。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									将前端服务器上oneadmin用户的ssh key拷贝到计算节点上oneadmin用户的authorized_keys中。这样前端服务器才可以通过SSH登陆到计算节点上。&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								在CentOS 5.5 x86_64上进行安装的时候，如果按照官方网站提供的文档进行操作，先配置好必要的软件依赖关系再安装opennebula，就会出现xmlrpc-c包版本不对的错误。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									网络上可以搜索到一些安装配置方面的文档和教程，但是对于熟悉Linux但是不熟悉OpenNebula的开发人员来说，很难按照这些文档完成安装和配置过程。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								在Ubuntu 10.04上通过SVN下载OpenQRM源代码，进入源代码目录后依次执行make / make install / make start命令。按照官方文档的描述创建数据库，然后通过Web界面进行下一步的安装和配置。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								计算节点配置好网桥和虚拟化支持之外不需要特别的安装和配置。在OpenQRM管理界面中启用相对应的插件即可通过插件对计算节点进行管理。&lt;/td&gt;
							&lt;td&gt;
								在Ubuntu 10.04上安装前端时，可能需要手工安装dhcp3-server。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									启用插件管理虚拟资源的操作流程不够直观，并且缺乏详细的文档。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								前端为基于Windows操作系统的XenCenter。在Windows XP上可以安装，需要.NET Framework Update 2的支持。安转过程非常简单，基本上不需要配置。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								从Citrix的网站下载ISO，刻盘直接安装在裸机上即可。计算节点安装完毕后，在XenCenter中把新增计算资源添加到资源池即可。&lt;/td&gt;
							&lt;td&gt;
								每一台XenServer服务器都需要安装从Citrix获得License，并且每年更新一次。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								在CentOS 5.5 x86_64上进行安装。将ISO文件mount起来后，执行runinstaller.sh即可。&lt;/td&gt;
							&lt;td&gt;
								从Oracle的网站下载ISO，刻盘直接安装在裸机上即可。计算节点安装完毕后，在Oracle VM Manager中把新增计算资源添加到资源池即可。&lt;/td&gt;
							&lt;td&gt;
								最好从Oracle的官方网站下载，不过速度很慢。通过迅雷等途径下载的文件，看起来似乎没有问题，但是ISO刻盘后在启动操作系统安装过程中会出现错误。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									如果在Oracle VM Server上安装Oracle VM Manager，建议分区的时候把/ 分得大一点，不然的话会由于磁盘空间不够而无法安装Oracle VM Manager。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								在CentOS 5.5和Ubuntu 10.4上，按照官方网站的安装文档顺序操作，基本没有问题。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								计算节点上必须安装相应的Agent。&lt;/td&gt;
							&lt;td&gt;
								安装配置相对简单，但是在删除物理资源的时候存在较多的问题。&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								在CentOS 5.5和Ubuntu 10.4上，按照官方网站的安装文档顺序操作，基本没有问题。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									在Ubuntu 10.04上安装企业版，需要手工sudo apt-get install libmysqlclient-dev。&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								在计算节点上的root用户必须允许管理节点上运行ConVirt服务的用户通过key auth方式登录。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								安装配置相对简单。&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					不同的虚拟化管理软件有不同的设计理念，采用不同的系统构架，类似的概念也采用不同的术语来表述，其学习曲线也各不相同。对于大部分用户来说，虚拟化管理软件还是个新生事物。即使是粗略地尝试一下利用不同的虚拟化管理软件来安装、配置和测试一个最小规模的私有云系统，也需要花费不少的时间和精力。在这个过程当中，遇见各种各样的问题都在所难免。不过，也只有亲身经验过这些形形色色的问题，才能够切身体会不同虚拟化管理软件的优点和缺点，并且在分析、总结、归纳的基础上形成自己独特的观点。&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（3）用户界面&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;概述&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;用户权限&lt;/strong&gt;&lt;/td&gt;
							&lt;td width=&quot;30%&quot;&gt;
								&lt;strong&gt;资源池和虚拟机管理&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Eucalyptus提供了一个基于浏览器的简单用户界面，可以完成用户注册，下载credentials，对提供的产品类型进行简单配置等。资源池和虚拟机生命周期管理需要通过euca2ools在命令行模式下完成。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									euca2ools是一组基于命令行的工具，可以与Amazon EC2/S3相兼容的Web Service进行交互。该用具可以管理基于Amazon EC2、Eucalyptus和OpenStack，OpenNebula的云计算服务。&lt;/p&gt;
								&lt;p&gt;
									euca2tools的主要功能包括：&lt;/p&gt;
								&lt;p&gt;
									&amp;ndash; 查询可以使用的域&lt;br /&gt;
									&amp;ndash; 管理SSH Key&lt;br /&gt;
									&amp;ndash; 虚拟机生命周期管理&lt;br /&gt;
									&amp;ndash; 安全组管理&lt;br /&gt;
									&amp;ndash; 管理卷和快照&lt;br /&gt;
									&amp;ndash; 管理虚拟机映像&lt;br /&gt;
									&amp;ndash; 管理IP&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								在Eucalyptus社区版中只有两种类型的用户：管理员，普通用户。在Eucalyptus企业版中进一步提供了用户组，属于某个用户组的用户可以管理属于该用户组的计算资源。&lt;/td&gt;
							&lt;td&gt;
								管理员可以通过注册或者是撤销注册某个计算节点，配置标准产品类型的计算资源（CPU、内存、存储）。普通用户只能够在标准配置的基础上创建、启动、关闭虚拟机，不能够定制化自己所需要的计算资源。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									虚拟机映像文件（EMI）的制作，以及虚拟机生命周期管理等等操作，需要通过euca2ools在命令行模式下完成。在FireFox浏览器中，可以利用ElasticFox插件，在浏览器中启动、监控和关闭虚拟机。ElasticFox的界面不够美观，并且提供的功能非常有限。&lt;/p&gt;
								&lt;p&gt;
									Eucalyptus不提供console功能。用户可以通过SSH连接到自己所管理的虚拟机。&lt;/p&gt;
								&lt;p&gt;
									每一个公开发布的虚拟机映像（EMI），都是一个模板。用户创建虚拟机实例的时候，系统根据用户选择的EMI将相应的虚拟机映像拷贝到目标计算节点上运行。Eucalyptus根据某种算法自动决定用户的虚拟机将在哪个物理服务器上运行，用户对物理服务器的状况一无所知。&lt;/p&gt;
								&lt;p&gt;
									Eucalyptus中的虚拟机实例只是原虚拟机映像（EMI）的一个副本，用户在运行的实例中对虚拟机所做的任何修改，不会被保存到原来的虚拟机映像中。如果用户将运行的虚拟机实例关闭（例如：shutdown），用户对虚拟机所作的任何修改都会丢失。如果用户需要保存自己对虚拟机所做的修改，用户可以选择使用弹性块设备来保存数据，或者将正在运行的虚拟机实例发布为新的EMI。（Amazon EC2自动地将停止运行的虚拟机实例保存为新的AMI，直到用户销毁该虚拟机实例为止。因此，用户可以shutdown自己的虚拟机实例，但是保存自己对虚拟机所作的修改，直到用户选择销毁该虚拟机实例为止。）&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								OpenStack不缺省地提供基于浏览器的用户界面。系统管理员需要手工创建用户。大部分的管理操作，需要在命令行下进行。 尽管OpenStack和Eucalyptus在构架上有很大的不同，但是所暴露给用户的界面是类似的（两者都模仿了Amazon EC2的用户接口规范）。因此，OpenStack同样可以使用Eucalyptus所提供的euca2ools进行管理。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									OpenStack的openstack-dashboard项目和django-nova项目提供了一个基于浏览器的用户界面，没有被集成到OpenStack安装脚本中，需要单独安装。&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								OpenStack将用户分成如下几个类别：
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									admin &amp;mdash; 云服务管理员，拥有所有管理权限。&lt;/p&gt;
								&lt;p&gt;
									itsec &amp;mdash; IT安全管理员，具有隔离有问题的虚拟机实例的权限。&lt;/p&gt;
								&lt;p&gt;
									projectmanager &amp;mdash; 项目管理员，可以增加属于该项目的新用户，管理虚拟机映像，管理虚拟机生命周期。&lt;/p&gt;
								&lt;p&gt;
									netadmin &amp;mdash; 网络管理员，负责IP分配，管理防火墙。&lt;/p&gt;
								&lt;p&gt;
									developer &amp;mdash; 开发人员，可以登录进入属于本项目的虚拟机，管理虚拟机生命周期&lt;/p&gt;
								&lt;p&gt;
									在模仿Amazon EC2的云平台（Eucalyptus, OpenStack, OpenNebula）中，OpenStack提供了颗粒度最细的用户权限管理模式。&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								与Eucalyptus类似，虚拟机映像文件（EMI）的制作，以及虚拟机生命周期管理等等操作，需要通过euca2ools在命令行模式下完成。同样，在FireFox浏览器中，可 以利用ElasticFox插件，在浏览器中启动、监控和关闭虚拟机。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									OpenStack不提供虚拟机console功能。用户可以通过SSH连接到自己所管理的虚拟机。&lt;/p&gt;
								&lt;p&gt;
									正在开发中的openstack-dashboard，基于浏览器提供了比较完整的资源池管理功能和虚拟机生命周期管理功能。虽然界面还比较简单，但是已经处于可用的状态。&lt;/p&gt;
								&lt;p&gt;
									OpenStack的模板和虚拟机实例机制与Eucalyptus类似。与Eucalyptus类似，OpenStack根据某种算法自动决定用户的虚拟机将在哪个物理服务器上运行，用户对物理服务器的状况一无所知。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								OpenNebula不缺省地提供基于浏览器的用户界面。系统管理员需要手工创建用户。大部分的管理操作，需要在命令行下进行。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									OpenNebula目前有两个基于浏览器的用户界面：SunStone和OneMC。这两个项目需要单独安装。&lt;/p&gt;
								&lt;p&gt;
									同样，OpenNebula提供了与Amazon EC2相兼容的Web Service接口。因此，可以通过FireFox所提供的ElasticFox插件和Eucalyptus提供的euca2ools工具集与OpenNebula云平台进行交互。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								OpenNebula只有两种类型的用户：管理员，普通用户。&lt;/td&gt;
							&lt;td&gt;
								在早期版本中，OpenNebula管理员可以在后台通过命令行来管理资源池和虚拟机生命周期。 同样，在FireFox浏览器中，可 以利用ElasticFox插件，在浏览器中启动、监控和关闭虚拟机。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									SunStone和OneMC这两个项目都提供了比较完整的资源池管理和虚拟机生命周期管理功能。两个项目的界面都比较简单，但是基本上处于可用的状态。SunStone没有提供虚拟机console功能，OneMC通过VNC协议提供了虚拟机console功能。&lt;/p&gt;
								&lt;p&gt;
									OpenNebula的模板和虚拟机实例机制与Eucalyptus类似。但是并不缺省地使用euca2ools作为工具。&lt;/p&gt;
								&lt;p&gt;
									与Eucalyptus类似，OpenNebula根据某种算法自动决定用户的虚拟机将在哪个物理服务器上运行，用户对物理服务器的状况一无所知。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								基于浏览器的用户界面，功能比较丰富。&lt;/td&gt;
							&lt;td&gt;
								OpenQRM的管理界面只有两种用户：管理用户，普通用户。普通用户只有查看权限，没有管理权限。&lt;/td&gt;
							&lt;td&gt;
								通过启用不同的插件，可以管理不同的计算资源。所有的资源池和虚拟机生命周期管理操作都可以通过浏览器界面完成。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									OpenQRM的novnc插件可以提供基于VNC协议的虚拟机console功能。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								XenCenter是基于Windows的桌面应用，安装与操作都非常简单，界面美观，功能强大。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									在参与评测的8 个软件中，XenCenter的用户界面是表现最出色的。基于Windows桌面的应用能够迅速地对用户的点击动作作出反应，从而提高用户体验的满意度。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								系统管理员登录XenCenter之后，可以结合Active Directory在用户和用户组的层面分配管理权限。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								授权用户可以通过图形界面方便地进行资源池和虚拟机生命周期管理。在图形界面上可以直观地监控物理服务器和虚拟机的计算资源使用情况（CPU、内存、存储、网络活动）。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									提供基于VNC的虚拟机console。&lt;/p&gt;
								&lt;p&gt;
									可以基于模板的部署新的虚拟机。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								Oracle VM Manager提供了基于浏览器的管理界面。&lt;/td&gt;
							&lt;td&gt;
								Oracle VM Manager同时提供了role和group的概念。其中role定义了用户所具备的权限，属于同一个group的用户拥有该group所被授予的权限。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									Oracle VM Manager提供了三种role：&lt;/p&gt;
								&lt;p&gt;
									user &amp;mdash; 拥有指定资源池的虚拟机生命周期管理权限。&lt;/p&gt;
								&lt;p&gt;
									manager &amp;mdash; 拥有除了用户管理之外的所有管理权限。&lt;/p&gt;
								&lt;p&gt;
									administrator &amp;mdash; 拥有整个系统的管理权限。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								授权用户可以通过图形界面方便地进行资源池和虚拟机生命周期管理。在图形界面上可以直观地监控物理服务器和虚拟机的计算资源使用情况（CPU、内存、存储、网络活动）。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									提供基于VNC的虚拟机console。&lt;/p&gt;
								&lt;p&gt;
									可以基于模板的部署新的虚拟机。&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								基于浏览器的用户界面，功能丰富，美观大方。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								CloudStack根据用户的role将用户分成三个类型：
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									admin &amp;mdash; 全局管理员。&lt;/p&gt;
								&lt;p&gt;
									domain－admin &amp;mdash; 域管理员，可以对某个域下的物理和虚拟资源进行管理。&lt;/p&gt;
								&lt;p&gt;
									user &amp;mdash; 个体用户，可以管理自己名下的虚拟机资源。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								CloudStack对物理资源的管理完整地模拟了一个物理机房的实际情况，按照&amp;ldquo;机房（Zones）－》机柜（Pods）－》集群（Cluster）－》服务器（Server）&amp;rdquo;的结构对物理服务器进行组织，使得管理员能够在管理界面里面的计算资源和机房里面的计算资源建立起直观的一一对应关系。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									授权用户可以通过图形界面方便地进行资源池和虚拟机生命周期管理。在图形界面上可以直观地监控物理服务器和虚拟机的计算资源使用情况（CPU、内存、存储、网络活动）。&lt;/p&gt;
								&lt;p&gt;
									提供基于VNC的虚拟机console。&lt;/p&gt;
								&lt;p&gt;
									可以基于模板的部署新的虚拟机。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								基于浏览器的用户界面，功能丰富，美观大方。&lt;/td&gt;
							&lt;td&gt;
								社区版可以注册多个用户，并可将用户按照用户组进行分类，但是所有的用户拥有相同的全局管理权限。企业版则提供了更细致的用户权限管理机制。除此之外，企业版还提供了对LDAP的支持。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td&gt;
								授权用户可以通过图形界面方便地进行资源池和虚拟机生命周期管理。在图形界面上可以直观地监控物理服务器和虚拟机的计算资源使用情况（CPU、内存、存储、网络活动）。提供基于VNC的虚拟机console。
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									可以基于模板的部署新的虚拟机。&lt;/p&gt;
								&lt;p&gt;
									ConVirt的最大优点，在于其通过时程图的方式在不同的层次上直观地展示计算资源（包括物理资源和虚拟资源）的利用情况和健康状况。在整个数据中心和资源池的层面，ConVirt实时显示资源池数量、物理服务器和虚拟机数量、虚拟机密度、存储资源使用状况、负载最高的N 台物理服务器和虚拟机。在物理服务器和虚拟机的层面，ConVirt实时显示CPU和内存使用情况，监控人员可以通过CPU和内存时程图及时地发现或者是调查系统异常情况。&lt;/p&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
							&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					在所有参与评测的虚拟化管理软件中，XenServer / XCP和ConVirt的图形用户界面是做的最好的。XenCenter的图形界面的优点在于提供了独一无二的用户体验，ConVirt的图形界面的优点在于以图形的方式直观地展示了从机房到虚拟机的健康状况。CloudStack的图形界面非常大气，但是在功能上不如ConVirt那么实用。不过按照CloudStack的目前的发展势头来看，下一个版本可能比较值得期待。&lt;/p&gt;
				&lt;p&gt;
					由于进行评测的时间较短，并且测试系统规模较小的原因，暂时无法对各个软件的稳定性、健壮性、扩展性等等关键问题作出评估。&lt;/p&gt;
				&lt;p&gt;
					商务篇：&lt;/p&gt;
				&lt;p&gt;
					目前市面上形形色色的虚拟化管理软件总数很多，这一系列文章所提及的几个软件仅仅其中的几个代表。作为一个机构、或者是一家企业，在向虚拟化过渡时都不可避免地要面临软件选型的问题。本文作为这一系列文章的最后一篇，从商务和功能两个方面提出自己的一点粗浅意见。&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（1）商务评估&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					从商务上进行软件选型，性价比通常是一个决定性的因素。在假定参与选型的软件全部满足技术要求的前提下，企业（机构）需要考虑的因素包括软件的授权协议是否友好、许可证管理的难易程度、软件和服务的价格高低、运营团队在业界的声誉、开发者社区和用户社区的规模和活跃程度、商业与技术沟通的难易程度。&lt;strong&gt; &lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					授权协议/许可证管理 &amp;mdash; 以全部开放源代码为10分，部分开放源代码（例如以企业版的形式提供某些高级功能，或者以服务的形式提供特别版本的安装包和补丁）扣1 分。商业版本需要在控制节点安装许可证不扣分，需要在所有计算节点安装许可证扣1 分，许可证需要每年更新者扣1 分。&lt;/p&gt;
				&lt;p&gt;
					价格指数 &amp;mdash; 以全部功能免费使用为10分，以企业版的模式提供全部功能的软件，每台物理服务器每花费500美元扣1 分。&lt;/p&gt;
				&lt;p&gt;
					运营团队 &amp;mdash; 以运营团队的规模、背景、影响力评分，存在的主观因素较多。&lt;/p&gt;
				&lt;p&gt;
					社区因素 &amp;mdash; 以开发者和用户社区的规模和活跃程度评分，存在的主观因素较多。&lt;/p&gt;
				&lt;p&gt;
					沟通交流 &amp;mdash; 以个人与运营团队、开发者社区、用户社区之间的沟通顺畅程度评分，存在的主观因素较多。&lt;br /&gt;
					&lt;strong&gt; &lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;授权协议&lt;/strong&gt;
								&lt;p&gt;
									&amp;nbsp;&lt;/p&gt;
								&lt;p&gt;
									&lt;strong&gt;许可证管理&lt;br /&gt;
									&lt;/strong&gt;&lt;/p&gt;
							&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;价格指数&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;运营团队&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;社区因素&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;沟通交流&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;15%&quot;&gt;
								&lt;strong&gt;总分&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								10&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								45&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								10&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								10&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								43&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								42&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								6&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								37&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								10&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								43&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;br /&gt;
								&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								6&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								36&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								6&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								7&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								37&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								8&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								9&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								10&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot;&gt;
								44&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（2）功能评估&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					从功能上进行虚拟化管理软件选型，需要考虑的因素包括该软件所支持的虚拟化技术、安装配置的难易程度、开发和使用文档的详尽程度、所提供的功能是否全面以及用户界面是否直观友好、二次开发的难易程度、是否提供物理资源和虚拟资源的监控报表等等。&lt;/p&gt;
				&lt;p&gt;
					虚拟化技术支持 &amp;mdash; 仅支持一种虚拟化技术为6 分，每增加一种虚拟化技术加1 分，10分封顶。&lt;/p&gt;
				&lt;p&gt;
					安装配置 &amp;mdash; 以按照官方文档进行安装配置的难易程度评分，存在的主观因素较多。&lt;/p&gt;
				&lt;p&gt;
					开发/使用文档 &amp;mdash; 以官方所提供的开发与使用文档的详尽程度评分，文档详尽程度越高者得分越高。&lt;/p&gt;
				&lt;p&gt;
					功能与界面 &amp;mdash; 综合评分，涵盖用户进行物理资源和虚拟资源管理、虚拟机生命周期管理、访问虚拟机资源和存储资源的难易程度，用户界面的美观易用程度，以及综合用户体验。&lt;/p&gt;
				&lt;p&gt;
					二次开发 &amp;mdash; 基础得分6 分，提供与Amazon EC2相兼容的程序调用接口者加3 分，提供二次开发接口但是与Amazon EC2不兼容者加2 分。&lt;/p&gt;
				&lt;p&gt;
					监控报表 &amp;mdash; 基础得分6 分，依系统所提供监控与分析功能的详尽程度加分。&lt;/p&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;table width=&quot;100%&quot;&gt;
					&lt;tbody&gt;
						&lt;tr bgcolor=&quot;#fff8dc&quot; valign=&quot;top&quot;&gt;
							&lt;td width=&quot;10%&quot;&gt;
								&amp;nbsp;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;13%&quot;&gt;
								&lt;strong&gt;虚拟化技术支持&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;13%&quot;&gt;
								&lt;strong&gt;安装配置&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;13%&quot;&gt;
								&lt;strong&gt;开发／使用文档&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;13%&quot;&gt;
								&lt;strong&gt;功能与界面&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;13%&quot;&gt;
								&lt;strong&gt;二次开发&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;12%&quot;&gt;
								&lt;strong&gt;监控报表&lt;/strong&gt;&lt;/td&gt;
							&lt;td style=&quot;text-align: center&quot; width=&quot;12%&quot;&gt;
								&lt;strong&gt;总分&lt;/strong&gt;&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Eucalyptus&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								9&lt;/td&gt;
							&lt;td&gt;
								4&lt;/td&gt;
							&lt;td&gt;
								9 (Amazon WS)&lt;/td&gt;
							&lt;td&gt;
								6&lt;/td&gt;
							&lt;td&gt;
								44&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								4&lt;/td&gt;
							&lt;td&gt;
								9 (Amazon WS)&lt;/td&gt;
							&lt;td&gt;
								6&lt;/td&gt;
							&lt;td&gt;
								45&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenNebula&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								7&lt;/td&gt;
							&lt;td&gt;
								4&lt;/td&gt;
							&lt;td&gt;
								9 (Amazon WS)&lt;/td&gt;
							&lt;td&gt;
								6&lt;/td&gt;
							&lt;td&gt;
								42&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;OpenQRM&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								9&lt;/td&gt;
							&lt;td&gt;
								5&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								6 (OS)&lt;/td&gt;
							&lt;td&gt;
								7&lt;/td&gt;
							&lt;td&gt;
								47&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;XenServer&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								6&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								8 (Plugin)&lt;/td&gt;
							&lt;td&gt;
								9&lt;/td&gt;
							&lt;td&gt;
								53&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;Oracle VM&lt;br /&gt;
								&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								6&lt;/td&gt;
							&lt;td&gt;
								9&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								7&lt;/td&gt;
							&lt;td&gt;
								8 (WS)&lt;/td&gt;
							&lt;td&gt;
								7&lt;/td&gt;
							&lt;td&gt;
								45&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr bgcolor=&quot;#f0f8ff&quot; valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;CloudStack&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								9&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								6 (OS)&lt;/td&gt;
							&lt;td&gt;
								8&lt;/td&gt;
							&lt;td&gt;
								49&lt;/td&gt;
						&lt;/tr&gt;
						&lt;tr valign=&quot;top&quot;&gt;
							&lt;td&gt;
								&lt;strong&gt;ConVirt&lt;/strong&gt;&lt;/td&gt;
							&lt;td&gt;
								7&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								8 (API)&lt;/td&gt;
							&lt;td&gt;
								10&lt;/td&gt;
							&lt;td&gt;
								55&lt;/td&gt;
						&lt;/tr&gt;
					&lt;/tbody&gt;
				&lt;/table&gt;
				&lt;p&gt;
					&amp;nbsp;&lt;/p&gt;
				&lt;p&gt;
					&lt;strong&gt;（3）综合评估&lt;/strong&gt;&lt;/p&gt;
				&lt;p&gt;
					从商务上考虑，Eucalyptus和ConVirt以微弱 的优势领先于其他选项。Eucalyptus是私有云管理平台的先行者。Ubuntu 10.04选择捆绑Eucalyptus作为UEC的基础构架，使得Ecualyptus比其他的私有云管理平台拥有更多的用户和更加活跃的社区。此外，Ecualyptus在中国国内有销售和技术支持人员，在沟通上比选择其他软件要更加容易。ConVirt排名第二，根本原因在于其销售和技术支持团队与（潜在的）客户保持积极而有效的沟通。Citrix XenServer仅仅与其他两个选项并列排名第三，输在其过于严苛的许可证管理政策。的确，要给100台以上的服务器单独安装许可证并且每年更新一次，可不是一件有意思的事情。&lt;/p&gt;
				&lt;p&gt;
					从功能上考虑，ConVirt与XenServer遥遥领先于其他选项。虽然ConVirt仅仅支持Xen和KVM两种虚拟化技术，但是其安装配置相对简单，文档详尽、功能齐全、界面美观、是比较容易上手的虚拟化管理软件。更重要的是，ConVirt的监控报表功能直观地展示了从数据中心到虚拟机的CPU、内存利用情况，使得用户对整个数据中心的健康状况一目了然。同样，XenServer虽然仅支持Xen一种虚拟化技术，但是在安装配置、操作文档、用户界面等方面都不亚于ConVirt。如果用户对基于Windows的界面没有强烈的抵触情绪的话，XenServer是比较值得考虑的一个选型。&lt;/p&gt;
				&lt;p&gt;
					综合如上考虑，对于希望利用虚拟化管理软件提高硬件资源利用率和虚拟化管理自动化程度的企业（机构）来说，建议使用ConVirt来管理企业（机构）的计算资源。如果网管人员不希望深入了解Linux操作系统，并且所管理的物理服务器数量有限的话，XenServer也是一个不错的选择。ConVirt的浏览器界面是开放源代码的，用户可以对其进行定制化，将自己所需要的其他功能添加到同一个用户界面中去。XenCenter则提供了一种插件机制，用户可以通过插件的方式讲自己的功能集成到XenCenter中。&lt;/p&gt;
				&lt;p&gt;
					不过，你的基础设施是否需要与Amazon EC2相兼容呢？也就是说，你的用户是否需要使用他们用于访问和操作Amazon EC2的脚本和工具来访问你的计算资源呢？如果是这样的话，你可能需要在Eucalyptus和OpenStack之间作一个选择（CloudStack和OpenNebula同样提供了与Amazon EC2兼容的操作接口，但是CloudStack在商务方面得分不高，OpenNebula在功能方面得分不高）。Eucalyptus的历史比OpenStack稍长，用户群比OpenStack要大，社区的活跃程度也比OpenStack要高。不过OpenStack的后台老板NASA比Eucalyptus要财大气粗，Ubuntu 11.04也集成了OpenStack作为其UEC的基础构架之一，表明OpenStack已经得到了社区的重视和支持。总的来说，开放源代码的云构架，还是一个不断发展之中的新生食物。笔者只能够建议用户亲自去安装使用每一个软件，最终基于自己的经验以及需求达到一个最适合自己的选择。&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/?p=1391&quot;&gt;&lt;strong&gt;&lt;font color=&quot;#454673&quot;&gt;虚拟化管理软件比较 －－ 幻灯片&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					结合前段时间对不同虚拟化管理软件的评测工作，准备了一套讲座用的幻灯片。PDF版本的文件可以从&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virtualization_Management_Technologies1.pdf&quot;&gt;&lt;strong&gt;&lt;font color=&quot;#454673&quot;&gt;这里&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;下载。如果有人需要ODP版本的文件，直接跟我联系吧。&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_01.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/edd632c190700f9bd4bef00f09f72a16.jpg&quot; title=&quot;Virt_01&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_021.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/e0ae003e1e4a299687b6f123b370a99b.jpg&quot; title=&quot;Virt_02&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_03.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/67c829ed234d7b185bdd37cef2ac6372.jpg&quot; title=&quot;Virt_03&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_04.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/d07808687528d7d8da794bbf78a4d8cd.jpg&quot; title=&quot;Virt_04&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_05.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/41ad103108c1b490a2230e290e150c6b.jpg&quot; title=&quot;Virt_05&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_06.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/a85aff98dc0cf7f882aec108acdcd145.jpg&quot; title=&quot;Virt_06&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_07.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/9d2a74f371518c25d5309ae0b49751ea.jpg&quot; title=&quot;Virt_07&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_08.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/7decfdbd9c2be75f0e100760c4639893.jpg&quot; title=&quot;Virt_08&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_09.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/f6add8ff8838ced803ced0d8818bb5ac.jpg&quot; title=&quot;Virt_09&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_10.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/ce05836808c3dd0696d0310ada772483.jpg&quot; title=&quot;Virt_10&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_11.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/a472a1976994e6633181ccdf240dd325.jpg&quot; title=&quot;Virt_11&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_12.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/0c9abce65a86581beef7b7668c9c0708.jpg&quot; title=&quot;Virt_12&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_13.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/224104b111312f2729e448fb88739927.jpg&quot; title=&quot;Virt_13&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_14.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/926e6b6274f801265fde3ab99fde9712.jpg&quot; title=&quot;Virt_14&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_15.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/595b35d71ad3bb594fc4af116510192e.jpg&quot; title=&quot;Virt_15&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_16.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/be5db88e528164360e1115e8480be310.jpg&quot; title=&quot;Virt_16&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_17.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/bd00c20e96536ec8461d41a70785e1b4.jpg&quot; title=&quot;Virt_17&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_18.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/90d2670f5d45ec03dc90ae852359f039.jpg&quot; title=&quot;Virt_18&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_19.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/43e9c53490270db5ead6bca56685d663.jpg&quot; title=&quot;Virt_19&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p&gt;
					&lt;a href=&quot;http://www.qyjohn.net/wp-content/uploads/2011/05/Virt_20.jpg&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.osedu.net/d/file/article/linux/2011-07-29/665543bc4f1dde2c0ff222d606623430.jpg&quot; title=&quot;Virt_20&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
				&lt;p align=&quot;center&quot; class=&quot;pageLink&quot;&gt;
					&amp;nbsp;&lt;/p&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/12/6/virtualization-compare2.html&quot;&gt;开源IaaS软件的比较 — 构架、功能、社区、商业及其他&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/12/6/virtualization-compare.html&quot;&gt;http://blog.hi-suke.com/2011/12/6/virtualization-compare.html&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/608636253/visionblog/feedsky/s.gif?r=http://blog.hi-suke.com/2011/12/6/virtualization-compare.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><pubDate>Tue, 06 Dec 2011 11:16:26 +0800</pubDate><guid isPermaLink="false">http://blog.hi-suke.com/entry/virtualization-compare</guid><dc:creator>vision4fun</dc:creator><fs:srclink>http://blog.hi-suke.com/2011/12/6/virtualization-compare.html</fs:srclink><fs:srcfeed>http://blog.hi-suke.com/feed</fs:srcfeed><fs:itemid>feedsky/visionblog/~8885042/608636253/5398154</fs:itemid></item><item><title>Linux 技巧：让进程在后台可靠运行的几种方法</title><link>http://blog.hi-suke.com/2011/11/23/linux-daemon.html</link><id xmlns="http://www.w3.org/2005/Atom">http://blog.hi-suke.com/entry/linux-daemon</id><content xmlns="http://www.w3.org/2005/Atom" type="html">&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	原文地址：&lt;a href=&quot;http://www.ibm.com/developerworks/cn/linux/l-cn-nohup/&quot; style=&quot;font-family: Arial, Verdana, sans-serif; text-align: -webkit-auto; &quot;&gt;http://www.ibm.com/developerworks/cn/linux/l-cn-nohup/&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	我们经常会碰到这样的问题，用 telnet/ssh 登录了远程的 Linux 服务器，运行了一些耗时较长的任务， 结果却由于网络的不稳定导致任务中途失败。如何让命令提交后不受本地关闭终端窗口/网络断开连接的干扰呢？下面举了一些例子， 您可以针对不同的场景选择不同的方式来处理这个问题。&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	如果只是临时有一个命令需要长时间运行，什么方法能最简便的保证它在后台稳定运行呢？&lt;/p&gt;
&lt;div class=&quot;ibm-container ibm-alt-header dw-container-sidebar&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 10px; width: 320px; float: right; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot;&gt;
	&lt;h2 style=&quot;font-family: arial, nsimsun, sans-serif; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(247, 248, 252); border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 5px; padding-bottom: 3px; padding-left: 5px; height: 15px; font-size: 0.75em; background-position: 0px -545px; background-repeat: repeat no-repeat; &quot;&gt;
		hangup 名称的来由&lt;/h2&gt;
	&lt;div class=&quot;ibm-container-body&quot; style=&quot;background-image: url(http://1.www.s81c.com/i/v16/t/container-gradient.gif); background-attachment: initial; background-origin: initial; background-clip: initial; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; font-size: 0.76em; font-family: arial, sans-serif; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; background-position: 0px 100%; background-repeat: repeat no-repeat; &quot;&gt;
		在 Unix 的早期版本中，每个终端都会通过 modem 和系统通讯。当用户 logout 时，modem 就会挂断（hang up）电话。 同理，当 modem 断开连接时，就会给终端发送 hangup 信号来通知其关闭所有子进程。&lt;/div&gt;
&lt;/div&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	我们知道，当用户注销（logout）或者网络断开时，终端会收到 HUP（hangup）信号从而关闭其所有子进程。因此，我们的解决办法就有两种途径：要么让进程忽略 HUP 信号，要么让进程运行在新的会话里从而成为不属于此终端的子进程。&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	&lt;strong&gt;1. nohup&lt;/strong&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	nohup 无疑是我们首先想到的办法。顾名思义，nohup 的用途就是让提交的命令忽略 hangup 信号。让我们先来看一下 nohup 的帮助信息：&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				NOHUP(1)                        User Commands                        NOHUP(1)

NAME
       nohup - run a command immune to hangups, with output to a non-tty

SYNOPSIS
       nohup COMMAND [ARG]...
       nohup OPTION

DESCRIPTION
       Run COMMAND, ignoring hangup signals.

       --help display this help and exit

       --version
              output version information and exit &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	可见，nohup 的使用是十分方便的，只需在要处理的命令前加上 nohup 即可，标准输出和标准错误缺省会被重定向到 nohup.out 文件中。一般我们可在结尾加上&lt;strong&gt;&amp;quot;&amp;amp;&amp;quot;&lt;/strong&gt;来将命令同时放入后台运行，也可用&lt;code style=&quot;font-size: small !important; &quot;&gt;&amp;quot;&amp;gt;&lt;em&gt;filename&lt;/em&gt;&amp;nbsp;2&amp;gt;&amp;amp;1&amp;quot;&lt;/code&gt;来更改缺省的重定向文件名。&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 ~]# nohup ping www.ibm.com &amp;amp;
[1] 3059
nohup: appending output to `nohup.out&amp;#39;
[root@pvcent107 ~]# ps -ef |grep 3059
root      3059   &lt;strong&gt;984&lt;/strong&gt;  0 21:06 pts/3    00:00:00 ping www.ibm.com
root      3067   984  0 21:06 pts/3    00:00:00 grep 3059
[root@pvcent107 ~]#	 &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	&lt;strong&gt;2。setsid&lt;/strong&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	nohup 无疑能通过忽略 HUP 信号来使我们的进程避免中途被中断，但如果我们换个角度思考，如果我们的进程不属于接受 HUP 信号的终端的子进程，那么自然也就不会受到 HUP 信号的影响了。setsid 就能帮助我们做到这一点。让我们先来看一下 setsid 的帮助信息：&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				SETSID(8)                 Linux Programmer&amp;rsquo;s Manual                 SETSID(8)

NAME
       setsid - run a program in a new session

SYNOPSIS
       setsid program [ arg ... ]

DESCRIPTION
       setsid runs a program in a new session. &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	可见 setsid 的使用也是非常方便的，也只需在要处理的命令前加上 setsid 即可。&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 ~]# setsid ping www.ibm.com
[root@pvcent107 ~]# ps -ef |grep www.ibm.com
root     31094     &lt;strong&gt;1&lt;/strong&gt;  0 07:28 ?        00:00:00 ping www.ibm.com
root     31102 29217  0 07:29 pts/4    00:00:00 grep www.ibm.com
[root@pvcent107 ~]#   &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	值得注意的是，上例中我们的进程 ID(PID)为31094，而它的父 ID（PPID）为1（即为 init 进程 ID），并不是当前终端的进程 ID。请将此例与&lt;a href=&quot;http://www.ibm.com/developerworks/cn/linux/l-cn-nohup/#nohup&quot; style=&quot;color: rgb(76, 110, 148); &quot;&gt;nohup 例&lt;/a&gt;中的父 ID 做比较。&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	&lt;strong&gt;3。&amp;amp;&lt;/strong&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	这里还有一个关于 subshell 的小技巧。我们知道，将一个或多个命名包含在&amp;ldquo;()&amp;rdquo;中就能让这些命令在子 shell 中运行中，从而扩展出很多有趣的功能，我们现在要讨论的就是其中之一。&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	当我们将&amp;quot;&amp;amp;&amp;quot;也放入&amp;ldquo;()&amp;rdquo;内之后，我们就会发现所提交的作业并不在作业列表中，也就是说，是无法通过&lt;code style=&quot;font-size: small !important; &quot;&gt;jobs&lt;/code&gt;来查看的。让我们来看看为什么这样就能躲过 HUP 信号的影响吧。&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 ~]# (ping www.ibm.com &amp;amp;)
[root@pvcent107 ~]# ps -ef |grep www.ibm.com
root     16270     &lt;strong&gt;1&lt;/strong&gt;  0 14:13 pts/4    00:00:00 ping www.ibm.com
root     16278 15362  0 14:13 pts/4    00:00:00 grep www.ibm.com
[root@pvcent107 ~]#   &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	从上例中可以看出，新提交的进程的父 ID（PPID）为1（init 进程的 PID），并不是当前终端的进程 ID。因此并不属于当前终端的子进程，从而也就不会受到当前终端的 HUP 信号的影响了。&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	我们已经知道，如果事先在命令前加上 nohup 或者 setsid 就可以避免 HUP 信号的影响。但是如果我们未加任何处理就已经提交了命令，该如何补救才能让它避免 HUP 信号的影响呢？&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	这时想加 nohup 或者 setsid 已经为时已晚，只能通过作业调度和 disown 来解决这个问题了。让我们来看一下 disown 的帮助信息：&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				disown [-ar] [-h] [jobspec ...]
	Without options, each jobspec is  removed  from  the  table  of
	active  jobs.   If  the -h option is given, each jobspec is not
	removed from the table, but is marked so  that  SIGHUP  is  not
	sent  to the job if the shell receives a SIGHUP.  If no jobspec
	is present, and neither the -a nor the -r option  is  supplied,
	the  current  job  is  used.  If no jobspec is supplied, the -a
	option means to remove or mark all jobs; the -r option  without
	a  jobspec  argument  restricts operation to running jobs.  The
	return value is 0 unless a jobspec does  not  specify  a  valid
	job.&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	可以看出，我们可以用如下方式来达成我们的目的。&lt;/p&gt;
&lt;div class=&quot;ibm-container ibm-alt-header dw-container-sidebar&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 10px; width: 320px; float: right; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot;&gt;
	&lt;h2 style=&quot;font-family: arial, nsimsun, sans-serif; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(247, 248, 252); border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 5px; padding-bottom: 3px; padding-left: 5px; height: 15px; font-size: 0.75em; background-position: 0px -545px; background-repeat: repeat no-repeat; &quot;&gt;
		灵活运用 CTRL-z&lt;/h2&gt;
	&lt;div class=&quot;ibm-container-body&quot; style=&quot;background-image: url(http://1.www.s81c.com/i/v16/t/container-gradient.gif); background-attachment: initial; background-origin: initial; background-clip: initial; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; font-size: 0.76em; font-family: arial, sans-serif; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; background-position: 0px 100%; background-repeat: repeat no-repeat; &quot;&gt;
		在我们的日常工作中，我们可以用 CTRL-z 来将当前进程挂起到后台暂停运行，执行一些别的操作，然后再用 fg 来将挂起的进程重新放回前台（也可用 bg 来将挂起的进程放在后台）继续运行。这样我们就可以在一个终端内灵活切换运行多个任务，这一点在调试代码时尤为有用。因为将代码编辑器挂起到后台再重新放回时，光标定位仍然停留在上次挂起时的位置，避免了重新定位的麻烦。&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 5px; font-size: 0.76em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot;&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		用&lt;code style=&quot;font-size: small !important; &quot;&gt;disown -h&amp;nbsp;&lt;em&gt;jobspec&lt;/em&gt;&amp;nbsp;&lt;/code&gt;来使&lt;strong&gt;某个作业&lt;/strong&gt;忽略HUP信号。&lt;/li&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		用&lt;code style=&quot;font-size: small !important; &quot;&gt;disown -ah&amp;nbsp;&lt;/code&gt;来使&lt;strong&gt;所有的作业&lt;/strong&gt;都忽略HUP信号。&lt;/li&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		用&lt;code style=&quot;font-size: small !important; &quot;&gt;disown -rh&amp;nbsp;&lt;/code&gt;来使&lt;strong&gt;正在运行的作业&lt;/strong&gt;忽略HUP信号。&lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	&lt;span class=&quot;goog_qs-tidbit goog_qs-tidbit-0&quot; style=&quot;display: inline !important; background-color: rgb(255, 255, 221); text-decoration: inherit; &quot;&gt;需要注意的是，当使用过 disown 之后，会将把目标作业从作业列表中移&lt;/span&gt;除，我们将不能再使用&lt;code style=&quot;font-size: small !important; &quot;&gt;jobs&lt;/code&gt;来查看它，但是依然能够用&lt;code style=&quot;font-size: small !important; &quot;&gt;ps -ef&lt;/code&gt;查找到它。&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	但是还有一个问题，这种方法的操作对象是作业，如果我们在运行命令时在结尾加了&lt;strong&gt;&amp;quot;&amp;amp;&amp;quot;&lt;/strong&gt;来使它成为一个作业并在后台运行，那么就万事大吉了，我们可以通过&lt;code style=&quot;font-size: small !important; &quot;&gt;jobs&lt;/code&gt;命令来得到所有作业的列表。但是如果并没有把当前命令作为作业来运行，如何才能得到它的作业号呢？答案就是用 CTRL-z（按住Ctrl键的同时按住z键）了！&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	CTRL-z 的用途就是将当前进程挂起（Suspend），然后我们就可以用&lt;code style=&quot;font-size: small !important; &quot;&gt;jobs&lt;/code&gt;命令来查询它的作业号，再用&lt;code style=&quot;font-size: small !important; &quot;&gt;bg&amp;nbsp;&lt;em&gt;jobspec&lt;/em&gt;&amp;nbsp;&lt;/code&gt;来将它放入后台并继续运行。需要注意的是，如果挂起会影响当前进程的运行结果，请慎用此方法。&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 build]# cp -r testLargeFile largeFile &amp;amp;
[1] 4825
[root@pvcent107 build]# jobs
[1]+  Running                 cp -i -r testLargeFile largeFile &amp;amp;
[root@pvcent107 build]# disown -h %1
[root@pvcent107 build]# ps -ef |grep largeFile
root      4825   968  1 09:46 pts/4    00:00:00 cp -i -r testLargeFile largeFile
root      4853   968  0 09:46 pts/4    00:00:00 grep largeFile
[root@pvcent107 build]# logout   &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 build]# cp -r testLargeFile largeFile2

[1]+  Stopped                 cp -i -r testLargeFile largeFile2
[root@pvcent107 build]# bg %1
[1]+ cp -i -r testLargeFile largeFile2 &amp;amp;
[root@pvcent107 build]# jobs
[1]+  Running                 cp -i -r testLargeFile largeFile2 &amp;amp;
[root@pvcent107 build]# disown -h %1
[root@pvcent107 build]# ps -ef |grep largeFile2
root      5790  5577  1 10:04 pts/3    00:00:00 cp -i -r testLargeFile largeFile2
root      5824  5577  0 10:05 pts/3    00:00:00 grep largeFile2
[root@pvcent107 build]#   &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p class=&quot;ibm-ind-link ibm-back-to-top&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; clear: both; text-align: right; height: 15px; &quot;&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	我们已经知道了如何让进程免受 HUP 信号的影响，但是如果有大量这种命令需要在稳定的后台里运行，如何避免对每条命令都做这样的操作呢？&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	此时最方便的方法就是 screen 了。简单的说，screen 提供了 ANSI/VT100 的终端模拟器，使它能够在一个真实终端下运行多个全屏的伪终端。screen 的参数很多，具有很强大的功能，我们在此仅介绍其常用功能以及简要分析一下为什么使用 screen 能够避免 HUP 信号的影响。我们先看一下 screen 的帮助信息：&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				SCREEN(1)                                                           SCREEN(1)

NAME
       screen - screen manager with VT100/ANSI terminal emulation

SYNOPSIS
       screen [ -options ] [ cmd [ args ] ]
       screen -r [[pid.]tty[.host]]
       screen -r sessionowner/[[pid.]tty[.host]]

DESCRIPTION
       Screen  is  a  full-screen  window manager that multiplexes a physical
       terminal between several  processes  (typically  interactive  shells).
       Each  virtual  terminal provides the functions of a DEC VT100 terminal
       and, in addition, several control functions from the  ISO  6429  (ECMA
       48,  ANSI  X3.64)  and ISO 2022 standards (e.g. insert/delete line and
       support for multiple character sets).  There is a  scrollback  history
       buffer  for  each virtual terminal and a copy-and-paste mechanism that
       allows moving text regions between windows.	&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	使用 screen 很方便，有以下几个常用选项：&lt;/p&gt;
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 5px; font-size: 0.76em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot;&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		用&lt;code style=&quot;font-size: small !important; &quot;&gt;screen -dmS&amp;nbsp;&lt;em&gt;session name&lt;/em&gt;&amp;nbsp;&lt;/code&gt;来建立一个处于断开模式下的会话（并指定其会话名）。&lt;/li&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		用&lt;code style=&quot;font-size: small !important; &quot;&gt;screen -list&amp;nbsp;&lt;/code&gt;来列出所有会话。&lt;/li&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		用&lt;code style=&quot;font-size: small !important; &quot;&gt;screen -r&amp;nbsp;&lt;em&gt;session name&lt;/em&gt;&amp;nbsp;&lt;/code&gt;来重新连接指定会话。&lt;/li&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		用快捷键&lt;code style=&quot;font-size: small !important; &quot;&gt;CTRL-a d&amp;nbsp;&lt;/code&gt;来暂时断开当前会话。&lt;/li&gt;
&lt;/ul&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 ~]# screen -dmS Urumchi
[root@pvcent107 ~]# screen -list
There is a screen on:
        12842.Urumchi   (Detached)
1 Socket in /tmp/screens/S-root.

[root@pvcent107 ~]# screen -r Urumchi	 &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	当我们用&amp;ldquo;-r&amp;rdquo;连接到 screen 会话后，我们就可以在这个伪终端里面为所欲为，再也不用担心 HUP 信号会对我们的进程造成影响，也不用给每个命令前都加上&amp;ldquo;nohup&amp;rdquo;或者&amp;ldquo;setsid&amp;rdquo;了。这是为什么呢？让我来看一下下面两个例子吧。&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 ~]# ping www.google.com &amp;amp;
[1] 9499
[root@pvcent107 ~]# pstree -H 9499
init─┬─Xvnc
     ├─acpid
     ├─atd
     ├─2*[sendmail]	
     &lt;strong&gt;├─sshd─┬&lt;/strong&gt;─sshd───bash───pstree
     │      &lt;strong&gt; └─sshd───bash───ping&lt;/strong&gt;
            &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	我们可以看出，未使用 screen 时我们所处的 bash 是 sshd 的子进程，当 ssh 断开连接时，HUP 信号自然会影响到它下面的所有子进程（包括我们新建立的 ping 进程）。&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 ~]# screen -r Urumchi
[root@pvcent107 ~]# ping www.ibm.com &amp;amp;
[1] 9488
[root@pvcent107 ~]# pstree -H 9488
init─┬─Xvnc
     ├─acpid
     ├─atd
     &lt;strong&gt;├─screen───bash───ping&lt;/strong&gt;
     ├─2*[sendmail]	&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	而使用了 screen 后就不同了，此时 bash 是 screen 的子进程，而 screen 是 init（PID为1）的子进程。那么当 ssh 断开连接时，HUP 信号自然不会影响到 screen 下面的子进程了。&lt;/p&gt;
&lt;p class=&quot;ibm-ind-link ibm-back-to-top&quot; style=&quot;text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; clear: both; height: 15px; color: rgb(0, 0, 0); &quot;&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	现在几种方法已经介绍完毕，我们可以根据不同的场景来选择不同的方案。nohup/setsid 无疑是临时需要时最方便的方法，disown 能帮助我们来事后补救当前已经在运行了的作业，而 screen 则是在大批量操作时不二的选择了。&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 5px; font-size: 0.76em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot;&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		&amp;ldquo;&lt;a href=&quot;http://www.ibm.com/developerworks/cn/aix/library/es-unix-sysadmin1.html&quot; style=&quot;color: rgb(76, 110, 148); &quot;&gt;系统管理员工具包：进程管理技巧&lt;/a&gt;&amp;rdquo;（developerWorks 中国，2006 年 5 月）介绍了 Linux 进程管理的更多技巧。&lt;br /&gt;
		&amp;nbsp;&lt;/li&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		&amp;ldquo;&lt;a href=&quot;http://www.ibm.com/developerworks/cn/linux/l-cn-screen/&quot; style=&quot;color: rgb(76, 110, 148); &quot;&gt;Linux 技巧：使用 screen 管理你的远程会话&lt;/a&gt;&amp;rdquo;（developerWorks 中国，2007 年 7 月）介绍了 screen 的更多技巧。&lt;br /&gt;
		&amp;nbsp;&lt;/li&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		在&amp;nbsp;&lt;a href=&quot;http://www.ibm.com/developerworks/cn/linux/&quot; style=&quot;color: rgb(76, 110, 148); &quot;&gt;developerWorks 中国网站 Linux 专区&lt;/a&gt;中学习更多 Linux 方面的知识。&lt;br /&gt;
		&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;ibm-container ibm-portrait-module ibm-alternate-two&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; width: 710px; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot;&gt;
	&lt;div class=&quot;ibm-container-body&quot; style=&quot;background-image: url(http://1.www.s81c.com/i/v16/t/container-gradient.gif); background-attachment: initial; background-origin: initial; background-clip: initial; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; min-height: 55px; background-position: 0px 100%; background-repeat: repeat no-repeat; &quot;&gt;
		&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; font-size: 0.76em; &quot;&gt;
			申毅，IBM 中国软件开发中心 WebSphere Portal 部门软件工程师。&lt;/p&gt;
	&lt;/div&gt;
&lt;/div&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/11/15/bash-shortcuts.html&quot;&gt;[zz]让你提升命令行效率的Bash快捷键&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/09/28/vim-level.html&quot;&gt;[zz]简明Vim练级攻略&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/06/13/terminator.html&quot;&gt;[zz]Terminator学习小记&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/03/18/gentoo-update.html&quot;&gt;Gentoo Emerge World&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/02/24/linux-clear.html&quot;&gt;linux入侵踪迹隐藏攻略&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/11/23/linux-daemon.html&quot;&gt;http://blog.hi-suke.com/2011/11/23/linux-daemon.html&lt;/a&gt;&lt;/p&gt;</content><author xmlns="http://www.w3.org/2005/Atom"><name>vision4fun</name></author><content:encoded>&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	原文地址：&lt;a href=&quot;http://www.ibm.com/developerworks/cn/linux/l-cn-nohup/&quot; style=&quot;font-family: Arial, Verdana, sans-serif; text-align: -webkit-auto; &quot;&gt;http://www.ibm.com/developerworks/cn/linux/l-cn-nohup/&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	我们经常会碰到这样的问题，用 telnet/ssh 登录了远程的 Linux 服务器，运行了一些耗时较长的任务， 结果却由于网络的不稳定导致任务中途失败。如何让命令提交后不受本地关闭终端窗口/网络断开连接的干扰呢？下面举了一些例子， 您可以针对不同的场景选择不同的方式来处理这个问题。&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	如果只是临时有一个命令需要长时间运行，什么方法能最简便的保证它在后台稳定运行呢？&lt;/p&gt;
&lt;div class=&quot;ibm-container ibm-alt-header dw-container-sidebar&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 10px; width: 320px; float: right; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot;&gt;
	&lt;h2 style=&quot;font-family: arial, nsimsun, sans-serif; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(247, 248, 252); border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 5px; padding-bottom: 3px; padding-left: 5px; height: 15px; font-size: 0.75em; background-position: 0px -545px; background-repeat: repeat no-repeat; &quot;&gt;
		hangup 名称的来由&lt;/h2&gt;
	&lt;div class=&quot;ibm-container-body&quot; style=&quot;background-image: url(http://1.www.s81c.com/i/v16/t/container-gradient.gif); background-attachment: initial; background-origin: initial; background-clip: initial; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; font-size: 0.76em; font-family: arial, sans-serif; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; background-position: 0px 100%; background-repeat: repeat no-repeat; &quot;&gt;
		在 Unix 的早期版本中，每个终端都会通过 modem 和系统通讯。当用户 logout 时，modem 就会挂断（hang up）电话。 同理，当 modem 断开连接时，就会给终端发送 hangup 信号来通知其关闭所有子进程。&lt;/div&gt;
&lt;/div&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	我们知道，当用户注销（logout）或者网络断开时，终端会收到 HUP（hangup）信号从而关闭其所有子进程。因此，我们的解决办法就有两种途径：要么让进程忽略 HUP 信号，要么让进程运行在新的会话里从而成为不属于此终端的子进程。&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	&lt;strong&gt;1. nohup&lt;/strong&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	nohup 无疑是我们首先想到的办法。顾名思义，nohup 的用途就是让提交的命令忽略 hangup 信号。让我们先来看一下 nohup 的帮助信息：&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				NOHUP(1)                        User Commands                        NOHUP(1)

NAME
       nohup - run a command immune to hangups, with output to a non-tty

SYNOPSIS
       nohup COMMAND [ARG]...
       nohup OPTION

DESCRIPTION
       Run COMMAND, ignoring hangup signals.

       --help display this help and exit

       --version
              output version information and exit &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	可见，nohup 的使用是十分方便的，只需在要处理的命令前加上 nohup 即可，标准输出和标准错误缺省会被重定向到 nohup.out 文件中。一般我们可在结尾加上&lt;strong&gt;&amp;quot;&amp;amp;&amp;quot;&lt;/strong&gt;来将命令同时放入后台运行，也可用&lt;code style=&quot;font-size: small !important; &quot;&gt;&amp;quot;&amp;gt;&lt;em&gt;filename&lt;/em&gt;&amp;nbsp;2&amp;gt;&amp;amp;1&amp;quot;&lt;/code&gt;来更改缺省的重定向文件名。&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 ~]# nohup ping www.ibm.com &amp;amp;
[1] 3059
nohup: appending output to `nohup.out&amp;#39;
[root@pvcent107 ~]# ps -ef |grep 3059
root      3059   &lt;strong&gt;984&lt;/strong&gt;  0 21:06 pts/3    00:00:00 ping www.ibm.com
root      3067   984  0 21:06 pts/3    00:00:00 grep 3059
[root@pvcent107 ~]#	 &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	&lt;strong&gt;2。setsid&lt;/strong&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	nohup 无疑能通过忽略 HUP 信号来使我们的进程避免中途被中断，但如果我们换个角度思考，如果我们的进程不属于接受 HUP 信号的终端的子进程，那么自然也就不会受到 HUP 信号的影响了。setsid 就能帮助我们做到这一点。让我们先来看一下 setsid 的帮助信息：&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				SETSID(8)                 Linux Programmer&amp;rsquo;s Manual                 SETSID(8)

NAME
       setsid - run a program in a new session

SYNOPSIS
       setsid program [ arg ... ]

DESCRIPTION
       setsid runs a program in a new session. &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	可见 setsid 的使用也是非常方便的，也只需在要处理的命令前加上 setsid 即可。&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 ~]# setsid ping www.ibm.com
[root@pvcent107 ~]# ps -ef |grep www.ibm.com
root     31094     &lt;strong&gt;1&lt;/strong&gt;  0 07:28 ?        00:00:00 ping www.ibm.com
root     31102 29217  0 07:29 pts/4    00:00:00 grep www.ibm.com
[root@pvcent107 ~]#   &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	值得注意的是，上例中我们的进程 ID(PID)为31094，而它的父 ID（PPID）为1（即为 init 进程 ID），并不是当前终端的进程 ID。请将此例与&lt;a href=&quot;http://www.ibm.com/developerworks/cn/linux/l-cn-nohup/#nohup&quot; style=&quot;color: rgb(76, 110, 148); &quot;&gt;nohup 例&lt;/a&gt;中的父 ID 做比较。&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	&lt;strong&gt;3。&amp;amp;&lt;/strong&gt;&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	这里还有一个关于 subshell 的小技巧。我们知道，将一个或多个命名包含在&amp;ldquo;()&amp;rdquo;中就能让这些命令在子 shell 中运行中，从而扩展出很多有趣的功能，我们现在要讨论的就是其中之一。&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	当我们将&amp;quot;&amp;amp;&amp;quot;也放入&amp;ldquo;()&amp;rdquo;内之后，我们就会发现所提交的作业并不在作业列表中，也就是说，是无法通过&lt;code style=&quot;font-size: small !important; &quot;&gt;jobs&lt;/code&gt;来查看的。让我们来看看为什么这样就能躲过 HUP 信号的影响吧。&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 ~]# (ping www.ibm.com &amp;amp;)
[root@pvcent107 ~]# ps -ef |grep www.ibm.com
root     16270     &lt;strong&gt;1&lt;/strong&gt;  0 14:13 pts/4    00:00:00 ping www.ibm.com
root     16278 15362  0 14:13 pts/4    00:00:00 grep www.ibm.com
[root@pvcent107 ~]#   &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	从上例中可以看出，新提交的进程的父 ID（PPID）为1（init 进程的 PID），并不是当前终端的进程 ID。因此并不属于当前终端的子进程，从而也就不会受到当前终端的 HUP 信号的影响了。&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	我们已经知道，如果事先在命令前加上 nohup 或者 setsid 就可以避免 HUP 信号的影响。但是如果我们未加任何处理就已经提交了命令，该如何补救才能让它避免 HUP 信号的影响呢？&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	这时想加 nohup 或者 setsid 已经为时已晚，只能通过作业调度和 disown 来解决这个问题了。让我们来看一下 disown 的帮助信息：&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				disown [-ar] [-h] [jobspec ...]
	Without options, each jobspec is  removed  from  the  table  of
	active  jobs.   If  the -h option is given, each jobspec is not
	removed from the table, but is marked so  that  SIGHUP  is  not
	sent  to the job if the shell receives a SIGHUP.  If no jobspec
	is present, and neither the -a nor the -r option  is  supplied,
	the  current  job  is  used.  If no jobspec is supplied, the -a
	option means to remove or mark all jobs; the -r option  without
	a  jobspec  argument  restricts operation to running jobs.  The
	return value is 0 unless a jobspec does  not  specify  a  valid
	job.&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	可以看出，我们可以用如下方式来达成我们的目的。&lt;/p&gt;
&lt;div class=&quot;ibm-container ibm-alt-header dw-container-sidebar&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 10px; width: 320px; float: right; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot;&gt;
	&lt;h2 style=&quot;font-family: arial, nsimsun, sans-serif; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(247, 248, 252); border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 5px; padding-bottom: 3px; padding-left: 5px; height: 15px; font-size: 0.75em; background-position: 0px -545px; background-repeat: repeat no-repeat; &quot;&gt;
		灵活运用 CTRL-z&lt;/h2&gt;
	&lt;div class=&quot;ibm-container-body&quot; style=&quot;background-image: url(http://1.www.s81c.com/i/v16/t/container-gradient.gif); background-attachment: initial; background-origin: initial; background-clip: initial; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; font-size: 0.76em; font-family: arial, sans-serif; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; background-position: 0px 100%; background-repeat: repeat no-repeat; &quot;&gt;
		在我们的日常工作中，我们可以用 CTRL-z 来将当前进程挂起到后台暂停运行，执行一些别的操作，然后再用 fg 来将挂起的进程重新放回前台（也可用 bg 来将挂起的进程放在后台）继续运行。这样我们就可以在一个终端内灵活切换运行多个任务，这一点在调试代码时尤为有用。因为将代码编辑器挂起到后台再重新放回时，光标定位仍然停留在上次挂起时的位置，避免了重新定位的麻烦。&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 5px; font-size: 0.76em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot;&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		用&lt;code style=&quot;font-size: small !important; &quot;&gt;disown -h&amp;nbsp;&lt;em&gt;jobspec&lt;/em&gt;&amp;nbsp;&lt;/code&gt;来使&lt;strong&gt;某个作业&lt;/strong&gt;忽略HUP信号。&lt;/li&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		用&lt;code style=&quot;font-size: small !important; &quot;&gt;disown -ah&amp;nbsp;&lt;/code&gt;来使&lt;strong&gt;所有的作业&lt;/strong&gt;都忽略HUP信号。&lt;/li&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		用&lt;code style=&quot;font-size: small !important; &quot;&gt;disown -rh&amp;nbsp;&lt;/code&gt;来使&lt;strong&gt;正在运行的作业&lt;/strong&gt;忽略HUP信号。&lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	&lt;span class=&quot;goog_qs-tidbit goog_qs-tidbit-0&quot; style=&quot;display: inline !important; background-color: rgb(255, 255, 221); text-decoration: inherit; &quot;&gt;需要注意的是，当使用过 disown 之后，会将把目标作业从作业列表中移&lt;/span&gt;除，我们将不能再使用&lt;code style=&quot;font-size: small !important; &quot;&gt;jobs&lt;/code&gt;来查看它，但是依然能够用&lt;code style=&quot;font-size: small !important; &quot;&gt;ps -ef&lt;/code&gt;查找到它。&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	但是还有一个问题，这种方法的操作对象是作业，如果我们在运行命令时在结尾加了&lt;strong&gt;&amp;quot;&amp;amp;&amp;quot;&lt;/strong&gt;来使它成为一个作业并在后台运行，那么就万事大吉了，我们可以通过&lt;code style=&quot;font-size: small !important; &quot;&gt;jobs&lt;/code&gt;命令来得到所有作业的列表。但是如果并没有把当前命令作为作业来运行，如何才能得到它的作业号呢？答案就是用 CTRL-z（按住Ctrl键的同时按住z键）了！&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	CTRL-z 的用途就是将当前进程挂起（Suspend），然后我们就可以用&lt;code style=&quot;font-size: small !important; &quot;&gt;jobs&lt;/code&gt;命令来查询它的作业号，再用&lt;code style=&quot;font-size: small !important; &quot;&gt;bg&amp;nbsp;&lt;em&gt;jobspec&lt;/em&gt;&amp;nbsp;&lt;/code&gt;来将它放入后台并继续运行。需要注意的是，如果挂起会影响当前进程的运行结果，请慎用此方法。&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 build]# cp -r testLargeFile largeFile &amp;amp;
[1] 4825
[root@pvcent107 build]# jobs
[1]+  Running                 cp -i -r testLargeFile largeFile &amp;amp;
[root@pvcent107 build]# disown -h %1
[root@pvcent107 build]# ps -ef |grep largeFile
root      4825   968  1 09:46 pts/4    00:00:00 cp -i -r testLargeFile largeFile
root      4853   968  0 09:46 pts/4    00:00:00 grep largeFile
[root@pvcent107 build]# logout   &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 build]# cp -r testLargeFile largeFile2

[1]+  Stopped                 cp -i -r testLargeFile largeFile2
[root@pvcent107 build]# bg %1
[1]+ cp -i -r testLargeFile largeFile2 &amp;amp;
[root@pvcent107 build]# jobs
[1]+  Running                 cp -i -r testLargeFile largeFile2 &amp;amp;
[root@pvcent107 build]# disown -h %1
[root@pvcent107 build]# ps -ef |grep largeFile2
root      5790  5577  1 10:04 pts/3    00:00:00 cp -i -r testLargeFile largeFile2
root      5824  5577  0 10:05 pts/3    00:00:00 grep largeFile2
[root@pvcent107 build]#   &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p class=&quot;ibm-ind-link ibm-back-to-top&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; clear: both; text-align: right; height: 15px; &quot;&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	我们已经知道了如何让进程免受 HUP 信号的影响，但是如果有大量这种命令需要在稳定的后台里运行，如何避免对每条命令都做这样的操作呢？&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	此时最方便的方法就是 screen 了。简单的说，screen 提供了 ANSI/VT100 的终端模拟器，使它能够在一个真实终端下运行多个全屏的伪终端。screen 的参数很多，具有很强大的功能，我们在此仅介绍其常用功能以及简要分析一下为什么使用 screen 能够避免 HUP 信号的影响。我们先看一下 screen 的帮助信息：&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				SCREEN(1)                                                           SCREEN(1)

NAME
       screen - screen manager with VT100/ANSI terminal emulation

SYNOPSIS
       screen [ -options ] [ cmd [ args ] ]
       screen -r [[pid.]tty[.host]]
       screen -r sessionowner/[[pid.]tty[.host]]

DESCRIPTION
       Screen  is  a  full-screen  window manager that multiplexes a physical
       terminal between several  processes  (typically  interactive  shells).
       Each  virtual  terminal provides the functions of a DEC VT100 terminal
       and, in addition, several control functions from the  ISO  6429  (ECMA
       48,  ANSI  X3.64)  and ISO 2022 standards (e.g. insert/delete line and
       support for multiple character sets).  There is a  scrollback  history
       buffer  for  each virtual terminal and a copy-and-paste mechanism that
       allows moving text regions between windows.	&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	使用 screen 很方便，有以下几个常用选项：&lt;/p&gt;
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 5px; font-size: 0.76em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot;&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		用&lt;code style=&quot;font-size: small !important; &quot;&gt;screen -dmS&amp;nbsp;&lt;em&gt;session name&lt;/em&gt;&amp;nbsp;&lt;/code&gt;来建立一个处于断开模式下的会话（并指定其会话名）。&lt;/li&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		用&lt;code style=&quot;font-size: small !important; &quot;&gt;screen -list&amp;nbsp;&lt;/code&gt;来列出所有会话。&lt;/li&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		用&lt;code style=&quot;font-size: small !important; &quot;&gt;screen -r&amp;nbsp;&lt;em&gt;session name&lt;/em&gt;&amp;nbsp;&lt;/code&gt;来重新连接指定会话。&lt;/li&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		用快捷键&lt;code style=&quot;font-size: small !important; &quot;&gt;CTRL-a d&amp;nbsp;&lt;/code&gt;来暂时断开当前会话。&lt;/li&gt;
&lt;/ul&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 ~]# screen -dmS Urumchi
[root@pvcent107 ~]# screen -list
There is a screen on:
        12842.Urumchi   (Detached)
1 Socket in /tmp/screens/S-root.

[root@pvcent107 ~]# screen -r Urumchi	 &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	当我们用&amp;ldquo;-r&amp;rdquo;连接到 screen 会话后，我们就可以在这个伪终端里面为所欲为，再也不用担心 HUP 信号会对我们的进程造成影响，也不用给每个命令前都加上&amp;ldquo;nohup&amp;rdquo;或者&amp;ldquo;setsid&amp;rdquo;了。这是为什么呢？让我来看一下下面两个例子吧。&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 ~]# ping www.google.com &amp;amp;
[1] 9499
[root@pvcent107 ~]# pstree -H 9499
init─┬─Xvnc
     ├─acpid
     ├─atd
     ├─2*[sendmail]	
     &lt;strong&gt;├─sshd─┬&lt;/strong&gt;─sshd───bash───pstree
     │      &lt;strong&gt; └─sshd───bash───ping&lt;/strong&gt;
            &lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	我们可以看出，未使用 screen 时我们所处的 bash 是 sshd 的子进程，当 ssh 断开连接时，HUP 信号自然会影响到它下面的所有子进程（包括我们新建立的 ping 进程）。&lt;/p&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;font-size: 0.8em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot; width=&quot;100%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td class=&quot;code-outline&quot; style=&quot;font-family: arial, nsimsun, sans-serif; background-color: rgb(247, 247, 247) !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 5px; padding-left: 2px; &quot;&gt;
				&lt;pre class=&quot;displaycode&quot; style=&quot;width: 694px; margin-top: 0px; margin-bottom: 0px; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; overflow-x: auto; overflow-y: auto; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; &quot;&gt;
				[root@pvcent107 ~]# screen -r Urumchi
[root@pvcent107 ~]# ping www.ibm.com &amp;amp;
[1] 9488
[root@pvcent107 ~]# pstree -H 9488
init─┬─Xvnc
     ├─acpid
     ├─atd
     &lt;strong&gt;├─screen───bash───ping&lt;/strong&gt;
     ├─2*[sendmail]	&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;br style=&quot;color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot; /&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	而使用了 screen 后就不同了，此时 bash 是 screen 的子进程，而 screen 是 init（PID为1）的子进程。那么当 ssh 断开连接时，HUP 信号自然不会影响到 screen 下面的子进程了。&lt;/p&gt;
&lt;p class=&quot;ibm-ind-link ibm-back-to-top&quot; style=&quot;text-align: left; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; clear: both; height: 15px; color: rgb(0, 0, 0); &quot;&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; font-size: 0.76em; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	现在几种方法已经介绍完毕，我们可以根据不同的场景来选择不同的方案。nohup/setsid 无疑是临时需要时最方便的方法，disown 能帮助我们来事后补救当前已经在运行了的作业，而 screen 则是在大批量操作时不二的选择了。&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.3em; padding-right: 5px; padding-bottom: 0.7em; padding-left: 5px; color: rgb(0, 0, 0); text-align: left; &quot;&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 5px; font-size: 0.76em; color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; &quot;&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		&amp;ldquo;&lt;a href=&quot;http://www.ibm.com/developerworks/cn/aix/library/es-unix-sysadmin1.html&quot; style=&quot;color: rgb(76, 110, 148); &quot;&gt;系统管理员工具包：进程管理技巧&lt;/a&gt;&amp;rdquo;（developerWorks 中国，2006 年 5 月）介绍了 Linux 进程管理的更多技巧。&lt;br /&gt;
		&amp;nbsp;&lt;/li&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		&amp;ldquo;&lt;a href=&quot;http://www.ibm.com/developerworks/cn/linux/l-cn-screen/&quot; style=&quot;color: rgb(76, 110, 148); &quot;&gt;Linux 技巧：使用 screen 管理你的远程会话&lt;/a&gt;&amp;rdquo;（developerWorks 中国，2007 年 7 月）介绍了 screen 的更多技巧。&lt;br /&gt;
		&amp;nbsp;&lt;/li&gt;
	&lt;li style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 3px; &quot;&gt;
		在&amp;nbsp;&lt;a href=&quot;http://www.ibm.com/developerworks/cn/linux/&quot; style=&quot;color: rgb(76, 110, 148); &quot;&gt;developerWorks 中国网站 Linux 专区&lt;/a&gt;中学习更多 Linux 方面的知识。&lt;br /&gt;
		&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;ibm-container ibm-portrait-module ibm-alternate-two&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; width: 710px; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); color: rgb(0, 0, 0); font-family: 文泉驿微米黑; text-align: left; font-size: medium; &quot;&gt;
	&lt;div class=&quot;ibm-container-body&quot; style=&quot;background-image: url(http://1.www.s81c.com/i/v16/t/container-gradient.gif); background-attachment: initial; background-origin: initial; background-clip: initial; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; min-height: 55px; background-position: 0px 100%; background-repeat: repeat no-repeat; &quot;&gt;
		&lt;p style=&quot;font-family: arial, nsimsun, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; font-size: 0.76em; &quot;&gt;
			申毅，IBM 中国软件开发中心 WebSphere Portal 部门软件工程师。&lt;/p&gt;
	&lt;/div&gt;
&lt;/div&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/11/15/bash-shortcuts.html&quot;&gt;[zz]让你提升命令行效率的Bash快捷键&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/09/28/vim-level.html&quot;&gt;[zz]简明Vim练级攻略&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/06/13/terminator.html&quot;&gt;[zz]Terminator学习小记&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/03/18/gentoo-update.html&quot;&gt;Gentoo Emerge World&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/02/24/linux-clear.html&quot;&gt;linux入侵踪迹隐藏攻略&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/11/23/linux-daemon.html&quot;&gt;http://blog.hi-suke.com/2011/11/23/linux-daemon.html&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/608636254/visionblog/feedsky/s.gif?r=http://blog.hi-suke.com/2011/11/23/linux-daemon.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><pubDate>Wed, 23 Nov 2011 14:40:51 +0800</pubDate><guid isPermaLink="false">http://blog.hi-suke.com/entry/linux-daemon</guid><dc:creator>vision4fun</dc:creator><fs:srclink>http://blog.hi-suke.com/2011/11/23/linux-daemon.html</fs:srclink><fs:srcfeed>http://blog.hi-suke.com/feed</fs:srcfeed><fs:itemid>feedsky/visionblog/~8885042/608636254/5398154</fs:itemid></item><item><title>出口ip,mark一下</title><link>http://blog.hi-suke.com/2011/11/22/sysu-nat.html</link><id xmlns="http://www.w3.org/2005/Atom">http://blog.hi-suke.com/entry/sysu-nat</id><content xmlns="http://www.w3.org/2005/Atom" type="html">&lt;p&gt;
	校内ip：&lt;/p&gt;
&lt;div&gt;
	192.168.0.0/16 （南）&lt;br /&gt;
	172.16.0.0/16 （珠海）&lt;br /&gt;
	172.18.0.0/16 （东）&lt;br /&gt;
	172.31.0.0/16 （北）&lt;br /&gt;
	202.116.64.0/255.255.224.0 （南）&lt;br /&gt;
	202.116.96.0/255.255.224.0 （北）&lt;br /&gt;
	125.217.160.0/255.255.240.0 （南）&lt;br /&gt;
	222.200.160.0/255.255.224.0 （东）&lt;br /&gt;
	211.66.128.0/255.255.240.0 （珠海）&lt;br /&gt;
	219.222.192.0/255.255.240.0 （南）&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	natip地址，不分校区&lt;br /&gt;
	121.33.190.128/255.255.255.192&lt;br /&gt;
	59.41.70.160/255.255.255.224&lt;br /&gt;
	113.108.133.32/255.255.255.224&lt;br /&gt;
	61.144.54.32/255.255.255.224&lt;br /&gt;
	218.19.175.224/255.255.255.224&lt;/div&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2012/01/11/switch-Security.html&quot;&gt;CCIE试验备考之交换Security&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/03/9/tcp.html&quot;&gt;TCP: SYN ACK FIN RST PSH URG 详解&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/11/22/sysu-nat.html&quot;&gt;http://blog.hi-suke.com/2011/11/22/sysu-nat.html&lt;/a&gt;&lt;/p&gt;</content><author xmlns="http://www.w3.org/2005/Atom"><name>vision4fun</name></author><content:encoded>&lt;p&gt;
	校内ip：&lt;/p&gt;
&lt;div&gt;
	192.168.0.0/16 （南）&lt;br /&gt;
	172.16.0.0/16 （珠海）&lt;br /&gt;
	172.18.0.0/16 （东）&lt;br /&gt;
	172.31.0.0/16 （北）&lt;br /&gt;
	202.116.64.0/255.255.224.0 （南）&lt;br /&gt;
	202.116.96.0/255.255.224.0 （北）&lt;br /&gt;
	125.217.160.0/255.255.240.0 （南）&lt;br /&gt;
	222.200.160.0/255.255.224.0 （东）&lt;br /&gt;
	211.66.128.0/255.255.240.0 （珠海）&lt;br /&gt;
	219.222.192.0/255.255.240.0 （南）&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	natip地址，不分校区&lt;br /&gt;
	121.33.190.128/255.255.255.192&lt;br /&gt;
	59.41.70.160/255.255.255.224&lt;br /&gt;
	113.108.133.32/255.255.255.224&lt;br /&gt;
	61.144.54.32/255.255.255.224&lt;br /&gt;
	218.19.175.224/255.255.255.224&lt;/div&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2012/01/11/switch-Security.html&quot;&gt;CCIE试验备考之交换Security&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/03/9/tcp.html&quot;&gt;TCP: SYN ACK FIN RST PSH URG 详解&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/11/22/sysu-nat.html&quot;&gt;http://blog.hi-suke.com/2011/11/22/sysu-nat.html&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/608636255/visionblog/feedsky/s.gif?r=http://blog.hi-suke.com/2011/11/22/sysu-nat.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><pubDate>Tue, 22 Nov 2011 10:46:37 +0800</pubDate><guid isPermaLink="false">http://blog.hi-suke.com/entry/sysu-nat</guid><dc:creator>vision4fun</dc:creator><fs:srclink>http://blog.hi-suke.com/2011/11/22/sysu-nat.html</fs:srclink><fs:srcfeed>http://blog.hi-suke.com/feed</fs:srcfeed><fs:itemid>feedsky/visionblog/~8885042/608636255/5398154</fs:itemid></item><item><title>[zz]让你提升命令行效率的Bash快捷键</title><link>http://blog.hi-suke.com/2011/11/15/bash-shortcuts.html</link><id xmlns="http://www.w3.org/2005/Atom">http://blog.hi-suke.com/entry/bash-shortcuts</id><content xmlns="http://www.w3.org/2005/Atom" type="html">&lt;p&gt;
	原帖地址：&lt;a href=&quot;http://linuxtoy.org/archives/bash-shortcuts.html&quot;&gt;http://linuxtoy.org/archives/bash-shortcuts.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
	编辑命令&lt;/p&gt;
&lt;p&gt;
	Ctrl + a ：移到命令行首&lt;br /&gt;
	Ctrl + e ：移到命令行尾&lt;br /&gt;
	Ctrl + f ：按字符前移（右向）&lt;br /&gt;
	Ctrl + b ：按字符后移（左向）&lt;br /&gt;
	Alt + f ：按单词前移（右向）&lt;br /&gt;
	Alt + b ：按单词后移（左向）&lt;br /&gt;
	Ctrl + xx：在命令行首和光标之间移动&lt;br /&gt;
	Ctrl + u ：从光标处删除至命令行首&lt;br /&gt;
	Ctrl + k ：从光标处删除至命令行尾&lt;br /&gt;
	Ctrl + w ：从光标处删除至字首&lt;br /&gt;
	Alt + d ：从光标处删除至字尾&lt;br /&gt;
	Ctrl + d ：删除光标处的字符&lt;br /&gt;
	Ctrl + h ：删除光标前的字符&lt;br /&gt;
	Ctrl + y ：粘贴至光标后&lt;br /&gt;
	Alt + c ：从光标处更改为首字母大写的单词&lt;br /&gt;
	Alt + u ：从光标处更改为全部大写的单词&lt;br /&gt;
	Alt + l ：从光标处更改为全部小写的单词&lt;br /&gt;
	Ctrl + t ：交换光标处和之前的字符&lt;br /&gt;
	Alt + t ：交换光标处和之前的单词&lt;br /&gt;
	Alt + Backspace：与 Ctrl + w 相同类似，分隔符有些差别 [感谢 rezilla 指正]&lt;br /&gt;
	重新执行命令&lt;/p&gt;
&lt;p&gt;
	Ctrl + r：逆向搜索命令历史&lt;br /&gt;
	Ctrl + g：从历史搜索模式退出&lt;br /&gt;
	Ctrl + p：历史中的上一条命令&lt;br /&gt;
	Ctrl + n：历史中的下一条命令&lt;br /&gt;
	Alt + .：使用上一条命令的最后一个参数&lt;br /&gt;
	控制命令&lt;/p&gt;
&lt;p&gt;
	Ctrl + l：清屏&lt;br /&gt;
	Ctrl + o：执行当前命令，并选择上一条命令&lt;br /&gt;
	Ctrl + s：阻止屏幕输出&lt;br /&gt;
	Ctrl + q：允许屏幕输出&lt;br /&gt;
	Ctrl + c：终止命令&lt;br /&gt;
	Ctrl + z：挂起命令&lt;br /&gt;
	Bang (!) 命令&lt;/p&gt;
&lt;p&gt;
	!!：执行上一条命令&lt;br /&gt;
	!blah：执行最近的以 blah 开头的命令，如 !ls&lt;br /&gt;
	!blah:p：仅打印输出，而不执行&lt;br /&gt;
	!$：上一条命令的最后一个参数，与 Alt + . 相同&lt;br /&gt;
	!$:p：打印输出 !$ 的内容&lt;br /&gt;
	!*：上一条命令的所有参数&lt;br /&gt;
	!*:p：打印输出 !* 的内容&lt;br /&gt;
	^blah：删除上一条命令中的 blah&lt;br /&gt;
	^blah^foo：将上一条命令中的 blah 替换为 foo&lt;br /&gt;
	^blah^foo^：将上一条命令中所有的 blah 都替换为 foo&lt;/p&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/11/23/linux-daemon.html&quot;&gt;Linux 技巧：让进程在后台可靠运行的几种方法&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/09/28/vim-level.html&quot;&gt;[zz]简明Vim练级攻略&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/06/13/terminator.html&quot;&gt;[zz]Terminator学习小记&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/03/18/gentoo-update.html&quot;&gt;Gentoo Emerge World&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/02/24/linux-clear.html&quot;&gt;linux入侵踪迹隐藏攻略&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/11/15/bash-shortcuts.html&quot;&gt;http://blog.hi-suke.com/2011/11/15/bash-shortcuts.html&lt;/a&gt;&lt;/p&gt;</content><author xmlns="http://www.w3.org/2005/Atom"><name>vision4fun</name></author><content:encoded>&lt;p&gt;
	原帖地址：&lt;a href=&quot;http://linuxtoy.org/archives/bash-shortcuts.html&quot;&gt;http://linuxtoy.org/archives/bash-shortcuts.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
	编辑命令&lt;/p&gt;
&lt;p&gt;
	Ctrl + a ：移到命令行首&lt;br /&gt;
	Ctrl + e ：移到命令行尾&lt;br /&gt;
	Ctrl + f ：按字符前移（右向）&lt;br /&gt;
	Ctrl + b ：按字符后移（左向）&lt;br /&gt;
	Alt + f ：按单词前移（右向）&lt;br /&gt;
	Alt + b ：按单词后移（左向）&lt;br /&gt;
	Ctrl + xx：在命令行首和光标之间移动&lt;br /&gt;
	Ctrl + u ：从光标处删除至命令行首&lt;br /&gt;
	Ctrl + k ：从光标处删除至命令行尾&lt;br /&gt;
	Ctrl + w ：从光标处删除至字首&lt;br /&gt;
	Alt + d ：从光标处删除至字尾&lt;br /&gt;
	Ctrl + d ：删除光标处的字符&lt;br /&gt;
	Ctrl + h ：删除光标前的字符&lt;br /&gt;
	Ctrl + y ：粘贴至光标后&lt;br /&gt;
	Alt + c ：从光标处更改为首字母大写的单词&lt;br /&gt;
	Alt + u ：从光标处更改为全部大写的单词&lt;br /&gt;
	Alt + l ：从光标处更改为全部小写的单词&lt;br /&gt;
	Ctrl + t ：交换光标处和之前的字符&lt;br /&gt;
	Alt + t ：交换光标处和之前的单词&lt;br /&gt;
	Alt + Backspace：与 Ctrl + w 相同类似，分隔符有些差别 [感谢 rezilla 指正]&lt;br /&gt;
	重新执行命令&lt;/p&gt;
&lt;p&gt;
	Ctrl + r：逆向搜索命令历史&lt;br /&gt;
	Ctrl + g：从历史搜索模式退出&lt;br /&gt;
	Ctrl + p：历史中的上一条命令&lt;br /&gt;
	Ctrl + n：历史中的下一条命令&lt;br /&gt;
	Alt + .：使用上一条命令的最后一个参数&lt;br /&gt;
	控制命令&lt;/p&gt;
&lt;p&gt;
	Ctrl + l：清屏&lt;br /&gt;
	Ctrl + o：执行当前命令，并选择上一条命令&lt;br /&gt;
	Ctrl + s：阻止屏幕输出&lt;br /&gt;
	Ctrl + q：允许屏幕输出&lt;br /&gt;
	Ctrl + c：终止命令&lt;br /&gt;
	Ctrl + z：挂起命令&lt;br /&gt;
	Bang (!) 命令&lt;/p&gt;
&lt;p&gt;
	!!：执行上一条命令&lt;br /&gt;
	!blah：执行最近的以 blah 开头的命令，如 !ls&lt;br /&gt;
	!blah:p：仅打印输出，而不执行&lt;br /&gt;
	!$：上一条命令的最后一个参数，与 Alt + . 相同&lt;br /&gt;
	!$:p：打印输出 !$ 的内容&lt;br /&gt;
	!*：上一条命令的所有参数&lt;br /&gt;
	!*:p：打印输出 !* 的内容&lt;br /&gt;
	^blah：删除上一条命令中的 blah&lt;br /&gt;
	^blah^foo：将上一条命令中的 blah 替换为 foo&lt;br /&gt;
	^blah^foo^：将上一条命令中所有的 blah 都替换为 foo&lt;/p&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/11/23/linux-daemon.html&quot;&gt;Linux 技巧：让进程在后台可靠运行的几种方法&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/09/28/vim-level.html&quot;&gt;[zz]简明Vim练级攻略&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/06/13/terminator.html&quot;&gt;[zz]Terminator学习小记&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/03/18/gentoo-update.html&quot;&gt;Gentoo Emerge World&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/02/24/linux-clear.html&quot;&gt;linux入侵踪迹隐藏攻略&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/11/15/bash-shortcuts.html&quot;&gt;http://blog.hi-suke.com/2011/11/15/bash-shortcuts.html&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/608636256/visionblog/feedsky/s.gif?r=http://blog.hi-suke.com/2011/11/15/bash-shortcuts.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><pubDate>Tue, 15 Nov 2011 09:59:30 +0800</pubDate><guid isPermaLink="false">http://blog.hi-suke.com/entry/bash-shortcuts</guid><dc:creator>vision4fun</dc:creator><fs:srclink>http://blog.hi-suke.com/2011/11/15/bash-shortcuts.html</fs:srclink><fs:srcfeed>http://blog.hi-suke.com/feed</fs:srcfeed><fs:itemid>feedsky/visionblog/~8885042/608636256/5398154</fs:itemid></item><item><title>[zz]简明Vim练级攻略</title><link>http://blog.hi-suke.com/2011/09/28/vim-level.html</link><id xmlns="http://www.w3.org/2005/Atom">http://blog.hi-suke.com/entry/vim-level</id><content xmlns="http://www.w3.org/2005/Atom" type="html">&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	原文地址：&lt;a href=&quot;http://coolshell.cn/articles/5426.html&quot;&gt;http://coolshell.cn/articles/5426.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	你想以最快的速度学习人类史上最好的文本编辑器VIM吗？你先得懂得如何在VIM幸存下来，然后一点一点地学习各种戏法。&lt;/p&gt;
&lt;p&gt;
	&lt;a href=&quot;http://www.vim.org/&quot;&gt;Vim&lt;/a&gt;&amp;nbsp;the Six Billion Dollar editor&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
		Better, Stronger, Faster.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	学习&amp;nbsp;&lt;a href=&quot;http://www.vim.org/&quot;&gt;vim&lt;/a&gt;&amp;nbsp;并且其会成为你最后一个使用的文本编辑器。没有比这个更好的文本编辑器了，非常地难学，但是却不可思议地好用。&lt;/p&gt;
&lt;p&gt;
	我建议下面这四个步骤：&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;
		存活&lt;/li&gt;
	&lt;li&gt;
		感觉良好&lt;/li&gt;
	&lt;li&gt;
		觉得更好，更强，更快&lt;/li&gt;
	&lt;li&gt;
		使用VIM的超能力&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
	当你走完这篇文章，你会成为一个vim的 superstar。&lt;/p&gt;
&lt;p&gt;
	在开始学习以前，我需要给你一些警告：&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		学习vim在开始时是痛苦的。&lt;/li&gt;
	&lt;li&gt;
		需要时间&lt;/li&gt;
	&lt;li&gt;
		需要不断地练习，就像你学习一个乐器一样。&lt;/li&gt;
	&lt;li&gt;
		不要期望你能在3天内把vim练得比别的编辑器更有效率。&lt;/li&gt;
	&lt;li&gt;
		事实上，你需要2周时间的苦练，而不是3天。&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;h4&gt;
	第一级 &amp;ndash; 存活&lt;/h4&gt;
&lt;ol&gt;
	&lt;li&gt;
		安装&amp;nbsp;&lt;a href=&quot;http://www.vim.org/&quot;&gt;vim&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;
		启动 vim&lt;/li&gt;
	&lt;li&gt;
		什么也别干！请先阅读&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
	当你安装好一个编辑器后，你一定会想在其中输入点什么东西，然后看看这个编辑器是什么样子。但vim不是这样的，请按照下面的命令操作：&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		启 动Vim后，vim在&amp;nbsp;Normal&amp;nbsp;模式下。&lt;/li&gt;
	&lt;li&gt;
		让我们进入&amp;nbsp;Insert&amp;nbsp;模式，请按下键 i 。(陈皓注：你会看到vim左下角有一个&amp;ndash;insert&amp;ndash;字样，表示，你可以以插入的方式输入了）&lt;/li&gt;
	&lt;li&gt;
		此时，你可以输入文本了，就像你用&amp;ldquo;记事本&amp;rdquo;一样。&lt;/li&gt;
	&lt;li&gt;
		如果你想返回&amp;nbsp;Normal&amp;nbsp;模式，请按&amp;nbsp;ESC&amp;nbsp;键。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	现在，你知道如何在&amp;nbsp;Insert&amp;nbsp;和&amp;nbsp;Normal&amp;nbsp;模式下切换了。下面是一些命令，可以让你在&amp;nbsp;Normal&amp;nbsp;模式下幸存下来：&lt;/p&gt;
&lt;blockquote&gt;
	&lt;ul&gt;
		&lt;li&gt;
			i&amp;nbsp;&amp;rarr;&amp;nbsp;Insert&amp;nbsp;模式，按&amp;nbsp;ESC&amp;nbsp;回到&amp;nbsp;Normal&amp;nbsp;模式.&lt;/li&gt;
		&lt;li&gt;
			x&amp;nbsp;&amp;rarr; 删当前光标所在的一个字符。&lt;/li&gt;
		&lt;li&gt;
			:wq&amp;nbsp;&amp;rarr; 存盘 + 退出 (:w&amp;nbsp;存盘,&amp;nbsp;:q&amp;nbsp;退出) &amp;nbsp; （陈皓注：:w 后可以跟文件名）&lt;/li&gt;
		&lt;li&gt;
			dd&amp;nbsp;&amp;rarr; 删除当前行，并把删除的行存到剪贴板里&lt;/li&gt;
		&lt;li&gt;
			p&amp;nbsp;&amp;rarr; 粘贴剪贴板&lt;/li&gt;
	&lt;/ul&gt;
	&lt;p&gt;
		推荐:&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;
			hjkl&amp;nbsp;(强例推荐使用其移动光标，但不必需) &amp;rarr;你也可以使用光标键 (&amp;larr;&amp;darr;&amp;uarr;&amp;rarr;). 注:&amp;nbsp;j&amp;nbsp;就像下箭头。&lt;/li&gt;
		&lt;li&gt;
			:help &amp;lt;command&amp;gt;&amp;nbsp;&amp;rarr; 显示相关命令的帮助。你也可以就输入&amp;nbsp;:help&amp;nbsp;而不跟命令。（陈皓注：退出帮助需要输入:q）&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	你能在vim幸存下来只需要上述的那5个命令，你就可以编辑文本了，你一定要把这些命令练成一种下意识的状态。于是你就可以开始进阶到第二级了。&lt;/p&gt;
&lt;p&gt;
	当是，在你进入第二级时，需要再说一下&amp;nbsp;Normal&amp;nbsp;模式。在一般的编辑器下，当你需要copy一段文字的时候，你需要使用&amp;nbsp;Ctrl&amp;nbsp;键，比如：Ctrl-C。也就是说，Ctrl键就好像功能键一样，当你按下了功能键Ctrl后，C就不在是C了，而且就是一个命令或是一个快键键了，在VIM的Normal模式下，所有的键就是功能键了。这个你需要知道。&lt;/p&gt;
&lt;p&gt;
	标记:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		下面的文字中，如果是&amp;nbsp;Ctrl-&amp;lambda;我会写成&amp;nbsp;&amp;lt;C-&amp;lambda;&amp;gt;.&lt;/li&gt;
	&lt;li&gt;
		以&amp;nbsp;:&amp;nbsp;开始的命令你需要输入&amp;nbsp;&amp;lt;enter&amp;gt;回车，例如 &amp;mdash; 如果我写成&amp;nbsp;:q&amp;nbsp;也就是说你要输入&amp;nbsp;:q&amp;lt;enter&amp;gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;nd-level----feel-comfortable&quot;&gt;
	第二级 &amp;ndash; 感觉良好&lt;/h4&gt;
&lt;p&gt;
	上面的那些命令只能让你存活下来，现在是时候学习一些更多的命令了，下面是我的建议：（陈皓注：所有的命令都需要在Normal模式下使用，如果你不知道现在在什么样的模式，你就狂按几次ESC键）&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;
		各种插入模式&lt;br /&gt;
		&lt;blockquote&gt;
			&lt;ul&gt;
				&lt;li&gt;
					a&amp;nbsp;&amp;rarr; 在光标后插入&lt;/li&gt;
				&lt;li&gt;
					o&amp;nbsp;&amp;rarr; 在当前行后插入一个新行&lt;/li&gt;
				&lt;li&gt;
					O&amp;nbsp;&amp;rarr; 在当前行前插入一个新行&lt;/li&gt;
				&lt;li&gt;
					cw&amp;nbsp;&amp;rarr; 替换从光标所在位置后到一个单词结尾的字符&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/blockquote&gt;
	&lt;/li&gt;
	&lt;li&gt;
		简单的移动光标&lt;br /&gt;
		&lt;blockquote&gt;
			&lt;ul&gt;
				&lt;li&gt;
					0&amp;nbsp;&amp;rarr; 数字零，到行头&lt;/li&gt;
				&lt;li&gt;
					^&amp;nbsp;&amp;rarr; 到本行第一个不是blank字符的位置（所谓blank字符就是空格，tab，换行，回车等）&lt;/li&gt;
				&lt;li&gt;
					$&amp;nbsp;&amp;rarr; 到本行行尾&lt;/li&gt;
				&lt;li&gt;
					g_&amp;nbsp;&amp;rarr; 到本行最后一个不是blank字符的位置。&lt;/li&gt;
				&lt;li&gt;
					/pattern&amp;nbsp;&amp;rarr; 搜索&amp;nbsp;pattern&amp;nbsp;的字符串（陈皓注：如果搜索出多个匹配，可按n键到下一个）&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/blockquote&gt;
	&lt;/li&gt;
	&lt;li&gt;
		拷贝/粘贴&amp;nbsp;（陈皓注：p/P都可以，p是表示在当前位置之后，P表示在当前位置之前）&lt;br /&gt;
		&lt;blockquote&gt;
			&lt;ul&gt;
				&lt;li&gt;
					P&amp;nbsp;&amp;rarr; 粘贴&lt;/li&gt;
				&lt;li&gt;
					yy&amp;nbsp;&amp;rarr; 拷贝当前行当行于&amp;nbsp;ddP&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/blockquote&gt;
	&lt;/li&gt;
	&lt;li&gt;
		Undo/Redo&lt;br /&gt;
		&lt;blockquote&gt;
			&lt;ul&gt;
				&lt;li&gt;
					u&amp;nbsp;&amp;rarr; undo&lt;/li&gt;
				&lt;li&gt;
					&amp;lt;C-r&amp;gt;&amp;nbsp;&amp;rarr; redo&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/blockquote&gt;
	&lt;/li&gt;
	&lt;li&gt;
		打开/保存/退出/改变文件(Buffer)&lt;br /&gt;
		&lt;blockquote&gt;
			&lt;ul&gt;
				&lt;li&gt;
					:e &amp;lt;path/to/file&amp;gt;&amp;nbsp;&amp;rarr; 打开一个文件&lt;/li&gt;
				&lt;li&gt;
					:w&amp;nbsp;&amp;rarr; 存盘&lt;/li&gt;
				&lt;li&gt;
					:saveas &amp;lt;path/to/file&amp;gt;&amp;nbsp;&amp;rarr; 另存为&amp;nbsp;&amp;lt;path/to/file&amp;gt;&lt;/li&gt;
				&lt;li&gt;
					:x，&amp;nbsp;ZZ&amp;nbsp;或&amp;nbsp;:wq&amp;nbsp;&amp;rarr; 保存并退出 (:x&amp;nbsp;表示仅在需要时保存，ZZ不需要输入冒号并回车)&lt;/li&gt;
				&lt;li&gt;
					:q!&amp;nbsp;&amp;rarr; 退出不保存&amp;nbsp;:qa!&amp;nbsp;强行退出所有的正在编辑的文件，就算别的文件有更改。&lt;/li&gt;
				&lt;li&gt;
					:bn&amp;nbsp;和&amp;nbsp;:bp&amp;nbsp;&amp;rarr; 你可以同时打开很多文件，使用这两个命令来切换下一个或上一个文件。（陈皓注：我喜欢使用:n到下一个文件）&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/blockquote&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
	花点时间熟悉一下上面的命令，一旦你掌握他们了，你就几乎可以干其它编辑器都能干的事了。但是到现在为止，你还是觉得使用vim还是有点笨拙，不过没关系，你可以进阶到第三级了。&lt;/p&gt;
&lt;h4 id=&quot;rd-level----better-stronger-faster&quot;&gt;
	第三级&amp;nbsp;&amp;ndash; 更好，更强，更快&lt;/h4&gt;
&lt;p&gt;
	先恭喜你！你干的很不错。我们可以开始一些更为有趣的事了。在第三级，我们只谈那些和vi可以兼容的命令。&lt;/p&gt;
&lt;h5 id=&quot;better&quot;&gt;
	更好&lt;/h5&gt;
&lt;p&gt;
	下面，让我们看一下vim是怎么重复自己的：&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;
		.&amp;nbsp;&amp;rarr; (小数点) 可以重复上一次的命令&lt;/li&gt;
	&lt;li&gt;
		N&amp;lt;command&amp;gt; &amp;rarr; 重复某个命令N次&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
	下面是一个示例，找开一个文件你可以试试下面的命令：&lt;/p&gt;
&lt;blockquote&gt;
	&lt;ul&gt;
		&lt;li&gt;
			2dd&amp;nbsp;&amp;rarr; 删除2行&lt;/li&gt;
		&lt;li&gt;
			3p&amp;nbsp;&amp;rarr; 粘贴文本3次&lt;/li&gt;
		&lt;li&gt;
			100idesu [ESC]&amp;nbsp;&amp;rarr; 会写下 &amp;ldquo;desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu &amp;ldquo;&lt;/li&gt;
		&lt;li&gt;
			.&amp;nbsp;&amp;rarr; 重复上一个命令&amp;mdash;&amp;mdash; 100 &amp;ldquo;desu &amp;ldquo;.&lt;/li&gt;
		&lt;li&gt;
			3.&amp;nbsp;&amp;rarr; 重复 3 次 &amp;ldquo;desu&amp;rdquo; (注意：不是 300，你看，VIM多聪明啊).&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h5 id=&quot;stronger&quot;&gt;
	更强&lt;/h5&gt;
&lt;p&gt;
	你要让你的光标移动更有效率，你一定要了解下面的这些命令，千万别跳过。&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;
		NG&amp;nbsp;&amp;rarr; 到第 N 行 （陈皓注：注意命令中的G是大写的，另我一般使用 : N 到第N行，如 :137 到第137行）&lt;/li&gt;
	&lt;li&gt;
		gg&amp;nbsp;&amp;rarr; 到第一行。（陈皓注：相当于1G，或 :1）&lt;/li&gt;
	&lt;li&gt;
		G&amp;nbsp;&amp;rarr; 到最后一行。&lt;/li&gt;
	&lt;li&gt;
		按单词移动：&lt;br /&gt;
		&lt;blockquote&gt;
			&lt;ol&gt;
				&lt;li&gt;
					w&amp;nbsp;&amp;rarr; 到下一个单词的开头。&lt;/li&gt;
				&lt;li&gt;
					e&amp;nbsp;&amp;rarr; 到下一个单词的结尾。&lt;/li&gt;
			&lt;/ol&gt;
			&lt;p&gt;
				&amp;gt; 如果你认为单词是由默认方式，那么就用小写的e和w。默认上来说，一个单词由字母，数字和下划线组成（陈皓注：程序变量）&lt;/p&gt;
			&lt;p&gt;
				&amp;gt; 如果你认为单词是由blank字符分隔符，那么你需要使用大写的E和W。（陈皓注：程序语句）&lt;/p&gt;
			&lt;p&gt;
				&lt;img alt=&quot;Word moves example&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/word_moves.jpg&quot; /&gt;&lt;/p&gt;
		&lt;/blockquote&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
	下面，让我来说说最强的光标移动：&lt;/p&gt;
&lt;blockquote&gt;
	&lt;ul&gt;
		&lt;li&gt;
			%&amp;nbsp;: 匹配括号移动，包括&amp;nbsp;(,&amp;nbsp;{,&amp;nbsp;[. （陈皓注：你需要把光标先移到括号上）&lt;/li&gt;
		&lt;li&gt;
			*&amp;nbsp;和&amp;nbsp;#: &amp;nbsp;匹配光标当前所在的单词，移动光标到下一个（或上一个）匹配单词（*是下一个，#是上一个）&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	相信我，上面这三个命令对程序员来说是相当强大的。&lt;/p&gt;
&lt;h5 id=&quot;faster&quot;&gt;
	更快&lt;/h5&gt;
&lt;p&gt;
	你一定要记住光标的移动，因为很多命令都可以和这些移动光标的命令连动。很多命令都可以如下来干：&lt;/p&gt;
&lt;p&gt;
	&amp;lt;start position&amp;gt;&amp;lt;command&amp;gt;&amp;lt;end position&amp;gt;&lt;/p&gt;
&lt;p&gt;
	例如&amp;nbsp;0y$&amp;nbsp;命令意味着：&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		0&amp;nbsp;&amp;rarr; 先到行头&lt;/li&gt;
	&lt;li&gt;
		y&amp;nbsp;&amp;rarr; 从这里开始拷贝&lt;/li&gt;
	&lt;li&gt;
		$&amp;nbsp;&amp;rarr; 拷贝到本行最后一个字符&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	你可可以输入&amp;nbsp;ye，从当前位置拷贝到本单词的最后一个字符。&lt;/p&gt;
&lt;p&gt;
	你也可以输入&amp;nbsp;y2/foo&amp;nbsp;来拷贝2个 &amp;ldquo;foo&amp;rdquo; 之间的字符串。&lt;/p&gt;
&lt;p&gt;
	还有很多时间并不一定你就一定要按y才会拷贝，下面的命令也会被拷贝：&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		d&amp;nbsp;(删除 )&lt;/li&gt;
	&lt;li&gt;
		v&amp;nbsp;(可视化的选择)&lt;/li&gt;
	&lt;li&gt;
		gU&amp;nbsp;(变大写)&lt;/li&gt;
	&lt;li&gt;
		gu&amp;nbsp;(变小写)&lt;/li&gt;
	&lt;li&gt;
		等等&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
	（陈皓注：可视化选择是一个很有意思的命令，你可以先按v，然后移动光标，你就会看到文本被选择，然后，你可能d，也可y，也可以变大写等）&lt;/div&gt;
&lt;h4 id=&quot;th-level----vim-superpowers&quot;&gt;
	第四级 &amp;ndash; Vim 超能力&lt;/h4&gt;
&lt;p&gt;
	你只需要掌握前面的命令，你就可以很舒服的使用VIM了。但是，现在，我们向你介绍的是VIM杀手级的功能。下面这些功能是我只用vim的原因。&lt;/p&gt;
&lt;h5 id=&quot;move-on-current-line-0---f-f-t-t--&quot;&gt;
	在当前行上移动光标:&amp;nbsp;0&amp;nbsp;^&amp;nbsp;$&amp;nbsp;f&amp;nbsp;F&amp;nbsp;t&amp;nbsp;T&amp;nbsp;,&amp;nbsp;;&lt;/h5&gt;
&lt;blockquote&gt;
	&lt;ul&gt;
		&lt;li&gt;
			0&amp;nbsp;&amp;rarr; 到行头&lt;/li&gt;
		&lt;li&gt;
			^&amp;nbsp;&amp;rarr; 到本行的第一个非blank字符&lt;/li&gt;
		&lt;li&gt;
			$&amp;nbsp;&amp;rarr; 到行尾&lt;/li&gt;
		&lt;li&gt;
			g_&amp;nbsp;&amp;rarr; 到本行最后一个不是blank字符的位置。&lt;/li&gt;
		&lt;li&gt;
			fa&amp;nbsp;&amp;rarr; 到下一个为a的字符处，你也可以fs到下一个为s的字符。&lt;/li&gt;
		&lt;li&gt;
			t,&amp;nbsp;&amp;rarr; 到逗号前的第一个字符。逗号可以变成其它字符。&lt;/li&gt;
		&lt;li&gt;
			3fa&amp;nbsp;&amp;rarr; 在当前行查找第三个出现的a。&lt;/li&gt;
		&lt;li&gt;
			F&amp;nbsp;和&amp;nbsp;T&amp;nbsp;&amp;rarr; 和&amp;nbsp;f&amp;nbsp;和&amp;nbsp;t&amp;nbsp;一样，只不过是相反方向。&lt;br /&gt;
			&lt;img alt=&quot;Line moves&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/line_moves.jpg&quot; /&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	还有一个很有用的命令是&amp;nbsp;dt&amp;quot;&amp;nbsp;&amp;rarr; 删除所有的内容，直到遇到双引号&amp;mdash;&amp;mdash;&amp;nbsp;&amp;quot;。&lt;/p&gt;
&lt;h5 id=&quot;zone-selection-actionaobject-or-actioniobject&quot;&gt;
	区域选择&amp;nbsp;&amp;lt;action&amp;gt;a&amp;lt;object&amp;gt;&amp;nbsp;或&amp;nbsp;&amp;lt;action&amp;gt;i&amp;lt;object&amp;gt;&lt;/h5&gt;
&lt;p&gt;
	在visual 模式下，这些命令很强大，其命令格式为&lt;/p&gt;
&lt;p&gt;
	&amp;lt;action&amp;gt;a&amp;lt;object&amp;gt;&amp;nbsp;和&amp;nbsp;&amp;lt;action&amp;gt;i&amp;lt;object&amp;gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		action可以是任何的命令，如&amp;nbsp;d&amp;nbsp;(删除),&amp;nbsp;y&amp;nbsp;(拷贝),&amp;nbsp;v&amp;nbsp;(可以视模式选择)。&lt;/li&gt;
	&lt;li&gt;
		object 可能是：&amp;nbsp;w&amp;nbsp;一个单词，&amp;nbsp;W&amp;nbsp;一个以空格为分隔的单词，&amp;nbsp;s&amp;nbsp;一个句字，&amp;nbsp;p&amp;nbsp;一个段落。也可以是一个特别的字符：&amp;quot;、&amp;nbsp;&amp;#39;、&amp;nbsp;)、&amp;nbsp;}、&amp;nbsp;]。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	假设你有一个字符串&amp;nbsp;(map (+) (&amp;quot;foo&amp;quot;)).而光标键在第一个&amp;nbsp;o&amp;nbsp;的位置。&lt;/p&gt;
&lt;blockquote&gt;
	&lt;ul&gt;
		&lt;li&gt;
			vi&amp;quot;&amp;nbsp;&amp;rarr; 会选择&amp;nbsp;foo.&lt;/li&gt;
		&lt;li&gt;
			va&amp;quot;&amp;nbsp;&amp;rarr; 会选择&amp;nbsp;&amp;quot;foo&amp;quot;.&lt;/li&gt;
		&lt;li&gt;
			vi)&amp;nbsp;&amp;rarr; 会选择&amp;nbsp;&amp;quot;foo&amp;quot;.&lt;/li&gt;
		&lt;li&gt;
			va)&amp;nbsp;&amp;rarr; 会选择(&amp;quot;foo&amp;quot;).&lt;/li&gt;
		&lt;li&gt;
			v2i)&amp;nbsp;&amp;rarr; 会选择&amp;nbsp;map (+) (&amp;quot;foo&amp;quot;)&lt;/li&gt;
		&lt;li&gt;
			v2a)&amp;nbsp;&amp;rarr; 会选择&amp;nbsp;(map (+) (&amp;quot;foo&amp;quot;))&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	&lt;img alt=&quot;Text objects selection&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/textobjects.png&quot; /&gt;&lt;/p&gt;
&lt;h5 id=&quot;select-rectangular-blocks-c-v&quot;&gt;
	块操作:&amp;nbsp;&amp;lt;C-v&amp;gt;&lt;/h5&gt;
&lt;p&gt;
	块操作，典型的操作：&amp;nbsp;0 &amp;lt;C-v&amp;gt; &amp;lt;C-d&amp;gt; I-- [ESC]&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		^&amp;nbsp;&amp;rarr; 到行头&lt;/li&gt;
	&lt;li&gt;
		&amp;lt;C-v&amp;gt;&amp;nbsp;&amp;rarr; 开始块操作&lt;/li&gt;
	&lt;li&gt;
		&amp;lt;C-d&amp;gt;&amp;nbsp;&amp;rarr; 向下移动 (你也可以使用hjkl来移动光标，或是使用%，或是别的)&lt;/li&gt;
	&lt;li&gt;
		I-- [ESC]&amp;nbsp;&amp;rarr; I是插入，插入&amp;ldquo;--&amp;rdquo;，按ESC键来为每一行生效。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	&lt;img alt=&quot;Rectangular blocks&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/rectangular-blocks.gif&quot; /&gt;&lt;/p&gt;
&lt;p&gt;
	在Windows下的vim，你需要使用&amp;nbsp;&amp;lt;C-q&amp;gt;&amp;nbsp;而不是&amp;nbsp;&amp;lt;C-v&amp;gt;&amp;nbsp;，&amp;lt;C-v&amp;gt;&amp;nbsp;是拷贝剪贴板。&lt;/p&gt;
&lt;h5 id=&quot;completion-c-n-and-c-p&quot;&gt;
	自动提示：&amp;nbsp;&amp;lt;C-n&amp;gt;&amp;nbsp;和&amp;nbsp;&amp;lt;C-p&amp;gt;&lt;/h5&gt;
&lt;p&gt;
	在 Insert 模式下，你可以输入一个词的开头，然后按&amp;nbsp;&amp;lt;C-p&amp;gt;或是&amp;lt;C-n&amp;gt;，自动补齐功能就出现了&amp;hellip;&amp;hellip;&lt;/p&gt;
&lt;p&gt;
	&lt;img alt=&quot;Completion&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/completion.gif&quot; /&gt;&lt;/p&gt;
&lt;h5 id=&quot;macros--qa-do-something-q-a-&quot;&gt;
	宏录制：&amp;nbsp;qa&amp;nbsp;操作序列&amp;nbsp;q,&amp;nbsp;@a,&amp;nbsp;@@&lt;/h5&gt;
&lt;ul&gt;
	&lt;li&gt;
		qa&amp;nbsp;把你的操作记录在寄存器&amp;nbsp;a。&lt;/li&gt;
	&lt;li&gt;
		于是&amp;nbsp;@a&amp;nbsp;会replay被录制的宏。&lt;/li&gt;
	&lt;li&gt;
		@@&amp;nbsp;是一个快捷键用来replay最新录制的宏。&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
	&lt;p&gt;
		示例&lt;/p&gt;
	&lt;p&gt;
		在一个只有一行且这一行只有&amp;ldquo;1&amp;rdquo;的文本中，键入如下命令：&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;
			qaYp&amp;lt;C-a&amp;gt;q&amp;rarr;
			&lt;ul&gt;
				&lt;li&gt;
					qa&amp;nbsp;开始录制&lt;/li&gt;
				&lt;li&gt;
					Yp&amp;nbsp;复制行.&lt;/li&gt;
				&lt;li&gt;
					&amp;lt;C-a&amp;gt;&amp;nbsp;增加1.&lt;/li&gt;
				&lt;li&gt;
					q&amp;nbsp;停止录制.&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li&gt;
			@a&amp;nbsp;&amp;rarr; 在1下面写下 2&lt;/li&gt;
		&lt;li&gt;
			@@&amp;nbsp;&amp;rarr; 在2 正面写下3&lt;/li&gt;
		&lt;li&gt;
			现在做&amp;nbsp;100@@&amp;nbsp;会创建新的100行，并把数据增加到 103.&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	&lt;img alt=&quot;Macros&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/macros.gif&quot; /&gt;&lt;/p&gt;
&lt;h5 id=&quot;visual-selection-vvc-v&quot;&gt;
	可视化选择：&amp;nbsp;v,V,&amp;lt;C-v&amp;gt;&lt;/h5&gt;
&lt;p&gt;
	前面，我们看到了&amp;nbsp;&amp;lt;C-v&amp;gt;的示例 （在Windows下应该是&amp;lt;C-q&amp;gt;），我们可以使用&amp;nbsp;v&amp;nbsp;和&amp;nbsp;V。一但被选好了，你可以做下面的事：&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		J&amp;nbsp;&amp;rarr; 把所有的行连接起来（变成一行）&lt;/li&gt;
	&lt;li&gt;
		&amp;lt;&amp;nbsp;或&amp;nbsp;&amp;gt;&amp;nbsp;&amp;rarr; 左右缩进&lt;/li&gt;
	&lt;li&gt;
		=&amp;nbsp;&amp;rarr; 自动给缩进 （陈皓注：这个功能相当强大，我太喜欢了）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	&lt;img alt=&quot;Autoindent&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/autoindent.gif&quot; /&gt;&lt;/p&gt;
&lt;p&gt;
	在所有被选择的行后加上点东西：&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		&amp;lt;C-v&amp;gt;&lt;/li&gt;
	&lt;li&gt;
		选中相关的行 (可使用&amp;nbsp;j&amp;nbsp;或&amp;nbsp;&amp;lt;C-d&amp;gt;&amp;nbsp;或是&amp;nbsp;/pattern&amp;nbsp;或是&amp;nbsp;%&amp;nbsp;等&amp;hellip;&amp;hellip;)&lt;/li&gt;
	&lt;li&gt;
		$&amp;nbsp;到行最后&lt;/li&gt;
	&lt;li&gt;
		A, 输入字符串，按&amp;nbsp;ESC。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	&lt;img alt=&quot;Append to many lines&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/append-to-many-lines.gif&quot; /&gt;&lt;/p&gt;
&lt;h5 id=&quot;splits-split-and-vsplit&quot;&gt;
	分屏:&amp;nbsp;:split&amp;nbsp;和&amp;nbsp;vsplit.&lt;/h5&gt;
&lt;p&gt;
	下面是主要的命令，你可以使用VIM的帮助&amp;nbsp;:help split. 你可以参考本站以前的一篇文章&lt;a href=&quot;http://coolshell.cn/articles/1679.html&quot; target=&quot;_blank&quot; title=&quot;Vim的分屏功能&quot;&gt;VIM分屏&lt;/a&gt;。&lt;/p&gt;
&lt;blockquote&gt;
	&lt;ul&gt;
		&lt;li&gt;
			:split&amp;nbsp;&amp;rarr; 创建分屏 (:vsplit创建垂直分屏)&lt;/li&gt;
		&lt;li&gt;
			&amp;lt;C-w&amp;gt;&amp;lt;dir&amp;gt;&amp;nbsp;: dir就是方向，可以是&amp;nbsp;hjkl&amp;nbsp;或是 &amp;larr;&amp;darr;&amp;uarr;&amp;rarr; 中的一个，其用来切换分屏。&lt;/li&gt;
		&lt;li&gt;
			&amp;lt;C-w&amp;gt;_&amp;nbsp;(或&amp;nbsp;&amp;lt;C-w&amp;gt;|)&amp;nbsp;: 最大化尺寸 (&amp;lt;C-w&amp;gt;|&amp;nbsp;垂直分屏)&lt;/li&gt;
		&lt;li&gt;
			&amp;lt;C-w&amp;gt;+&amp;nbsp;(或&amp;nbsp;&amp;lt;C-w&amp;gt;-)&amp;nbsp;: 增加尺寸&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	&lt;img alt=&quot;Split&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/split.gif&quot; /&gt;&lt;/p&gt;
&lt;h4 id=&quot;conclusion&quot;&gt;
	结束语&lt;/h4&gt;
&lt;ul&gt;
	&lt;li&gt;
		上面是作者最常用的90%的命令。&lt;/li&gt;
	&lt;li&gt;
		我建议你每天都学1到2个新的命令。&lt;/li&gt;
	&lt;li&gt;
		在两到三周后，你会感到vim的强大的。&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;
		有时候，学习VIM就像是在死背一些东西。&lt;/li&gt;
	&lt;li&gt;
		幸运的是，vim有很多很不错的工具和优秀的文档。&lt;/li&gt;
	&lt;li&gt;
		运行vimtutor直到你熟悉了那些基本命令。&lt;/li&gt;
	&lt;li&gt;
		其在线帮助文档中你应该要仔细阅读的是&amp;nbsp;:help usr_02.txt.&lt;/li&gt;
	&lt;li&gt;
		你会学习到诸如&amp;nbsp;&amp;nbsp;!，&amp;nbsp;目录，寄存器，插件等很多其它的功能。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	学习vim就像学弹钢琴一样，一旦学会，受益无穷。&lt;/p&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/11/23/linux-daemon.html&quot;&gt;Linux 技巧：让进程在后台可靠运行的几种方法&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/11/15/bash-shortcuts.html&quot;&gt;[zz]让你提升命令行效率的Bash快捷键&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/06/13/terminator.html&quot;&gt;[zz]Terminator学习小记&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/03/18/gentoo-update.html&quot;&gt;Gentoo Emerge World&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/02/24/linux-clear.html&quot;&gt;linux入侵踪迹隐藏攻略&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/09/28/vim-level.html&quot;&gt;http://blog.hi-suke.com/2011/09/28/vim-level.html&lt;/a&gt;&lt;/p&gt;</content><author xmlns="http://www.w3.org/2005/Atom"><name>vision4fun</name></author><content:encoded>&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	原文地址：&lt;a href=&quot;http://coolshell.cn/articles/5426.html&quot;&gt;http://coolshell.cn/articles/5426.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	你想以最快的速度学习人类史上最好的文本编辑器VIM吗？你先得懂得如何在VIM幸存下来，然后一点一点地学习各种戏法。&lt;/p&gt;
&lt;p&gt;
	&lt;a href=&quot;http://www.vim.org/&quot;&gt;Vim&lt;/a&gt;&amp;nbsp;the Six Billion Dollar editor&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
		Better, Stronger, Faster.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	学习&amp;nbsp;&lt;a href=&quot;http://www.vim.org/&quot;&gt;vim&lt;/a&gt;&amp;nbsp;并且其会成为你最后一个使用的文本编辑器。没有比这个更好的文本编辑器了，非常地难学，但是却不可思议地好用。&lt;/p&gt;
&lt;p&gt;
	我建议下面这四个步骤：&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;
		存活&lt;/li&gt;
	&lt;li&gt;
		感觉良好&lt;/li&gt;
	&lt;li&gt;
		觉得更好，更强，更快&lt;/li&gt;
	&lt;li&gt;
		使用VIM的超能力&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
	当你走完这篇文章，你会成为一个vim的 superstar。&lt;/p&gt;
&lt;p&gt;
	在开始学习以前，我需要给你一些警告：&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		学习vim在开始时是痛苦的。&lt;/li&gt;
	&lt;li&gt;
		需要时间&lt;/li&gt;
	&lt;li&gt;
		需要不断地练习，就像你学习一个乐器一样。&lt;/li&gt;
	&lt;li&gt;
		不要期望你能在3天内把vim练得比别的编辑器更有效率。&lt;/li&gt;
	&lt;li&gt;
		事实上，你需要2周时间的苦练，而不是3天。&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;h4&gt;
	第一级 &amp;ndash; 存活&lt;/h4&gt;
&lt;ol&gt;
	&lt;li&gt;
		安装&amp;nbsp;&lt;a href=&quot;http://www.vim.org/&quot;&gt;vim&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;
		启动 vim&lt;/li&gt;
	&lt;li&gt;
		什么也别干！请先阅读&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
	当你安装好一个编辑器后，你一定会想在其中输入点什么东西，然后看看这个编辑器是什么样子。但vim不是这样的，请按照下面的命令操作：&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		启 动Vim后，vim在&amp;nbsp;Normal&amp;nbsp;模式下。&lt;/li&gt;
	&lt;li&gt;
		让我们进入&amp;nbsp;Insert&amp;nbsp;模式，请按下键 i 。(陈皓注：你会看到vim左下角有一个&amp;ndash;insert&amp;ndash;字样，表示，你可以以插入的方式输入了）&lt;/li&gt;
	&lt;li&gt;
		此时，你可以输入文本了，就像你用&amp;ldquo;记事本&amp;rdquo;一样。&lt;/li&gt;
	&lt;li&gt;
		如果你想返回&amp;nbsp;Normal&amp;nbsp;模式，请按&amp;nbsp;ESC&amp;nbsp;键。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	现在，你知道如何在&amp;nbsp;Insert&amp;nbsp;和&amp;nbsp;Normal&amp;nbsp;模式下切换了。下面是一些命令，可以让你在&amp;nbsp;Normal&amp;nbsp;模式下幸存下来：&lt;/p&gt;
&lt;blockquote&gt;
	&lt;ul&gt;
		&lt;li&gt;
			i&amp;nbsp;&amp;rarr;&amp;nbsp;Insert&amp;nbsp;模式，按&amp;nbsp;ESC&amp;nbsp;回到&amp;nbsp;Normal&amp;nbsp;模式.&lt;/li&gt;
		&lt;li&gt;
			x&amp;nbsp;&amp;rarr; 删当前光标所在的一个字符。&lt;/li&gt;
		&lt;li&gt;
			:wq&amp;nbsp;&amp;rarr; 存盘 + 退出 (:w&amp;nbsp;存盘,&amp;nbsp;:q&amp;nbsp;退出) &amp;nbsp; （陈皓注：:w 后可以跟文件名）&lt;/li&gt;
		&lt;li&gt;
			dd&amp;nbsp;&amp;rarr; 删除当前行，并把删除的行存到剪贴板里&lt;/li&gt;
		&lt;li&gt;
			p&amp;nbsp;&amp;rarr; 粘贴剪贴板&lt;/li&gt;
	&lt;/ul&gt;
	&lt;p&gt;
		推荐:&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;
			hjkl&amp;nbsp;(强例推荐使用其移动光标，但不必需) &amp;rarr;你也可以使用光标键 (&amp;larr;&amp;darr;&amp;uarr;&amp;rarr;). 注:&amp;nbsp;j&amp;nbsp;就像下箭头。&lt;/li&gt;
		&lt;li&gt;
			:help &amp;lt;command&amp;gt;&amp;nbsp;&amp;rarr; 显示相关命令的帮助。你也可以就输入&amp;nbsp;:help&amp;nbsp;而不跟命令。（陈皓注：退出帮助需要输入:q）&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	你能在vim幸存下来只需要上述的那5个命令，你就可以编辑文本了，你一定要把这些命令练成一种下意识的状态。于是你就可以开始进阶到第二级了。&lt;/p&gt;
&lt;p&gt;
	当是，在你进入第二级时，需要再说一下&amp;nbsp;Normal&amp;nbsp;模式。在一般的编辑器下，当你需要copy一段文字的时候，你需要使用&amp;nbsp;Ctrl&amp;nbsp;键，比如：Ctrl-C。也就是说，Ctrl键就好像功能键一样，当你按下了功能键Ctrl后，C就不在是C了，而且就是一个命令或是一个快键键了，在VIM的Normal模式下，所有的键就是功能键了。这个你需要知道。&lt;/p&gt;
&lt;p&gt;
	标记:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		下面的文字中，如果是&amp;nbsp;Ctrl-&amp;lambda;我会写成&amp;nbsp;&amp;lt;C-&amp;lambda;&amp;gt;.&lt;/li&gt;
	&lt;li&gt;
		以&amp;nbsp;:&amp;nbsp;开始的命令你需要输入&amp;nbsp;&amp;lt;enter&amp;gt;回车，例如 &amp;mdash; 如果我写成&amp;nbsp;:q&amp;nbsp;也就是说你要输入&amp;nbsp;:q&amp;lt;enter&amp;gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;nd-level----feel-comfortable&quot;&gt;
	第二级 &amp;ndash; 感觉良好&lt;/h4&gt;
&lt;p&gt;
	上面的那些命令只能让你存活下来，现在是时候学习一些更多的命令了，下面是我的建议：（陈皓注：所有的命令都需要在Normal模式下使用，如果你不知道现在在什么样的模式，你就狂按几次ESC键）&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;
		各种插入模式&lt;br /&gt;
		&lt;blockquote&gt;
			&lt;ul&gt;
				&lt;li&gt;
					a&amp;nbsp;&amp;rarr; 在光标后插入&lt;/li&gt;
				&lt;li&gt;
					o&amp;nbsp;&amp;rarr; 在当前行后插入一个新行&lt;/li&gt;
				&lt;li&gt;
					O&amp;nbsp;&amp;rarr; 在当前行前插入一个新行&lt;/li&gt;
				&lt;li&gt;
					cw&amp;nbsp;&amp;rarr; 替换从光标所在位置后到一个单词结尾的字符&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/blockquote&gt;
	&lt;/li&gt;
	&lt;li&gt;
		简单的移动光标&lt;br /&gt;
		&lt;blockquote&gt;
			&lt;ul&gt;
				&lt;li&gt;
					0&amp;nbsp;&amp;rarr; 数字零，到行头&lt;/li&gt;
				&lt;li&gt;
					^&amp;nbsp;&amp;rarr; 到本行第一个不是blank字符的位置（所谓blank字符就是空格，tab，换行，回车等）&lt;/li&gt;
				&lt;li&gt;
					$&amp;nbsp;&amp;rarr; 到本行行尾&lt;/li&gt;
				&lt;li&gt;
					g_&amp;nbsp;&amp;rarr; 到本行最后一个不是blank字符的位置。&lt;/li&gt;
				&lt;li&gt;
					/pattern&amp;nbsp;&amp;rarr; 搜索&amp;nbsp;pattern&amp;nbsp;的字符串（陈皓注：如果搜索出多个匹配，可按n键到下一个）&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/blockquote&gt;
	&lt;/li&gt;
	&lt;li&gt;
		拷贝/粘贴&amp;nbsp;（陈皓注：p/P都可以，p是表示在当前位置之后，P表示在当前位置之前）&lt;br /&gt;
		&lt;blockquote&gt;
			&lt;ul&gt;
				&lt;li&gt;
					P&amp;nbsp;&amp;rarr; 粘贴&lt;/li&gt;
				&lt;li&gt;
					yy&amp;nbsp;&amp;rarr; 拷贝当前行当行于&amp;nbsp;ddP&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/blockquote&gt;
	&lt;/li&gt;
	&lt;li&gt;
		Undo/Redo&lt;br /&gt;
		&lt;blockquote&gt;
			&lt;ul&gt;
				&lt;li&gt;
					u&amp;nbsp;&amp;rarr; undo&lt;/li&gt;
				&lt;li&gt;
					&amp;lt;C-r&amp;gt;&amp;nbsp;&amp;rarr; redo&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/blockquote&gt;
	&lt;/li&gt;
	&lt;li&gt;
		打开/保存/退出/改变文件(Buffer)&lt;br /&gt;
		&lt;blockquote&gt;
			&lt;ul&gt;
				&lt;li&gt;
					:e &amp;lt;path/to/file&amp;gt;&amp;nbsp;&amp;rarr; 打开一个文件&lt;/li&gt;
				&lt;li&gt;
					:w&amp;nbsp;&amp;rarr; 存盘&lt;/li&gt;
				&lt;li&gt;
					:saveas &amp;lt;path/to/file&amp;gt;&amp;nbsp;&amp;rarr; 另存为&amp;nbsp;&amp;lt;path/to/file&amp;gt;&lt;/li&gt;
				&lt;li&gt;
					:x，&amp;nbsp;ZZ&amp;nbsp;或&amp;nbsp;:wq&amp;nbsp;&amp;rarr; 保存并退出 (:x&amp;nbsp;表示仅在需要时保存，ZZ不需要输入冒号并回车)&lt;/li&gt;
				&lt;li&gt;
					:q!&amp;nbsp;&amp;rarr; 退出不保存&amp;nbsp;:qa!&amp;nbsp;强行退出所有的正在编辑的文件，就算别的文件有更改。&lt;/li&gt;
				&lt;li&gt;
					:bn&amp;nbsp;和&amp;nbsp;:bp&amp;nbsp;&amp;rarr; 你可以同时打开很多文件，使用这两个命令来切换下一个或上一个文件。（陈皓注：我喜欢使用:n到下一个文件）&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/blockquote&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
	花点时间熟悉一下上面的命令，一旦你掌握他们了，你就几乎可以干其它编辑器都能干的事了。但是到现在为止，你还是觉得使用vim还是有点笨拙，不过没关系，你可以进阶到第三级了。&lt;/p&gt;
&lt;h4 id=&quot;rd-level----better-stronger-faster&quot;&gt;
	第三级&amp;nbsp;&amp;ndash; 更好，更强，更快&lt;/h4&gt;
&lt;p&gt;
	先恭喜你！你干的很不错。我们可以开始一些更为有趣的事了。在第三级，我们只谈那些和vi可以兼容的命令。&lt;/p&gt;
&lt;h5 id=&quot;better&quot;&gt;
	更好&lt;/h5&gt;
&lt;p&gt;
	下面，让我们看一下vim是怎么重复自己的：&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;
		.&amp;nbsp;&amp;rarr; (小数点) 可以重复上一次的命令&lt;/li&gt;
	&lt;li&gt;
		N&amp;lt;command&amp;gt; &amp;rarr; 重复某个命令N次&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
	下面是一个示例，找开一个文件你可以试试下面的命令：&lt;/p&gt;
&lt;blockquote&gt;
	&lt;ul&gt;
		&lt;li&gt;
			2dd&amp;nbsp;&amp;rarr; 删除2行&lt;/li&gt;
		&lt;li&gt;
			3p&amp;nbsp;&amp;rarr; 粘贴文本3次&lt;/li&gt;
		&lt;li&gt;
			100idesu [ESC]&amp;nbsp;&amp;rarr; 会写下 &amp;ldquo;desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu &amp;ldquo;&lt;/li&gt;
		&lt;li&gt;
			.&amp;nbsp;&amp;rarr; 重复上一个命令&amp;mdash;&amp;mdash; 100 &amp;ldquo;desu &amp;ldquo;.&lt;/li&gt;
		&lt;li&gt;
			3.&amp;nbsp;&amp;rarr; 重复 3 次 &amp;ldquo;desu&amp;rdquo; (注意：不是 300，你看，VIM多聪明啊).&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h5 id=&quot;stronger&quot;&gt;
	更强&lt;/h5&gt;
&lt;p&gt;
	你要让你的光标移动更有效率，你一定要了解下面的这些命令，千万别跳过。&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;
		NG&amp;nbsp;&amp;rarr; 到第 N 行 （陈皓注：注意命令中的G是大写的，另我一般使用 : N 到第N行，如 :137 到第137行）&lt;/li&gt;
	&lt;li&gt;
		gg&amp;nbsp;&amp;rarr; 到第一行。（陈皓注：相当于1G，或 :1）&lt;/li&gt;
	&lt;li&gt;
		G&amp;nbsp;&amp;rarr; 到最后一行。&lt;/li&gt;
	&lt;li&gt;
		按单词移动：&lt;br /&gt;
		&lt;blockquote&gt;
			&lt;ol&gt;
				&lt;li&gt;
					w&amp;nbsp;&amp;rarr; 到下一个单词的开头。&lt;/li&gt;
				&lt;li&gt;
					e&amp;nbsp;&amp;rarr; 到下一个单词的结尾。&lt;/li&gt;
			&lt;/ol&gt;
			&lt;p&gt;
				&amp;gt; 如果你认为单词是由默认方式，那么就用小写的e和w。默认上来说，一个单词由字母，数字和下划线组成（陈皓注：程序变量）&lt;/p&gt;
			&lt;p&gt;
				&amp;gt; 如果你认为单词是由blank字符分隔符，那么你需要使用大写的E和W。（陈皓注：程序语句）&lt;/p&gt;
			&lt;p&gt;
				&lt;img alt=&quot;Word moves example&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/word_moves.jpg&quot; /&gt;&lt;/p&gt;
		&lt;/blockquote&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
	下面，让我来说说最强的光标移动：&lt;/p&gt;
&lt;blockquote&gt;
	&lt;ul&gt;
		&lt;li&gt;
			%&amp;nbsp;: 匹配括号移动，包括&amp;nbsp;(,&amp;nbsp;{,&amp;nbsp;[. （陈皓注：你需要把光标先移到括号上）&lt;/li&gt;
		&lt;li&gt;
			*&amp;nbsp;和&amp;nbsp;#: &amp;nbsp;匹配光标当前所在的单词，移动光标到下一个（或上一个）匹配单词（*是下一个，#是上一个）&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	相信我，上面这三个命令对程序员来说是相当强大的。&lt;/p&gt;
&lt;h5 id=&quot;faster&quot;&gt;
	更快&lt;/h5&gt;
&lt;p&gt;
	你一定要记住光标的移动，因为很多命令都可以和这些移动光标的命令连动。很多命令都可以如下来干：&lt;/p&gt;
&lt;p&gt;
	&amp;lt;start position&amp;gt;&amp;lt;command&amp;gt;&amp;lt;end position&amp;gt;&lt;/p&gt;
&lt;p&gt;
	例如&amp;nbsp;0y$&amp;nbsp;命令意味着：&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		0&amp;nbsp;&amp;rarr; 先到行头&lt;/li&gt;
	&lt;li&gt;
		y&amp;nbsp;&amp;rarr; 从这里开始拷贝&lt;/li&gt;
	&lt;li&gt;
		$&amp;nbsp;&amp;rarr; 拷贝到本行最后一个字符&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	你可可以输入&amp;nbsp;ye，从当前位置拷贝到本单词的最后一个字符。&lt;/p&gt;
&lt;p&gt;
	你也可以输入&amp;nbsp;y2/foo&amp;nbsp;来拷贝2个 &amp;ldquo;foo&amp;rdquo; 之间的字符串。&lt;/p&gt;
&lt;p&gt;
	还有很多时间并不一定你就一定要按y才会拷贝，下面的命令也会被拷贝：&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		d&amp;nbsp;(删除 )&lt;/li&gt;
	&lt;li&gt;
		v&amp;nbsp;(可视化的选择)&lt;/li&gt;
	&lt;li&gt;
		gU&amp;nbsp;(变大写)&lt;/li&gt;
	&lt;li&gt;
		gu&amp;nbsp;(变小写)&lt;/li&gt;
	&lt;li&gt;
		等等&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
	（陈皓注：可视化选择是一个很有意思的命令，你可以先按v，然后移动光标，你就会看到文本被选择，然后，你可能d，也可y，也可以变大写等）&lt;/div&gt;
&lt;h4 id=&quot;th-level----vim-superpowers&quot;&gt;
	第四级 &amp;ndash; Vim 超能力&lt;/h4&gt;
&lt;p&gt;
	你只需要掌握前面的命令，你就可以很舒服的使用VIM了。但是，现在，我们向你介绍的是VIM杀手级的功能。下面这些功能是我只用vim的原因。&lt;/p&gt;
&lt;h5 id=&quot;move-on-current-line-0---f-f-t-t--&quot;&gt;
	在当前行上移动光标:&amp;nbsp;0&amp;nbsp;^&amp;nbsp;$&amp;nbsp;f&amp;nbsp;F&amp;nbsp;t&amp;nbsp;T&amp;nbsp;,&amp;nbsp;;&lt;/h5&gt;
&lt;blockquote&gt;
	&lt;ul&gt;
		&lt;li&gt;
			0&amp;nbsp;&amp;rarr; 到行头&lt;/li&gt;
		&lt;li&gt;
			^&amp;nbsp;&amp;rarr; 到本行的第一个非blank字符&lt;/li&gt;
		&lt;li&gt;
			$&amp;nbsp;&amp;rarr; 到行尾&lt;/li&gt;
		&lt;li&gt;
			g_&amp;nbsp;&amp;rarr; 到本行最后一个不是blank字符的位置。&lt;/li&gt;
		&lt;li&gt;
			fa&amp;nbsp;&amp;rarr; 到下一个为a的字符处，你也可以fs到下一个为s的字符。&lt;/li&gt;
		&lt;li&gt;
			t,&amp;nbsp;&amp;rarr; 到逗号前的第一个字符。逗号可以变成其它字符。&lt;/li&gt;
		&lt;li&gt;
			3fa&amp;nbsp;&amp;rarr; 在当前行查找第三个出现的a。&lt;/li&gt;
		&lt;li&gt;
			F&amp;nbsp;和&amp;nbsp;T&amp;nbsp;&amp;rarr; 和&amp;nbsp;f&amp;nbsp;和&amp;nbsp;t&amp;nbsp;一样，只不过是相反方向。&lt;br /&gt;
			&lt;img alt=&quot;Line moves&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/line_moves.jpg&quot; /&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	还有一个很有用的命令是&amp;nbsp;dt&amp;quot;&amp;nbsp;&amp;rarr; 删除所有的内容，直到遇到双引号&amp;mdash;&amp;mdash;&amp;nbsp;&amp;quot;。&lt;/p&gt;
&lt;h5 id=&quot;zone-selection-actionaobject-or-actioniobject&quot;&gt;
	区域选择&amp;nbsp;&amp;lt;action&amp;gt;a&amp;lt;object&amp;gt;&amp;nbsp;或&amp;nbsp;&amp;lt;action&amp;gt;i&amp;lt;object&amp;gt;&lt;/h5&gt;
&lt;p&gt;
	在visual 模式下，这些命令很强大，其命令格式为&lt;/p&gt;
&lt;p&gt;
	&amp;lt;action&amp;gt;a&amp;lt;object&amp;gt;&amp;nbsp;和&amp;nbsp;&amp;lt;action&amp;gt;i&amp;lt;object&amp;gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		action可以是任何的命令，如&amp;nbsp;d&amp;nbsp;(删除),&amp;nbsp;y&amp;nbsp;(拷贝),&amp;nbsp;v&amp;nbsp;(可以视模式选择)。&lt;/li&gt;
	&lt;li&gt;
		object 可能是：&amp;nbsp;w&amp;nbsp;一个单词，&amp;nbsp;W&amp;nbsp;一个以空格为分隔的单词，&amp;nbsp;s&amp;nbsp;一个句字，&amp;nbsp;p&amp;nbsp;一个段落。也可以是一个特别的字符：&amp;quot;、&amp;nbsp;&amp;#39;、&amp;nbsp;)、&amp;nbsp;}、&amp;nbsp;]。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	假设你有一个字符串&amp;nbsp;(map (+) (&amp;quot;foo&amp;quot;)).而光标键在第一个&amp;nbsp;o&amp;nbsp;的位置。&lt;/p&gt;
&lt;blockquote&gt;
	&lt;ul&gt;
		&lt;li&gt;
			vi&amp;quot;&amp;nbsp;&amp;rarr; 会选择&amp;nbsp;foo.&lt;/li&gt;
		&lt;li&gt;
			va&amp;quot;&amp;nbsp;&amp;rarr; 会选择&amp;nbsp;&amp;quot;foo&amp;quot;.&lt;/li&gt;
		&lt;li&gt;
			vi)&amp;nbsp;&amp;rarr; 会选择&amp;nbsp;&amp;quot;foo&amp;quot;.&lt;/li&gt;
		&lt;li&gt;
			va)&amp;nbsp;&amp;rarr; 会选择(&amp;quot;foo&amp;quot;).&lt;/li&gt;
		&lt;li&gt;
			v2i)&amp;nbsp;&amp;rarr; 会选择&amp;nbsp;map (+) (&amp;quot;foo&amp;quot;)&lt;/li&gt;
		&lt;li&gt;
			v2a)&amp;nbsp;&amp;rarr; 会选择&amp;nbsp;(map (+) (&amp;quot;foo&amp;quot;))&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	&lt;img alt=&quot;Text objects selection&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/textobjects.png&quot; /&gt;&lt;/p&gt;
&lt;h5 id=&quot;select-rectangular-blocks-c-v&quot;&gt;
	块操作:&amp;nbsp;&amp;lt;C-v&amp;gt;&lt;/h5&gt;
&lt;p&gt;
	块操作，典型的操作：&amp;nbsp;0 &amp;lt;C-v&amp;gt; &amp;lt;C-d&amp;gt; I-- [ESC]&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		^&amp;nbsp;&amp;rarr; 到行头&lt;/li&gt;
	&lt;li&gt;
		&amp;lt;C-v&amp;gt;&amp;nbsp;&amp;rarr; 开始块操作&lt;/li&gt;
	&lt;li&gt;
		&amp;lt;C-d&amp;gt;&amp;nbsp;&amp;rarr; 向下移动 (你也可以使用hjkl来移动光标，或是使用%，或是别的)&lt;/li&gt;
	&lt;li&gt;
		I-- [ESC]&amp;nbsp;&amp;rarr; I是插入，插入&amp;ldquo;--&amp;rdquo;，按ESC键来为每一行生效。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	&lt;img alt=&quot;Rectangular blocks&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/rectangular-blocks.gif&quot; /&gt;&lt;/p&gt;
&lt;p&gt;
	在Windows下的vim，你需要使用&amp;nbsp;&amp;lt;C-q&amp;gt;&amp;nbsp;而不是&amp;nbsp;&amp;lt;C-v&amp;gt;&amp;nbsp;，&amp;lt;C-v&amp;gt;&amp;nbsp;是拷贝剪贴板。&lt;/p&gt;
&lt;h5 id=&quot;completion-c-n-and-c-p&quot;&gt;
	自动提示：&amp;nbsp;&amp;lt;C-n&amp;gt;&amp;nbsp;和&amp;nbsp;&amp;lt;C-p&amp;gt;&lt;/h5&gt;
&lt;p&gt;
	在 Insert 模式下，你可以输入一个词的开头，然后按&amp;nbsp;&amp;lt;C-p&amp;gt;或是&amp;lt;C-n&amp;gt;，自动补齐功能就出现了&amp;hellip;&amp;hellip;&lt;/p&gt;
&lt;p&gt;
	&lt;img alt=&quot;Completion&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/completion.gif&quot; /&gt;&lt;/p&gt;
&lt;h5 id=&quot;macros--qa-do-something-q-a-&quot;&gt;
	宏录制：&amp;nbsp;qa&amp;nbsp;操作序列&amp;nbsp;q,&amp;nbsp;@a,&amp;nbsp;@@&lt;/h5&gt;
&lt;ul&gt;
	&lt;li&gt;
		qa&amp;nbsp;把你的操作记录在寄存器&amp;nbsp;a。&lt;/li&gt;
	&lt;li&gt;
		于是&amp;nbsp;@a&amp;nbsp;会replay被录制的宏。&lt;/li&gt;
	&lt;li&gt;
		@@&amp;nbsp;是一个快捷键用来replay最新录制的宏。&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
	&lt;p&gt;
		示例&lt;/p&gt;
	&lt;p&gt;
		在一个只有一行且这一行只有&amp;ldquo;1&amp;rdquo;的文本中，键入如下命令：&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;
			qaYp&amp;lt;C-a&amp;gt;q&amp;rarr;
			&lt;ul&gt;
				&lt;li&gt;
					qa&amp;nbsp;开始录制&lt;/li&gt;
				&lt;li&gt;
					Yp&amp;nbsp;复制行.&lt;/li&gt;
				&lt;li&gt;
					&amp;lt;C-a&amp;gt;&amp;nbsp;增加1.&lt;/li&gt;
				&lt;li&gt;
					q&amp;nbsp;停止录制.&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li&gt;
			@a&amp;nbsp;&amp;rarr; 在1下面写下 2&lt;/li&gt;
		&lt;li&gt;
			@@&amp;nbsp;&amp;rarr; 在2 正面写下3&lt;/li&gt;
		&lt;li&gt;
			现在做&amp;nbsp;100@@&amp;nbsp;会创建新的100行，并把数据增加到 103.&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	&lt;img alt=&quot;Macros&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/macros.gif&quot; /&gt;&lt;/p&gt;
&lt;h5 id=&quot;visual-selection-vvc-v&quot;&gt;
	可视化选择：&amp;nbsp;v,V,&amp;lt;C-v&amp;gt;&lt;/h5&gt;
&lt;p&gt;
	前面，我们看到了&amp;nbsp;&amp;lt;C-v&amp;gt;的示例 （在Windows下应该是&amp;lt;C-q&amp;gt;），我们可以使用&amp;nbsp;v&amp;nbsp;和&amp;nbsp;V。一但被选好了，你可以做下面的事：&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		J&amp;nbsp;&amp;rarr; 把所有的行连接起来（变成一行）&lt;/li&gt;
	&lt;li&gt;
		&amp;lt;&amp;nbsp;或&amp;nbsp;&amp;gt;&amp;nbsp;&amp;rarr; 左右缩进&lt;/li&gt;
	&lt;li&gt;
		=&amp;nbsp;&amp;rarr; 自动给缩进 （陈皓注：这个功能相当强大，我太喜欢了）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	&lt;img alt=&quot;Autoindent&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/autoindent.gif&quot; /&gt;&lt;/p&gt;
&lt;p&gt;
	在所有被选择的行后加上点东西：&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		&amp;lt;C-v&amp;gt;&lt;/li&gt;
	&lt;li&gt;
		选中相关的行 (可使用&amp;nbsp;j&amp;nbsp;或&amp;nbsp;&amp;lt;C-d&amp;gt;&amp;nbsp;或是&amp;nbsp;/pattern&amp;nbsp;或是&amp;nbsp;%&amp;nbsp;等&amp;hellip;&amp;hellip;)&lt;/li&gt;
	&lt;li&gt;
		$&amp;nbsp;到行最后&lt;/li&gt;
	&lt;li&gt;
		A, 输入字符串，按&amp;nbsp;ESC。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	&lt;img alt=&quot;Append to many lines&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/append-to-many-lines.gif&quot; /&gt;&lt;/p&gt;
&lt;h5 id=&quot;splits-split-and-vsplit&quot;&gt;
	分屏:&amp;nbsp;:split&amp;nbsp;和&amp;nbsp;vsplit.&lt;/h5&gt;
&lt;p&gt;
	下面是主要的命令，你可以使用VIM的帮助&amp;nbsp;:help split. 你可以参考本站以前的一篇文章&lt;a href=&quot;http://coolshell.cn/articles/1679.html&quot; target=&quot;_blank&quot; title=&quot;Vim的分屏功能&quot;&gt;VIM分屏&lt;/a&gt;。&lt;/p&gt;
&lt;blockquote&gt;
	&lt;ul&gt;
		&lt;li&gt;
			:split&amp;nbsp;&amp;rarr; 创建分屏 (:vsplit创建垂直分屏)&lt;/li&gt;
		&lt;li&gt;
			&amp;lt;C-w&amp;gt;&amp;lt;dir&amp;gt;&amp;nbsp;: dir就是方向，可以是&amp;nbsp;hjkl&amp;nbsp;或是 &amp;larr;&amp;darr;&amp;uarr;&amp;rarr; 中的一个，其用来切换分屏。&lt;/li&gt;
		&lt;li&gt;
			&amp;lt;C-w&amp;gt;_&amp;nbsp;(或&amp;nbsp;&amp;lt;C-w&amp;gt;|)&amp;nbsp;: 最大化尺寸 (&amp;lt;C-w&amp;gt;|&amp;nbsp;垂直分屏)&lt;/li&gt;
		&lt;li&gt;
			&amp;lt;C-w&amp;gt;+&amp;nbsp;(或&amp;nbsp;&amp;lt;C-w&amp;gt;-)&amp;nbsp;: 增加尺寸&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	&lt;img alt=&quot;Split&quot; src=&quot;http://yannesposito.com/Scratch/img/blog/Learn-Vim-Progressively/split.gif&quot; /&gt;&lt;/p&gt;
&lt;h4 id=&quot;conclusion&quot;&gt;
	结束语&lt;/h4&gt;
&lt;ul&gt;
	&lt;li&gt;
		上面是作者最常用的90%的命令。&lt;/li&gt;
	&lt;li&gt;
		我建议你每天都学1到2个新的命令。&lt;/li&gt;
	&lt;li&gt;
		在两到三周后，你会感到vim的强大的。&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;
		有时候，学习VIM就像是在死背一些东西。&lt;/li&gt;
	&lt;li&gt;
		幸运的是，vim有很多很不错的工具和优秀的文档。&lt;/li&gt;
	&lt;li&gt;
		运行vimtutor直到你熟悉了那些基本命令。&lt;/li&gt;
	&lt;li&gt;
		其在线帮助文档中你应该要仔细阅读的是&amp;nbsp;:help usr_02.txt.&lt;/li&gt;
	&lt;li&gt;
		你会学习到诸如&amp;nbsp;&amp;nbsp;!，&amp;nbsp;目录，寄存器，插件等很多其它的功能。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	学习vim就像学弹钢琴一样，一旦学会，受益无穷。&lt;/p&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/11/23/linux-daemon.html&quot;&gt;Linux 技巧：让进程在后台可靠运行的几种方法&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/11/15/bash-shortcuts.html&quot;&gt;[zz]让你提升命令行效率的Bash快捷键&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/06/13/terminator.html&quot;&gt;[zz]Terminator学习小记&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/03/18/gentoo-update.html&quot;&gt;Gentoo Emerge World&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/02/24/linux-clear.html&quot;&gt;linux入侵踪迹隐藏攻略&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/09/28/vim-level.html&quot;&gt;http://blog.hi-suke.com/2011/09/28/vim-level.html&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/608636257/visionblog/feedsky/s.gif?r=http://blog.hi-suke.com/2011/09/28/vim-level.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><pubDate>Wed, 28 Sep 2011 22:39:13 +0800</pubDate><guid isPermaLink="false">http://blog.hi-suke.com/entry/vim-level</guid><dc:creator>vision4fun</dc:creator><fs:srclink>http://blog.hi-suke.com/2011/09/28/vim-level.html</fs:srclink><fs:srcfeed>http://blog.hi-suke.com/feed</fs:srcfeed><fs:itemid>feedsky/visionblog/~8885042/608636257/5398154</fs:itemid></item><item><title>[zz]Terminator学习小记</title><link>http://blog.hi-suke.com/2011/06/13/terminator.html</link><id xmlns="http://www.w3.org/2005/Atom">http://blog.hi-suke.com/entry/terminator</id><content xmlns="http://www.w3.org/2005/Atom" type="html">&lt;p&gt;
	原文地址：&lt;a href=&quot;http://www.lovemaple.info/blog/2011/05/learning-terminator/&quot;&gt;http://www.lovemaple.info/blog/2011/05/learning-terminator/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;content-type&quot; /&gt;
&lt;h3 id=&quot;窗口管理&quot; name=&quot;&quot;&gt;
	1.窗口管理&lt;/h3&gt;
&lt;p&gt;
	F11全屏&lt;br /&gt;
	Ctrl+Shift+E 垂直分割窗口(Vertice的第二个字母，之所以是第二个，因为含第一个字母的组合键已经被使用了)&lt;br /&gt;
	Ctrl+Shift+O 水平分割窗口(Horizon的第二个字母)&lt;/p&gt;
&lt;h3 id=&quot;窗口切换&quot; name=&quot;&quot;&gt;
	2.窗口切换&lt;/h3&gt;
&lt;p&gt;
	Ctrl+Shift+N或者Ctrl+Tab在分割的各窗口之间切换（我不喜欢用，更喜欢alt加方向键，见下）&lt;br /&gt;
	Alt+up（上方向键） 切换到当前焦点上面的窗口&lt;br /&gt;
	Alt+down（下方向键） 切换到当前焦点下面的窗口&lt;br /&gt;
	Alt+left（左方向键） 切换到当前焦点左面的窗口&lt;br /&gt;
	Alt+right（右方向键） 切换到当前焦点右面的窗口&lt;/p&gt;
&lt;p&gt;
	emacs中给.emacs文件添加下面的elisp代码也可以实现Alt+方向键切换窗口&lt;/p&gt;
&lt;pre&gt;
(windmove-default-keybindings &amp;#39;meta)&lt;/pre&gt;
&lt;h3 id=&quot;编辑窗口&quot; name=&quot;&quot;&gt;
	3.编辑窗口&lt;/h3&gt;
&lt;p&gt;
	Ctrl+Shift+Up（上方向键）&lt;br /&gt;
	Ctrl+Shift+Down（下方向键）&lt;br /&gt;
	Ctrl+Shift+Left（左方向键）&lt;br /&gt;
	Ctrl+Shift+Right（右方向键）&lt;br /&gt;
	Ctrl+Shift+X全屏当前窗口，再次按下就还原了&lt;br /&gt;
	Ctrl+Shift+Z全屏当前窗口，同时放大字体，再次按下就还原了&lt;br /&gt;
	Ctrl+Shift+W关闭当前窗口（仅是当前焦点所在的窗口）&lt;/p&gt;
&lt;p&gt;
	在emacs中我们也可以给.emacs文件添加下面的elisp代码实现Ctrl+Shift+方向键进行窗口大小修改&lt;/p&gt;
&lt;pre&gt;
(global-set-key (kbd &amp;quot;S-C-&amp;lt;left&amp;gt;&amp;quot;) &amp;#39;shrink-window-horizontally)
(global-set-key (kbd &amp;quot;S-C-&amp;lt;right&amp;gt;&amp;quot;) &amp;#39;enlarge-window-horizontally)
(global-set-key (kbd &amp;quot;S-C-&amp;lt;up&amp;gt;&amp;quot;) &amp;#39;shrink-window)
(global-set-key (kbd &amp;quot;S-C-&amp;lt;down&amp;gt;&amp;quot;) &amp;#39;enlarge-window)&lt;/pre&gt;
&lt;h3 id=&quot;文字编辑&quot; name=&quot;&quot;&gt;
	4.文字编辑&lt;/h3&gt;
&lt;p&gt;
	Ctrl+Shift+C复制（为什么不是Ctrl+C呢，因为他在终端下用于向当前运行的进程发出终止信号）&lt;br /&gt;
	Ctrl+Shift+V粘贴&lt;br /&gt;
	这里推荐一篇好文：&lt;a href=&quot;http://ahei.info/bash.htm&quot;&gt;高效操作Bash&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&quot;字体&quot; name=&quot;&quot;&gt;
	5.字体&lt;/h3&gt;
&lt;p&gt;
	Ctrl+&amp;#39;+&amp;#39; 字体增大一号&lt;br /&gt;
	Ctrl+&amp;#39;-&amp;#39; 字体减小一号&lt;br /&gt;
	Ctrl+0 字体还原&lt;/p&gt;
&lt;h3 id=&quot;标签功能&quot; name=&quot;&quot;&gt;
	6.标签功能&lt;/h3&gt;
&lt;p&gt;
	这个和Firefox操作每一个tab的方法一样，不过我很少使用&lt;/p&gt;
&lt;p&gt;
	Ctrl+Shift+P或者Ctrl+Shift+Tab 切换到前一个tab&lt;br /&gt;
	Ctrl+Shift+N或者Ctrl+Tab 切换到下一个tab&lt;br /&gt;
	PS：我更喜欢用Ctrl+PageUp或PageDown&lt;br /&gt;
	Ctrl+Shift+T新开个tab&lt;br /&gt;
	Ctrl+Shift+Q关闭当前所有窗口（会有提示是否关闭）&lt;br /&gt;
	Ctrl+Shift+G清除当前窗口（类似cls）&lt;/p&gt;
&lt;p&gt;
	具体其他用法可以使用man查看，命令如下&lt;br /&gt;
	man&amp;nbsp; terminator-config&lt;/p&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;content-type&quot; /&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/11/23/linux-daemon.html&quot;&gt;Linux 技巧：让进程在后台可靠运行的几种方法&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/11/15/bash-shortcuts.html&quot;&gt;[zz]让你提升命令行效率的Bash快捷键&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/09/28/vim-level.html&quot;&gt;[zz]简明Vim练级攻略&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/03/18/gentoo-update.html&quot;&gt;Gentoo Emerge World&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/02/24/linux-clear.html&quot;&gt;linux入侵踪迹隐藏攻略&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/06/13/terminator.html&quot;&gt;http://blog.hi-suke.com/2011/06/13/terminator.html&lt;/a&gt;&lt;/p&gt;</content><author xmlns="http://www.w3.org/2005/Atom"><name>vision4fun</name></author><content:encoded>&lt;p&gt;
	原文地址：&lt;a href=&quot;http://www.lovemaple.info/blog/2011/05/learning-terminator/&quot;&gt;http://www.lovemaple.info/blog/2011/05/learning-terminator/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;content-type&quot; /&gt;
&lt;h3 id=&quot;窗口管理&quot; name=&quot;&quot;&gt;
	1.窗口管理&lt;/h3&gt;
&lt;p&gt;
	F11全屏&lt;br /&gt;
	Ctrl+Shift+E 垂直分割窗口(Vertice的第二个字母，之所以是第二个，因为含第一个字母的组合键已经被使用了)&lt;br /&gt;
	Ctrl+Shift+O 水平分割窗口(Horizon的第二个字母)&lt;/p&gt;
&lt;h3 id=&quot;窗口切换&quot; name=&quot;&quot;&gt;
	2.窗口切换&lt;/h3&gt;
&lt;p&gt;
	Ctrl+Shift+N或者Ctrl+Tab在分割的各窗口之间切换（我不喜欢用，更喜欢alt加方向键，见下）&lt;br /&gt;
	Alt+up（上方向键） 切换到当前焦点上面的窗口&lt;br /&gt;
	Alt+down（下方向键） 切换到当前焦点下面的窗口&lt;br /&gt;
	Alt+left（左方向键） 切换到当前焦点左面的窗口&lt;br /&gt;
	Alt+right（右方向键） 切换到当前焦点右面的窗口&lt;/p&gt;
&lt;p&gt;
	emacs中给.emacs文件添加下面的elisp代码也可以实现Alt+方向键切换窗口&lt;/p&gt;
&lt;pre&gt;
(windmove-default-keybindings &amp;#39;meta)&lt;/pre&gt;
&lt;h3 id=&quot;编辑窗口&quot; name=&quot;&quot;&gt;
	3.编辑窗口&lt;/h3&gt;
&lt;p&gt;
	Ctrl+Shift+Up（上方向键）&lt;br /&gt;
	Ctrl+Shift+Down（下方向键）&lt;br /&gt;
	Ctrl+Shift+Left（左方向键）&lt;br /&gt;
	Ctrl+Shift+Right（右方向键）&lt;br /&gt;
	Ctrl+Shift+X全屏当前窗口，再次按下就还原了&lt;br /&gt;
	Ctrl+Shift+Z全屏当前窗口，同时放大字体，再次按下就还原了&lt;br /&gt;
	Ctrl+Shift+W关闭当前窗口（仅是当前焦点所在的窗口）&lt;/p&gt;
&lt;p&gt;
	在emacs中我们也可以给.emacs文件添加下面的elisp代码实现Ctrl+Shift+方向键进行窗口大小修改&lt;/p&gt;
&lt;pre&gt;
(global-set-key (kbd &amp;quot;S-C-&amp;lt;left&amp;gt;&amp;quot;) &amp;#39;shrink-window-horizontally)
(global-set-key (kbd &amp;quot;S-C-&amp;lt;right&amp;gt;&amp;quot;) &amp;#39;enlarge-window-horizontally)
(global-set-key (kbd &amp;quot;S-C-&amp;lt;up&amp;gt;&amp;quot;) &amp;#39;shrink-window)
(global-set-key (kbd &amp;quot;S-C-&amp;lt;down&amp;gt;&amp;quot;) &amp;#39;enlarge-window)&lt;/pre&gt;
&lt;h3 id=&quot;文字编辑&quot; name=&quot;&quot;&gt;
	4.文字编辑&lt;/h3&gt;
&lt;p&gt;
	Ctrl+Shift+C复制（为什么不是Ctrl+C呢，因为他在终端下用于向当前运行的进程发出终止信号）&lt;br /&gt;
	Ctrl+Shift+V粘贴&lt;br /&gt;
	这里推荐一篇好文：&lt;a href=&quot;http://ahei.info/bash.htm&quot;&gt;高效操作Bash&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&quot;字体&quot; name=&quot;&quot;&gt;
	5.字体&lt;/h3&gt;
&lt;p&gt;
	Ctrl+&amp;#39;+&amp;#39; 字体增大一号&lt;br /&gt;
	Ctrl+&amp;#39;-&amp;#39; 字体减小一号&lt;br /&gt;
	Ctrl+0 字体还原&lt;/p&gt;
&lt;h3 id=&quot;标签功能&quot; name=&quot;&quot;&gt;
	6.标签功能&lt;/h3&gt;
&lt;p&gt;
	这个和Firefox操作每一个tab的方法一样，不过我很少使用&lt;/p&gt;
&lt;p&gt;
	Ctrl+Shift+P或者Ctrl+Shift+Tab 切换到前一个tab&lt;br /&gt;
	Ctrl+Shift+N或者Ctrl+Tab 切换到下一个tab&lt;br /&gt;
	PS：我更喜欢用Ctrl+PageUp或PageDown&lt;br /&gt;
	Ctrl+Shift+T新开个tab&lt;br /&gt;
	Ctrl+Shift+Q关闭当前所有窗口（会有提示是否关闭）&lt;br /&gt;
	Ctrl+Shift+G清除当前窗口（类似cls）&lt;/p&gt;
&lt;p&gt;
	具体其他用法可以使用man查看，命令如下&lt;br /&gt;
	man&amp;nbsp; terminator-config&lt;/p&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;content-type&quot; /&gt;

      
                &lt;h4&gt;相关阅读：&lt;/h4&gt;
                  &lt;ul&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/11/23/linux-daemon.html&quot;&gt;Linux 技巧：让进程在后台可靠运行的几种方法&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/11/15/bash-shortcuts.html&quot;&gt;[zz]让你提升命令行效率的Bash快捷键&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/09/28/vim-level.html&quot;&gt;[zz]简明Vim练级攻略&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/03/18/gentoo-update.html&quot;&gt;Gentoo Emerge World&lt;/a&gt;&lt;/li&gt;
                
                  &lt;li&gt;&lt;a href=&quot;http://blog.hi-suke.com/2011/02/24/linux-clear.html&quot;&gt;linux入侵踪迹隐藏攻略&lt;/a&gt;&lt;/li&gt;
                
                &lt;/ul&gt;
                
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/06/13/terminator.html&quot;&gt;http://blog.hi-suke.com/2011/06/13/terminator.html&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/608636258/visionblog/feedsky/s.gif?r=http://blog.hi-suke.com/2011/06/13/terminator.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><pubDate>Mon, 13 Jun 2011 09:20:58 +0800</pubDate><guid isPermaLink="false">http://blog.hi-suke.com/entry/terminator</guid><dc:creator>vision4fun</dc:creator><fs:srclink>http://blog.hi-suke.com/2011/06/13/terminator.html</fs:srclink><fs:srcfeed>http://blog.hi-suke.com/feed</fs:srcfeed><fs:itemid>feedsky/visionblog/~8885042/608636258/5398154</fs:itemid></item><item><title>Eclipse+pydev 常用快捷键</title><link>http://blog.hi-suke.com/2011/03/31/eclipse-pydev.html</link><id xmlns="http://www.w3.org/2005/Atom">http://blog.hi-suke.com/entry/eclipse-pydev</id><content xmlns="http://www.w3.org/2005/Atom" type="html">&lt;p&gt;
	原文：&lt;a href=&quot;http://hi.baidu.com/ugo5/blog/item/1af5eda74c1e10e39152ee70.html&quot;&gt;http://hi.baidu.com/ugo5/blog/item/1af5eda74c1e10e39152ee70.html&lt;/a&gt;&lt;/p&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;content-type&quot; /&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	●多行缩进（减少缩进）：tab／shift+tab&lt;/p&gt;
&lt;p&gt;
	●复制行： Ctrl+Alt+方向键&amp;#39;&amp;darr;&amp;#39;&lt;/p&gt;
&lt;p&gt;
	●删除行：Ctrl+d&lt;/p&gt;
&lt;p&gt;
	●自动完成：Alt+/&lt;/p&gt;
&lt;p&gt;
	●注释：Ctrl+／&lt;/p&gt;
&lt;p&gt;
	●窗口最大小：Ctrl+m&lt;/p&gt;
&lt;p&gt;
	===============================================================================&lt;/p&gt;
&lt;p&gt;
	1 几个最重要的快捷键&lt;/p&gt;
&lt;p&gt;
	代码助手:Ctrl+Space（简体中文操作系统是Alt+/）&lt;br /&gt;
	快速修正：Ctrl+1&lt;br /&gt;
	单词补全：Alt+/&lt;br /&gt;
	打开外部Java文档：Shift+F2&lt;/p&gt;
&lt;p&gt;
	显示搜索对话框：Ctrl+H&lt;br /&gt;
	快速Outline：Ctrl+O&lt;br /&gt;
	打开资源：Ctrl+Shift+R&lt;br /&gt;
	打开类型：Ctrl+Shift+T&lt;br /&gt;
	显示重构菜单：Alt+Shift+T&lt;/p&gt;
&lt;p&gt;
	上一个/下一个光标的位置：Alt+Left/Right&lt;br /&gt;
	上一个/下一个成员（成员对象或成员函数）：Ctrl+Shift+Up/Down&lt;br /&gt;
	选中闭合元素：Alt+Shift+Up/Down/Left/Right&lt;br /&gt;
	删除行：Ctrl+D&lt;br /&gt;
	在当前行上插入一行：Ctrl+Shift+Enter&lt;br /&gt;
	在当前行下插入一行： Shift+Enter&lt;br /&gt;
	上下移动选中的行：Alt+Up/Down&lt;/p&gt;
&lt;p&gt;
	组织导入：Ctrl+Shift+O&lt;/p&gt;
&lt;p&gt;
	2 定位&lt;br /&gt;
	2.1行内定位&lt;br /&gt;
	行末/行首：End/Home&lt;br /&gt;
	前一个/后一个单词：Ctrl+Right/Left&lt;br /&gt;
	2.2文件内定位&lt;br /&gt;
	跳到某行：Ctrl+L&lt;br /&gt;
	上下滚屏：Ctrl+Up/Down&lt;br /&gt;
	上一个/下一个成员（成员对象或成员函数）：Ctrl+Shift+Up/Down&lt;br /&gt;
	快速Outline：Ctrl+O&lt;br /&gt;
	2.3跨文件定位&lt;br /&gt;
	打开声明：F3&lt;br /&gt;
	打开资源：Ctrl+Shift+R&lt;br /&gt;
	打开类型：Ctrl+Shift+T&lt;br /&gt;
	在workspace中搜索选中元素的声明：Ctrl+G&lt;br /&gt;
	在workspace中搜索选中的文本：Ctrl+Alt+G&lt;br /&gt;
	在workspace中搜索选中元素的引用：Ctrl+Shift+G&lt;br /&gt;
	打开调用层次结构：Ctrl+Alt+H&lt;br /&gt;
	快速层次结构：Ctrl+T&lt;br /&gt;
	反悔：Ctrl+Z&lt;br /&gt;
	2.4其它&lt;br /&gt;
	上一个/下一个光标所在位置：Alt+Left/Right&lt;br /&gt;
	上一个编辑的位置：Ctrl+Q&lt;/p&gt;
&lt;p&gt;
	3 选中&lt;br /&gt;
	3.1行内选中&lt;br /&gt;
	选中到行末/行首：Shift+End/Home&lt;br /&gt;
	选中上一个/下一个单词：Ctrl+Shift+Left/Right&lt;br /&gt;
	3.2文件内选中&lt;br /&gt;
	选中闭合元素：Alt+Shift+Up&lt;br /&gt;
	恢复到上一个选中：Alt+Shift+Down&lt;br /&gt;
	选中下一个/上一个元素：Alt+Shift+Right/Left&lt;/p&gt;
&lt;p&gt;
	4 定位/选中/操作同时&lt;br /&gt;
	删除行：Ctrl+D&lt;br /&gt;
	删除下一个/上一个单词：Ctrl+Delete/Backspace&lt;br /&gt;
	删除到行末：Ctrl+Shift+Delete&lt;br /&gt;
	在当前行上插入一行：Ctrl+Shift+Enter&lt;br /&gt;
	在当前行下插入一行： Shift+Enter&lt;br /&gt;
	上下移动选中的行：Alt+Up/Down&lt;br /&gt;
	拷贝选中的行：Ctrl+Alt+Up/Down&lt;/p&gt;
&lt;p&gt;
	5其它的代码编辑类快捷键&lt;br /&gt;
	保存：Ctrl+S&lt;br /&gt;
	保存所有：Ctrl+Shift+S&lt;br /&gt;
	下一个命中的项（搜索之后）：Ctrl+.&lt;br /&gt;
	注释：Ctrl+/&lt;br /&gt;
	添加导入：Ctrl+Shift+M&lt;br /&gt;
	显示快捷键帮助：Ctrl+Shift+L&lt;br /&gt;
	变为大/小写：Ctrl+Shift+X/Y&lt;/p&gt;
&lt;p&gt;
	6 重构&lt;br /&gt;
	显示重构菜单：Alt+Shift+T&lt;br /&gt;
	重构-改变方法签名：Alt+Shift+C&lt;br /&gt;
	重构-移动：Alt+Shift+V&lt;br /&gt;
	重构-重命名：Alt+Shift+R&lt;/p&gt;
&lt;p&gt;
	7 编辑器、视图、透视图切换&lt;br /&gt;
	下一个编辑器：Ctrl+F6&lt;br /&gt;
	下一个视图：Ctrl+F7&lt;br /&gt;
	下一个透视图：Ctrl+F8&lt;br /&gt;
	最大化当前视图或编辑器：Ctrl+M&lt;br /&gt;
	激活编辑器：F12&lt;/p&gt;
&lt;p&gt;
	8 Debug&lt;br /&gt;
	F5：Step Into（debug）&lt;br /&gt;
	F6：Step over（debug）&lt;br /&gt;
	F7：Step return（debug）&lt;br /&gt;
	F8：Resume（debug）&lt;br /&gt;
	F11：debug上一个应用（debug）&lt;/p&gt;
&lt;p&gt;
	9 Up/Down/Right/Left类快捷键&lt;br /&gt;
	Ctrl&lt;br /&gt;
	前一个/后一个单词：Ctrl+Right/Left&lt;br /&gt;
	上下滚屏：Ctrl+Up/Down&lt;/p&gt;
&lt;p&gt;
	Alt&lt;br /&gt;
	上一个/下一个光标的位置：Alt+Left/Right&lt;br /&gt;
	上下移动选中的行：Alt+Up/Down&lt;/p&gt;
&lt;p&gt;
	Shift&lt;br /&gt;
	选中上一个/下一个字符：Shift+Left/Right&lt;br /&gt;
	选中上一行/下一行（从当前光标位置开始）：Shift+Up/Down&lt;/p&gt;
&lt;p&gt;
	Ctrl+Shift&lt;br /&gt;
	上一个/下一个成员（成员对象或成员函数）：Ctrl+Shift+Up/Down&lt;br /&gt;
	选中上一个/下一个单词：Ctrl+Shift+Left/Right&lt;/p&gt;
&lt;p&gt;
	Alt+Shift&lt;br /&gt;
	选中闭合元素：Alt+Shift+Up&lt;br /&gt;
	恢复到上一个选中：Alt+Shift+Down&lt;br /&gt;
	选中下一个/上一个元素：Alt+Shift+Right/Left&lt;br /&gt;
	拷贝选中的行：Ctrl+Alt+Up/Down&lt;/p&gt;
&lt;p&gt;
	Ctrl+Alt&lt;br /&gt;
	拷贝选中的行：Ctrl+Alt+Up/Down&lt;/p&gt;
&lt;p&gt;
	10 F类快捷键&lt;br /&gt;
	F2：显示提示/重命名&lt;br /&gt;
	F3：打开选中元素的声明&lt;br /&gt;
	F4：打开选中元素的类型继承结构&lt;br /&gt;
	F5：刷新&lt;br /&gt;
	F5：Step Into（debug）&lt;br /&gt;
	F6：Step over（debug）&lt;br /&gt;
	F7：Step return（debug）&lt;br /&gt;
	F8：Resume（debug）&lt;br /&gt;
	F11：debug上一个应用（debug）&lt;br /&gt;
	F12：激活编辑器&amp;nbsp;&lt;/p&gt;

      
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/03/31/eclipse-pydev.html&quot;&gt;http://blog.hi-suke.com/2011/03/31/eclipse-pydev.html&lt;/a&gt;&lt;/p&gt;</content><author xmlns="http://www.w3.org/2005/Atom"><name>vision4fun</name></author><content:encoded>&lt;p&gt;
	原文：&lt;a href=&quot;http://hi.baidu.com/ugo5/blog/item/1af5eda74c1e10e39152ee70.html&quot;&gt;http://hi.baidu.com/ugo5/blog/item/1af5eda74c1e10e39152ee70.html&lt;/a&gt;&lt;/p&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;content-type&quot; /&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	●多行缩进（减少缩进）：tab／shift+tab&lt;/p&gt;
&lt;p&gt;
	●复制行： Ctrl+Alt+方向键&amp;#39;&amp;darr;&amp;#39;&lt;/p&gt;
&lt;p&gt;
	●删除行：Ctrl+d&lt;/p&gt;
&lt;p&gt;
	●自动完成：Alt+/&lt;/p&gt;
&lt;p&gt;
	●注释：Ctrl+／&lt;/p&gt;
&lt;p&gt;
	●窗口最大小：Ctrl+m&lt;/p&gt;
&lt;p&gt;
	===============================================================================&lt;/p&gt;
&lt;p&gt;
	1 几个最重要的快捷键&lt;/p&gt;
&lt;p&gt;
	代码助手:Ctrl+Space（简体中文操作系统是Alt+/）&lt;br /&gt;
	快速修正：Ctrl+1&lt;br /&gt;
	单词补全：Alt+/&lt;br /&gt;
	打开外部Java文档：Shift+F2&lt;/p&gt;
&lt;p&gt;
	显示搜索对话框：Ctrl+H&lt;br /&gt;
	快速Outline：Ctrl+O&lt;br /&gt;
	打开资源：Ctrl+Shift+R&lt;br /&gt;
	打开类型：Ctrl+Shift+T&lt;br /&gt;
	显示重构菜单：Alt+Shift+T&lt;/p&gt;
&lt;p&gt;
	上一个/下一个光标的位置：Alt+Left/Right&lt;br /&gt;
	上一个/下一个成员（成员对象或成员函数）：Ctrl+Shift+Up/Down&lt;br /&gt;
	选中闭合元素：Alt+Shift+Up/Down/Left/Right&lt;br /&gt;
	删除行：Ctrl+D&lt;br /&gt;
	在当前行上插入一行：Ctrl+Shift+Enter&lt;br /&gt;
	在当前行下插入一行： Shift+Enter&lt;br /&gt;
	上下移动选中的行：Alt+Up/Down&lt;/p&gt;
&lt;p&gt;
	组织导入：Ctrl+Shift+O&lt;/p&gt;
&lt;p&gt;
	2 定位&lt;br /&gt;
	2.1行内定位&lt;br /&gt;
	行末/行首：End/Home&lt;br /&gt;
	前一个/后一个单词：Ctrl+Right/Left&lt;br /&gt;
	2.2文件内定位&lt;br /&gt;
	跳到某行：Ctrl+L&lt;br /&gt;
	上下滚屏：Ctrl+Up/Down&lt;br /&gt;
	上一个/下一个成员（成员对象或成员函数）：Ctrl+Shift+Up/Down&lt;br /&gt;
	快速Outline：Ctrl+O&lt;br /&gt;
	2.3跨文件定位&lt;br /&gt;
	打开声明：F3&lt;br /&gt;
	打开资源：Ctrl+Shift+R&lt;br /&gt;
	打开类型：Ctrl+Shift+T&lt;br /&gt;
	在workspace中搜索选中元素的声明：Ctrl+G&lt;br /&gt;
	在workspace中搜索选中的文本：Ctrl+Alt+G&lt;br /&gt;
	在workspace中搜索选中元素的引用：Ctrl+Shift+G&lt;br /&gt;
	打开调用层次结构：Ctrl+Alt+H&lt;br /&gt;
	快速层次结构：Ctrl+T&lt;br /&gt;
	反悔：Ctrl+Z&lt;br /&gt;
	2.4其它&lt;br /&gt;
	上一个/下一个光标所在位置：Alt+Left/Right&lt;br /&gt;
	上一个编辑的位置：Ctrl+Q&lt;/p&gt;
&lt;p&gt;
	3 选中&lt;br /&gt;
	3.1行内选中&lt;br /&gt;
	选中到行末/行首：Shift+End/Home&lt;br /&gt;
	选中上一个/下一个单词：Ctrl+Shift+Left/Right&lt;br /&gt;
	3.2文件内选中&lt;br /&gt;
	选中闭合元素：Alt+Shift+Up&lt;br /&gt;
	恢复到上一个选中：Alt+Shift+Down&lt;br /&gt;
	选中下一个/上一个元素：Alt+Shift+Right/Left&lt;/p&gt;
&lt;p&gt;
	4 定位/选中/操作同时&lt;br /&gt;
	删除行：Ctrl+D&lt;br /&gt;
	删除下一个/上一个单词：Ctrl+Delete/Backspace&lt;br /&gt;
	删除到行末：Ctrl+Shift+Delete&lt;br /&gt;
	在当前行上插入一行：Ctrl+Shift+Enter&lt;br /&gt;
	在当前行下插入一行： Shift+Enter&lt;br /&gt;
	上下移动选中的行：Alt+Up/Down&lt;br /&gt;
	拷贝选中的行：Ctrl+Alt+Up/Down&lt;/p&gt;
&lt;p&gt;
	5其它的代码编辑类快捷键&lt;br /&gt;
	保存：Ctrl+S&lt;br /&gt;
	保存所有：Ctrl+Shift+S&lt;br /&gt;
	下一个命中的项（搜索之后）：Ctrl+.&lt;br /&gt;
	注释：Ctrl+/&lt;br /&gt;
	添加导入：Ctrl+Shift+M&lt;br /&gt;
	显示快捷键帮助：Ctrl+Shift+L&lt;br /&gt;
	变为大/小写：Ctrl+Shift+X/Y&lt;/p&gt;
&lt;p&gt;
	6 重构&lt;br /&gt;
	显示重构菜单：Alt+Shift+T&lt;br /&gt;
	重构-改变方法签名：Alt+Shift+C&lt;br /&gt;
	重构-移动：Alt+Shift+V&lt;br /&gt;
	重构-重命名：Alt+Shift+R&lt;/p&gt;
&lt;p&gt;
	7 编辑器、视图、透视图切换&lt;br /&gt;
	下一个编辑器：Ctrl+F6&lt;br /&gt;
	下一个视图：Ctrl+F7&lt;br /&gt;
	下一个透视图：Ctrl+F8&lt;br /&gt;
	最大化当前视图或编辑器：Ctrl+M&lt;br /&gt;
	激活编辑器：F12&lt;/p&gt;
&lt;p&gt;
	8 Debug&lt;br /&gt;
	F5：Step Into（debug）&lt;br /&gt;
	F6：Step over（debug）&lt;br /&gt;
	F7：Step return（debug）&lt;br /&gt;
	F8：Resume（debug）&lt;br /&gt;
	F11：debug上一个应用（debug）&lt;/p&gt;
&lt;p&gt;
	9 Up/Down/Right/Left类快捷键&lt;br /&gt;
	Ctrl&lt;br /&gt;
	前一个/后一个单词：Ctrl+Right/Left&lt;br /&gt;
	上下滚屏：Ctrl+Up/Down&lt;/p&gt;
&lt;p&gt;
	Alt&lt;br /&gt;
	上一个/下一个光标的位置：Alt+Left/Right&lt;br /&gt;
	上下移动选中的行：Alt+Up/Down&lt;/p&gt;
&lt;p&gt;
	Shift&lt;br /&gt;
	选中上一个/下一个字符：Shift+Left/Right&lt;br /&gt;
	选中上一行/下一行（从当前光标位置开始）：Shift+Up/Down&lt;/p&gt;
&lt;p&gt;
	Ctrl+Shift&lt;br /&gt;
	上一个/下一个成员（成员对象或成员函数）：Ctrl+Shift+Up/Down&lt;br /&gt;
	选中上一个/下一个单词：Ctrl+Shift+Left/Right&lt;/p&gt;
&lt;p&gt;
	Alt+Shift&lt;br /&gt;
	选中闭合元素：Alt+Shift+Up&lt;br /&gt;
	恢复到上一个选中：Alt+Shift+Down&lt;br /&gt;
	选中下一个/上一个元素：Alt+Shift+Right/Left&lt;br /&gt;
	拷贝选中的行：Ctrl+Alt+Up/Down&lt;/p&gt;
&lt;p&gt;
	Ctrl+Alt&lt;br /&gt;
	拷贝选中的行：Ctrl+Alt+Up/Down&lt;/p&gt;
&lt;p&gt;
	10 F类快捷键&lt;br /&gt;
	F2：显示提示/重命名&lt;br /&gt;
	F3：打开选中元素的声明&lt;br /&gt;
	F4：打开选中元素的类型继承结构&lt;br /&gt;
	F5：刷新&lt;br /&gt;
	F5：Step Into（debug）&lt;br /&gt;
	F6：Step over（debug）&lt;br /&gt;
	F7：Step return（debug）&lt;br /&gt;
	F8：Resume（debug）&lt;br /&gt;
	F11：debug上一个应用（debug）&lt;br /&gt;
	F12：激活编辑器&amp;nbsp;&lt;/p&gt;

      
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/03/31/eclipse-pydev.html&quot;&gt;http://blog.hi-suke.com/2011/03/31/eclipse-pydev.html&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/608636259/visionblog/feedsky/s.gif?r=http://blog.hi-suke.com/2011/03/31/eclipse-pydev.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><pubDate>Thu, 31 Mar 2011 16:32:47 +0800</pubDate><guid isPermaLink="false">http://blog.hi-suke.com/entry/eclipse-pydev</guid><dc:creator>vision4fun</dc:creator><fs:srclink>http://blog.hi-suke.com/2011/03/31/eclipse-pydev.html</fs:srclink><fs:srcfeed>http://blog.hi-suke.com/feed</fs:srcfeed><fs:itemid>feedsky/visionblog/~8885042/608636259/5398154</fs:itemid></item><item><title>Git overlook</title><link>http://blog.hi-suke.com/2011/03/21/git-overlook.html</link><id xmlns="http://www.w3.org/2005/Atom">http://blog.hi-suke.com/entry/git-overlook</id><content xmlns="http://www.w3.org/2005/Atom" type="html">&lt;p&gt;
	&lt;a href=&quot;http://vision4fun.appspot.com/media/agp2aXNpb240ZnVucg0LEgVNZWRpYRj5yQQM/git.png&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;/media/agp2aXNpb240ZnVucg0LEgVNZWRpYRj5yQQM/git.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

      
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/03/21/git-overlook.html&quot;&gt;http://blog.hi-suke.com/2011/03/21/git-overlook.html&lt;/a&gt;&lt;/p&gt;</content><author xmlns="http://www.w3.org/2005/Atom"><name>vision4fun</name></author><content:encoded>&lt;p&gt;
	&lt;a href=&quot;http://vision4fun.appspot.com/media/agp2aXNpb240ZnVucg0LEgVNZWRpYRj5yQQM/git.png&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;/media/agp2aXNpb240ZnVucg0LEgVNZWRpYRj5yQQM/git.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

      
                &lt;p&gt;本文网址:&lt;a href=&quot;http://blog.hi-suke.com/2011/03/21/git-overlook.html&quot;&gt;http://blog.hi-suke.com/2011/03/21/git-overlook.html&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/608636260/visionblog/feedsky/s.gif?r=http://blog.hi-suke.com/2011/03/21/git-overlook.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><pubDate>Mon, 21 Mar 2011 22:30:22 +0800</pubDate><guid isPermaLink="false">http://blog.hi-suke.com/entry/git-overlook</guid><dc:creator>vision4fun</dc:creator><fs:srclink>http://blog.hi-suke.com/2011/03/21/git-overlook.html</fs:srclink><fs:srcfeed>http://blog.hi-suke.com/feed</fs:srcfeed><fs:itemid>feedsky/visionblog/~8885042/608636260/5398154</fs:itemid></item></channel></rss>
