使用 Cloudfront 而不是单个 EC2 实例的 AWS ELB 设置有什么意义?
What's the point of an AWS ELB setup with Cloudfront, rather than a single EC2 instance?
如果 AWS Cloudfront 为访问者缓存您的网站内容,那么还设置 ELB 而不是标准的单一网络服务器 EC2 实例有什么意义?
可以肯定的是,只有几个 Cloudfront 连接会与服务器通信。
这是一个宽泛的问题。如果您真的知道自己在做什么以及您实际需要什么,那么如果您只需要一个 EC2 实例,那么您可以使用它。
对于生产环境总是建议有多个应用程序实例(服务器),以避免单点故障。这意味着,如果一台服务器出现故障或流量负载增加,其他实例会协调并保持应用程序正常运行 运行 并可由 users/customers.
更多细节请参考原文档:
https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/what-is-load-balancing.html
Elastic Load Balancing distributes incoming application traffic across multiple EC2 instances, in multiple Availability Zones. This increases the fault tolerance of your applications.
The load balancer serves as a single point of contact for clients, which increases the availability of your application. You can add and remove instances from your load balancer as your needs change, without disrupting the overall flow of requests to your application. Elastic Load Balancing scales your load balancer as traffic to your application changes over time, and can scale to the vast majority of workloads automatically.
You can configure health checks, which are used to monitor the health of the registered instances so that the load balancer can send requests only to the healthy instances. You can also offload the work of encryption and decryption to your load balancer so that your instances can focus on their main work.
您不需要在 CloudFront 和您的单个 EC2 实例之间使用 ELB。 ELB 和 CloudFront 都提供额外的保护 (DDoS),但对于单个实例,不需要或没有必要设置两者。
但是,AWS 的一大设计优势是负载平衡和自动缩放 (ASG)。您将需要一个负载平衡器来添加这些功能。网站确实会崩溃,启用 ASG 将确保在您的 Web 服务器无响应时启动新实例。
注意。您不希望您的 EC2 实例可用于 public Internet。您将吸引大量知道 AWS IP 地址的黑客。此流量可以快速消耗小型 T.x 实例上的资源。确保您的安全组设置为仅允许来自 CloudFront 的流量。
如果 AWS Cloudfront 为访问者缓存您的网站内容,那么还设置 ELB 而不是标准的单一网络服务器 EC2 实例有什么意义?
可以肯定的是,只有几个 Cloudfront 连接会与服务器通信。
这是一个宽泛的问题。如果您真的知道自己在做什么以及您实际需要什么,那么如果您只需要一个 EC2 实例,那么您可以使用它。
对于生产环境总是建议有多个应用程序实例(服务器),以避免单点故障。这意味着,如果一台服务器出现故障或流量负载增加,其他实例会协调并保持应用程序正常运行 运行 并可由 users/customers.
更多细节请参考原文档:
https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/what-is-load-balancing.html
Elastic Load Balancing distributes incoming application traffic across multiple EC2 instances, in multiple Availability Zones. This increases the fault tolerance of your applications.The load balancer serves as a single point of contact for clients, which increases the availability of your application. You can add and remove instances from your load balancer as your needs change, without disrupting the overall flow of requests to your application. Elastic Load Balancing scales your load balancer as traffic to your application changes over time, and can scale to the vast majority of workloads automatically.
You can configure health checks, which are used to monitor the health of the registered instances so that the load balancer can send requests only to the healthy instances. You can also offload the work of encryption and decryption to your load balancer so that your instances can focus on their main work.
您不需要在 CloudFront 和您的单个 EC2 实例之间使用 ELB。 ELB 和 CloudFront 都提供额外的保护 (DDoS),但对于单个实例,不需要或没有必要设置两者。
但是,AWS 的一大设计优势是负载平衡和自动缩放 (ASG)。您将需要一个负载平衡器来添加这些功能。网站确实会崩溃,启用 ASG 将确保在您的 Web 服务器无响应时启动新实例。
注意。您不希望您的 EC2 实例可用于 public Internet。您将吸引大量知道 AWS IP 地址的黑客。此流量可以快速消耗小型 T.x 实例上的资源。确保您的安全组设置为仅允许来自 CloudFront 的流量。