将工作负载迁移到亚马逊云科技

数据迁移
云迁移
Amazon Glue
0
0
<!--StartFragment--> ## 将工作负载迁移到AWS Glue [AWS Glue](http://aws.amazon.com/glue/) 是一项无服务器数据集成服务,可让使用分析功能的用户轻松发现、准备、移动和集成来自多个来源的数据。它包括用于编写、运行任务和编排工作流程的工具。通过使用 AWS Glue,您可以发现并连接到 70 多个不同的数据来源,并在集中式数据目录中管理您的数据。您可以直观地创建、运行和监控“提取、转换、加载(ETL)”管道,以将数据加载到数据湖中。此外,您可以使用 Amazon Athena、Amazon EMR 和 Amazon Redshift Spectrum 立即搜索和查询已编目数据。 我们建议将您的AWS Data Pipeline工作负载迁移AWS Glue到: * 您正在寻找一种支持各种数据源、创作界面(包括可视化编辑器和笔记本电脑)以及高级数据管理功能(例如数据质量和敏感数据检测)的无服务器数据集成服务。 * 你的工作负载可以迁移到AWS Glue工作流程、作业(在 Python 或 Apache Spark 中)和爬虫(例如,你的现有管道是在 Apache Spark 之上构建的)。 * 您需要一个能够处理数据管道所有方面的单一平台,包括摄取、处理、传输、完整性测试和质量检查。 * 您的现有管道是使用AWS Data Pipeline控制台上的预定义模板创建的,例如将 DynamoDB 表导出到 Amazon S3,您正在寻找相同用途的模板。 * 你的工作负载不依赖于 Apache Hive 等特定的 Hadoop 生态系统应用程序。 * 您的工作负载不需要协调本地服务器。 AWS按小时费率(按秒计费)收取执行爬网程序(发现数据)和 ETL 任务(处理和加载数据)的费用。 AWS GlueStudio 是内置的AWS Glue资源编排引擎,不收取额外费用。在 “定价” 中了解有关定[AWS Glue价](http://aws.amazon.com/glue/pricing/)的更多信息。 ## 将工作负载迁移到Step Functions [AWSStep Functi](http://aws.amazon.com/step-functions/) ons 是一项无服务器编排服务,让您能够为业务关键型应用程序构建工作流程。借助 Step Functions,您可以使用可视化编辑器构建工作流程,并直接与 250 多种AWS服务(例如 AWS Lambda、Amazon EMR、DynamoDB 等)的 11,000 多个操作集成。您可以使用 Step Functions 来协调数据处理管道、处理错误和处理底层AWS服务的限制限制。您可以创建处理和发布机器学习模型、编排微服务以及控制AWS服务的工作流程,例如创建提取AWS Glue、转换和加载 (ETL) 工作流程。您还可以为需要人工交互的应用程序创建长时间运行的自动化工作流程。 与之类似AWS Data Pipeline,AWSStep Functions 是提供的一项完全托管的服务AWS。您无需管理基础架构、补丁工作人员、管理操作系统版本更新或类似操作。 我们建议在以下情况下将您的AWS Data Pipeline工作负载迁移到AWS Step Functions: * 您正在寻找无服务器、高度可用的工作流程编排服务。 * 您正在寻找一种经济实惠的解决方案,该解决方案可以按单个任务执行的粒度收费。 * 您的工作负载正在为多个其他AWS服务(例如亚马逊 EMR、Lambda 或 DynamoDB)编排任务。AWS Glue * 你正在寻找一种低代码解决方案,该解决方案带有 drag-and-drop 可视化设计器来创建工作流程,不需要学习新的编程概念。 * 您正在寻找一种服务,该服务可与 250 多种其他AWS服务集成,涵盖超过 11,000 项操作 out-of-the-box,并允许与自定义非AWS服务和活动集成。 AWS Data Pipeline和Step Functions 都使用 JSON 格式来定义工作流程。这允许将您的工作流程存储在源代码控制中,管理版本,控制访问并使用 CI/CD 实现自动化。Step Functions 使用一种名为 Amazon State Language 的语法,该语法完全基于 JSON,允许在工作流程的文本和视觉表现之间实现无缝过渡。 通过 Step Functions,您可以选择与您当前使用的相同版本的 Amazon EMRAWS Data Pipeline。 要迁移AWS Data Pipeline托管资源上的活动,您可以在 Step Functions 上使用 [AWSSDK 服务集成](https://docs.aws.amazon.com/step-functions/latest/dg/supported-services-awssdk.html)来自动配置和清理资源。 要迁移本地服务器、用户管理的 EC2 实例或用户管理的 EMR 集群上的活动,您可以将 [SSM 代理](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-prereqs.html)安装到该实例。您可以通过 Step Function [AWSs 中的系统管理器运行命令](https://docs.aws.amazon.com/systems-manager/latest/userguide/execute-remote-commands.html)启动命令。您也可以从 [Amazon](http://aws.amazon.com/eventbridge/) 中定义的时间表启动状态机 EventBridge。 AWSStep Functions 有两种类型的工作流程:标准工作流和快速工作流程。对于标准工作流程,根据运行应用程序所需的状态转换次数向您收费。对于 Express Workflow,将根据工作流程的请求数量及其持续时间向您收费。在 [AWSStep Functions 定价中了解有关定价](http://aws.amazon.com/step-functions/pricing/)的更多信息。 ## 将工作负载迁移到亚马逊 MWAA [Amazon MWAA](http://aws.amazon.com/managed-workflows-for-apache-airflow/)(适用于 Apache Airflow 的托管式编排服务)是一项适用于 [Apache Air](https://airflow.apache.org/) flow 的托管式编排服务,让您能够更轻松地在云中大规模设置和操作 end-to-end 数据管道。Apache Airflow 是一种开源工具,用于以编程方式编写、安排和监控被称为 “工作流程” 的流程和任务序列。借助 Amazon MWAA,您可以使用 Airflow 和 Python 编程语言来创建工作流程,而无需管理底层基础设施以实现可扩展性、可用性和安全性。Amazon MWAA 会自动扩展其工作流程执行能力以满足您的需求,并与AWS安全服务集成,可帮助您快速、安全地访问数据。 与之类似AWS Data Pipeline,亚马逊 MWAA 是由 Amazon 提供的完全托管的服务AWS。虽然您需要学习一些特定于这些服务的新概念,但您无需管理基础架构、补丁工作人员、管理操作系统版本更新或类似内容。 我们建议在以下情况下将您的AWS Data Pipeline工作负载迁移到 Amazon MWAA: * 您正在寻找一种高度可用的托管服务来协调用 Python 编写的工作流程。 * 你想过渡到完全托管的、被广泛采用的开源技术 Apache Airflow,以最大限度地提高便携性。 * 您需要一个能够处理数据管道所有方面的单一平台,包括摄取、处理、传输、完整性测试和质量检查。 * 您正在寻找一种专为数据管道编排而设计的服务,该服务具有丰富的用户界面以实现可观察性、工作流程失败时重启、回填和任务重试等功能。 * 您正在寻找一项包含 800 多个预建操作员和传感器的服务AWS,涵盖和非AWS服务。 Amazon MWAA 工作流程被定义为使用 Python 的有向无环图 (DAG),因此您也可以将其视为源代码。Airflow 的可扩展 Python 框架使您能够构建与几乎任何技术连接的工作流程。它带有丰富的用户界面,用于查看和监控工作流程,并且可以轻松地与版本控制系统集成以自动执行 CI/CD 流程。 使用 Amazon MWAA,您可以选择与您当前使用的相同版本的 Amazon EMRAWS Data Pipeline。 AWS按您的 Airflow 环境运行时间收费,外加任何额外的auto 扩展以提供更多工作线程或 Web 服务器容量。有关定价的更多信息,请参阅《[适用于 Apache Airflow 定价](http://aws.amazon.com/managed-workflows-for-apache-airflow/pricing/)的更多信息。 ## 映射概念 下表包含服务使用的主要概念的映射。它将帮助熟悉Data Pipeline 的人理解Step Functions 和 MWAA 术语。 | Data Pipeline | 连接词 | Step Functions | Amazon MWAA | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 管道 | [工作流程](https://docs.aws.amazon.com/glue/latest/dg/workflows_overview.html) | [工作流程](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-standard-vs-express.html) | [直接亚克力图](https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/dags.html) | | 管道定义 JSON | [工作流程定义](https://docs.aws.amazon.com/glue/latest/dg/creating_running_workflows.html)或[基于 Python 的蓝图](https://docs.aws.amazon.com/glue/latest/dg/blueprints-overview.html) | [亚马逊州语言 JSON](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html) | [基于 Python](https://airflow.apache.org/docs/apache-airflow/stable/tutorial/fundamentals.html#example-pipeline-definition) | | 活动 | [作业](https://docs.aws.amazon.com/glue/latest/dg/etl-jobs-section.html) | [状态](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-states.html)和[任务](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html) | [任务](https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/tasks.html)([操作员](https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/operators.html)和[传感器](https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/sensors.html)) | | 实例 | [Job 运行](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-jobs-runs.html) | [处决](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-executions.html) | [DAG 运行](https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/dag-run.html) | | Attempts | 重试尝试 | [捕手和寻回犬](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html) | [重试](https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/dags.html#default-arguments) | | 管道时间表 | [调度触发器](https://docs.aws.amazon.com/glue/latest/dg/about-triggers.html) | [EventBridge 调度器任务](https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html) | [Cron](https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/timezone.html)、[时间表](https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/timetable.html)、[数据感知](https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/datasets.html) | | 管道表达式和函数 | [蓝图库](https://docs.aws.amazon.com/glue/latest/dg/developing-blueprints-overview.html) | [Step Functions 内部函数](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html)和 [AWSLambda](https://docs.aws.amazon.com/step-functions/latest/dg/use-cases-data-processing.html) | [可扩展的 Python 框架](https://airflow.apache.org/docs/apache-airflow/stable/howto/custom-operator.html) | ## 示例 以下部分列出了公共示例,您可以参考这些示例从这些示例迁移AWS Data Pipeline到单个服务。您可以将它们作为示例,并根据您的用例对其进行更新和测试,在各个服务上构建自己的管道。 ### AWS Glue 示例 以下列表包含最常见AWS Data Pipeline用例的示例实现AWS Glue。 * [运行 Spark 任务](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-intro-tutorial.html) * [将数据从 JDBC 复制到Amazon S3(包括Ama](https://github.com/awslabs/aws-glue-blueprint-libs/tree/master/samples/jdbc_to_s3) zon Redshift ft) * [将数据从 StoragAmazon S3 Redshift)复制数据](https://github.com/awslabs/aws-glue-blueprint-libs/tree/master/samples/s3\_to_jdbc)(包括 Amazon * [将数据从 Simple Storage(Amazon S3](https://github.com/awslabs/aws-glue-blueprint-libs/tree/master/samples/s3\_to_dynamodb) * [将数据移动到 Simple 以及从中移动数据](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-redshift.html) * [跨账户、跨区域访问 DynamoDB 表](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-dynamo-db-cross-account.html) ### AWSStep Functions 示例 以下列表包含AWS Step Functions 最常见AWS Data Pipeline用例的示例实现。 * [管理亚马逊 EMR 任务](https://docs.aws.amazon.com/step-functions/latest/dg/sample-emr-job.html) * [在 Amazon EMR 无服务器上运行数据处理任务](http://aws.amazon.com/blogs/big-data/run-a-data-processing-job-on-amazon-emr-serverless-with-aws-step-functions/) * [正在运行 Hive/Pig/Hadoop 任务](https://catalog.us-east-1.prod.workshops.aws/workshops/c86bd131-f6bf-4e8f-b798-58fd450d3c44/en-US/step-functions/01-execute-step-function) * [查询大型数据集](https://docs.aws.amazon.com/step-functions/latest/dg/sample-query-large-datasets.html)(Amazon Athena、Amazon S3 等AWS Glue) * [使用Amazon Redshift ft 运行 ETL 工作流程](https://docs.aws.amazon.com/step-functions/latest/dg/sample-etl-orchestration.html) * [编排AWS Glue爬虫](http://aws.amazon.com/blogs/compute/orchestrating-aws-glue-crawlers-using-aws-step-functions/) 有关使用AWS Step Functions,请参阅其他[教程](https://docs.aws.amazon.com/step-functions/latest/dg/tutorials.html)和[示例项目](https://docs.aws.amazon.com/step-functions/latest/dg/create-sample-projects.html)。 ### 亚马逊 MWAA 样本 以下列表包含 Amazon MWAWS Data Pipeline AA 最常见用例的示例实现。 * [运行亚马逊 EMR 任务](https://catalog.us-east-1.prod.workshops.aws/workshops/795e88bb-17e2-498f-82d1-2104f4824168/en-US/workshop-2-2-2/m1-processing/emr) * [为 Apache Hive 和 Hadoop 创建自定义插件](https://docs.aws.amazon.com/mwaa/latest/userguide/samples-hive.html) * [将数据从 SRedshift mple Storage(Amazon S3](https://catalog.us-east-1.prod.workshops.aws/workshops/795e88bb-17e2-498f-82d1-2104f4824168/en-US/workshop-2-2-2/m1-processing/redshift) * [在远程 EC2 实例上执行命令行管理程序脚本](https://docs.aws.amazon.com/mwaa/latest/userguide/samples-ssh.html) * [协调混合(本地)工作流程](https://dev.to/aws/orchestrating-hybrid-workflows-using-amazon-managed-workflows-for-apache-airflow-mwaa-2boc) 请参阅有关使用 Amazon MWAA 的其他[教程](https://docs.aws.amazon.com/mwaa/latest/userguide/tutorials.html)和[示例项目](https://docs.aws.amazon.com/mwaa/latest/userguide/sample-code.html)。 <!--EndFragment-->
0
目录
关闭