<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CloudFront源站 &#8211; 顶云课程</title>
	<atom:link href="https://www.iloveaws.cn/tag/cloudfront%e6%ba%90%e7%ab%99/feed" rel="self" type="application/rss+xml" />
	<link>https://www.iloveaws.cn</link>
	<description>AWS认证、DevOps与AI工程中文课程</description>
	<lastBuildDate>Tue, 31 Dec 2019 15:29:26 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.iloveaws.cn/wp-content/uploads/2019/06/cropped-uugai.com_1560993984449-32x32.png</url>
	<title>CloudFront源站 &#8211; 顶云课程</title>
	<link>https://www.iloveaws.cn</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>CloudFront的高可用之【源】故障转移</title>
		<link>https://www.iloveaws.cn/458.html</link>
					<comments>https://www.iloveaws.cn/458.html#respond</comments>
		
		<dc:creator><![CDATA[沉默恶魔]]></dc:creator>
		<pubDate>Mon, 11 Nov 2019 02:18:24 +0000</pubDate>
				<category><![CDATA[AWS知识点]]></category>
		<category><![CDATA[CloudFront]]></category>
		<category><![CDATA[CloudFront故障转移]]></category>
		<category><![CDATA[CloudFront源站]]></category>
		<guid isPermaLink="false">https://www.iloveaws.cn/?p=458</guid>

					<description><![CDATA[我们在使用CloudFront的案例中，为了保障CloudFront的高可用，一般会配置多个源站，当其中一个源站出现故障时，回源需要切换到正常的源站从而不会影响到业务，其实在2018年11月20日，CloudFront推出了一个功能为源故障转移，不需要借助其他系统就可以实现源站的故障转移。
]]></description>
										<content:encoded><![CDATA[
<p class="has-text-align-left has-small-font-size wp-block-paragraph">文&nbsp;|&nbsp;沉默恶魔（转载请注明出处）<br>微信号：chenmoemo<br>关注公众号：AWS爱好者</p>



<figure class="wp-block-image"><img fetchpriority="high" decoding="async" width="1024" height="538" src="http://resource.iloveaws.cn/wp-content/uploads/2019/11/640-14-1024x538.jpg" alt="" class="wp-image-459" srcset="https://www.iloveaws.cn/wp-content/uploads/2019/11/640-14-1024x538.jpg 1024w, https://www.iloveaws.cn/wp-content/uploads/2019/11/640-14-300x158.jpg 300w, https://www.iloveaws.cn/wp-content/uploads/2019/11/640-14-768x403.jpg 768w, https://www.iloveaws.cn/wp-content/uploads/2019/11/640-14.jpg 1080w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"><em>如果您想加入「AWS爱好者」微信群和其他同学交流，请加微信:chenmoemo，后拉入「AWS爱好者」微信群。</em></p>



<p class="wp-block-paragraph"><br>我们在使用CloudFront的案例中，为了保障CloudFront的高可用，一般会配置多个源站，当其中一个源站出现故障时，回源需要切换到正常的源站从而不会影响到业务，其实在2018年11月20日，<strong>CloudFront推出了一个功能为源故障转移，不需要借助其他系统就可以实现源站的故障转移。</strong></p>



<p class="wp-block-paragraph">利用 CloudFront 的源故障转移功能，您可以为您的分配设置两个源 &#8211;&nbsp;<strong>主要源和辅助源。</strong>这样，<strong>当 CloudFront 检测到您的主要源不可用时，您的内容将从您的辅助源提供。</strong>实现方式为在CloudFront创建一个/源组/，您将在其中为 CloudFront 指定主源以及 CloudFront 将在主源返回特定 HTTP 状态代码故障响应时自动切换到的次要源。</p>



<p class="wp-block-paragraph">源组中的两个源可以是以下源的任意组合：AWS 源（如 Amazon S3 存储桶或 Amazon EC2 实例）或自定义源（如您自己的 HTTP Web 服务器）。在创建源组时，将 CloudFront 配置为在主源返回您配置的特定状态代码时故障转移到 GET、HEAD 和 OPTIONS HTTP 方法的次要源。</p>



<p class="wp-block-paragraph">CloudFront 将所有传入请求路由至主源，仅在尝试路由至主源时返回为故障转移或超时配置的状态代码的情况下，CloudFront 才将请求发送到次要源。</p>



<figure class="wp-block-image"><img decoding="async" width="1024" height="536" src="http://resource.iloveaws.cn/wp-content/uploads/2019/11/640-15-1024x536.jpg" alt="" class="wp-image-460" srcset="https://www.iloveaws.cn/wp-content/uploads/2019/11/640-15-1024x536.jpg 1024w, https://www.iloveaws.cn/wp-content/uploads/2019/11/640-15-300x157.jpg 300w, https://www.iloveaws.cn/wp-content/uploads/2019/11/640-15-768x402.jpg 768w, https://www.iloveaws.cn/wp-content/uploads/2019/11/640-15.jpg 1080w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">实现源故障转移功能创建源组操作非常简单，在CloudFront分配中：</p>



<ol class="wp-block-list"><li>创建源组</li><li>添加主/备源</li><li>选择故障转移条件</li></ol>



<p class="wp-block-paragraph">就搞定啦，如图：</p>



<figure class="wp-block-image"><img decoding="async" width="1024" height="466" src="http://resource.iloveaws.cn/wp-content/uploads/2019/11/640-16-1024x466.jpg" alt="" class="wp-image-461" srcset="https://www.iloveaws.cn/wp-content/uploads/2019/11/640-16-1024x466.jpg 1024w, https://www.iloveaws.cn/wp-content/uploads/2019/11/640-16-300x136.jpg 300w, https://www.iloveaws.cn/wp-content/uploads/2019/11/640-16-768x349.jpg 768w, https://www.iloveaws.cn/wp-content/uploads/2019/11/640-16.jpg 1080w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="607" src="http://resource.iloveaws.cn/wp-content/uploads/2019/11/640-17-1024x607.jpg" alt="" class="wp-image-462" srcset="https://www.iloveaws.cn/wp-content/uploads/2019/11/640-17-1024x607.jpg 1024w, https://www.iloveaws.cn/wp-content/uploads/2019/11/640-17-300x178.jpg 300w, https://www.iloveaws.cn/wp-content/uploads/2019/11/640-17-768x455.jpg 768w, https://www.iloveaws.cn/wp-content/uploads/2019/11/640-17.jpg 1080w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://www.iloveaws.cn/458.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
