

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 搭建 AWS 基础架构
<a name="building-infrastructure"></a>

你可以用很多 AWS 服务 方法来构建 Web 爬网基础架构。本指南的 “[架构](architecture.md)” 部分包括一个建议的解决方案。我们建议您考虑使用以下内容 AWS 服务 为网络爬虫构建支持基础架构：
+ 使用亚马逊虚拟私有云（亚马逊 VPC）创建 [VPC](https://docs.aws.amazon.com/vpc/latest/userguide/configure-your-vpc.html) 和[子网](https://docs.aws.amazon.com/vpc/latest/userguide/configure-subnets.html)。
+ 使用 [Amazon EventBridge 计划程序](https://docs.aws.amazon.com/eventbridge/latest/userguide/using-eventbridge-scheduler.html)启动抓取过程。
+ 使用作业和作业[队列管理 Web 爬虫 AWS Batch[作](https://docs.aws.amazon.com/batch/latest/userguide/jobs.html)业](https://docs.aws.amazon.com/batch/latest/userguide/job_queues.html)。
+ 使用以下解决方案之一来运行 Web 爬网程序作业：
  + 亚马逊弹性容器服务 (Amazon ECS) Container Service 容器开启 [AWS Fargate](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html)
  + [亚马逊弹性计算云 (Amazon EC2) 实例](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Instances.html)
**注意**  
如果您的应用程序可以应对中断，请考虑通过竞价型[队列使用 Amazon EC2 竞价](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/work-with-spot-fleets.html)[型实例](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html)。竞价型实例队列可以帮助您显著节省计算成本。
  + AWS Lambda [函数](https://docs.aws.amazon.com/lambda/latest/dg/lambda-functions.html)
+ [将检索到的数据和原始文件存储在亚马逊简单存储服务 (Amazon S3) 存储桶中。](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html)