Resize Amazon Redshift from DC2 to RA3 with minimal or no downtime

海外精选
海外精选的内容汇集了全球优质的亚马逊云科技相关技术内容。同时,内容中提到的“AWS” 是 “Amazon Web Services” 的缩写,在此网站不作为商标展示。
0
0
{"value":"[Amazon Redshift](https://aws.amazon.com/redshift/?whats-new-cards.sort-by=item.additionalFields.postDateTime&whats-new-cards.sort-order=desc) is a popular cloud data warehouse that allows you to process exabytes of data across your data warehouse, operational database, and data lake using standard SQL. Amazon Redshift offers different node types like DC2 (dense compute) and RA3, which you can use for your different workloads and use cases. For more information about the benefits of migrating from DS2 to RA3, refer to [Scale your cloud data warehouse and reduce costs with the new Amazon Redshift RA3 nodes with managed storage ](https://aws.amazon.com/blogs/big-data/scale-your-cloud-data-warehouse-and-reduce-costs-with-the-new-amazon-redshift-ra3-nodes-with-managed-storage/)and [Amazon Redshift Benchmarking: Comparison of RA3 vs. DS2 Instance Types.](https://aws.amazon.com/blogs/apn/amazon-redshift-benchmarking-comparison-of-ra3-vs-ds2-instance-types/)\n\nMany customers use DC2 nodes for their compute-intensive workloads. It’s natural to scale with your growing workload, namely separating compute from storage so they’re right-sized as per your needs. RA3 nodes with managed storage enable you to optimize your data warehouse by scaling and paying for compute and managed storage independently. Amazon Redshift managed storage uses large, high-performance SSDs in each RA3 node for fast local storage and Amazon S3 for longer-term durable storage. If the data in a node grows beyond the size of the large local SSDs, Amazon Redshift managed storage automatically offloads that data to Amazon S3. RA3 nodes keep track of the frequency of access for each data block and cache the hottest blocks. If the blocks aren’t cached, the large networking bandwidth and precise storing techniques return the data in sub-seconds. Also, if you’re looking for features like cross-cluster data sharing and cross-Availability Zone cluster relocation, these are a few of the reasons for migrating to RA3. Many customers on DC2 have benefitted from migrating to RA3 to serve their growing performance requirements and business use cases.\n\nAs a first step of the migration, we always recommend finding the correct load of your system and determining the number of RA3 nodes that will meet your workload and give you the best cost-performance benefit. For this evaluation, you can use the simple Replay tool to conduct a what-if analysis and evaluate how your workload performs in different scenarios. For example, you can use the tool to benchmark your actual workload on a new instance type like RA3, evaluate a new feature, or assess different cluster configurations. To choose the right cluster type, you can [compare different node types for your workload ](https://aws.amazon.com/blogs/big-data/compare-different-node-types-for-your-workload-using-amazon-redshift/)and [choose the right configuration of RA3 with the Simple Replay utility.](https://aws.amazon.com/blogs/big-data/simplify-amazon-redshift-ra3-migration-evaluation-with-simple-replay-utility/)\n\nOnce you know the cluster type and nodes, the next question is how to [migrate your current workload to RA3](https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html#rs-upgrading-to-ra3) with minimum downtime or without disrupting your current workload. In this post, we describe an approach to do this with minimum downtime.\n\n#### **Resizing an Amazon Redshift cluster**\n\n- There are three ways to resize or migrate an Amazon Redshift cluster from DC2 to RA3 :\n- [Elastic resize](https://docs.aws.amazon.com/redshift/latest/mgmt/rs-resize-tutorial.html#elastic-resize) – If it’s available as an option, use elastic resize to change the node type, number of nodes, or both. Note that when you only change the number of nodes, the queries are temporarily paused and connections are kept open. An elastic resize can take between 10–15 minutes. During a resize operation, the cluster is read-only.\n- [Classic resize](https://docs.aws.amazon.com/redshift/latest/mgmt/rs-resize-tutorial.html#classic-resize) – Use classic resize to change the node type, number of nodes, or both. Choose this option when you’re resizing to a configuration that isn’t available through elastic resize. A resize operation can take 2 hours or more, or last up to several days depending on your data size. During the resize operation, the source cluster is read-only.\n- [Snapshot, restore, and resize](https://docs.aws.amazon.com/redshift/latest/mgmt/rs-resize-tutorial.html#rs-tutorial-snapshot-restore-resize-overview) – To keep your cluster available during a classic resize, make a copy of the existing cluster, then resize the new cluster. If data is written to the source cluster after a snapshot is taken, the data must be manually copied over after the migration is complete.\n\n#### **Checkpoints for resize**\n\nWhen a cluster is resized using elastic resize with the same node type, the operation doesn’t create a new cluster. As a result, the operation completes quickly. In case of resize, there could be one or more challenges causing the delay in resize:\n\n- **Data volumes** – The time required to complete a classic resize or a snapshot and restore operation might vary, depending on factors like the workload on the source cluster, the number and volume of tables being transformed, how evenly data is distributed across the compute nodes and slices, and the node configuration in the source and target clusters.\n- **Snapshots** – Automated snapshots are automatically deleted when their retention period expires, when you disable automated snapshots, or when you delete a cluster. If you want to keep an automated snapshot, you can copy it to a manual snapshot. You can take a manual snapshot of the cluster before the migration, which is used for resize operations, but it may not include live data from the time the snapshot was captured.\n- **Cluster unavailable during resize** – It’s critical to know roughly how long the resize will take. To do so, you can try creating a cluster from the snapshot in a test account. However, this only gives a ballpark idea because resize times can vary, especially if you intend to query your cluster during the resize. If the cluster is live almost all the time with minimal or zero non-business hours, a resize can be a challenge because the cluster can’t upsert live data and serve read requests on this data during this window.\n- **Cluster endpoint retention** – Elastic resize and cluster resize allow you to change the node type, number of nodes, or both, but the endpoint is retained. With snapshot resize, a new cluster endpoint is created, which may require a change in your application to replace the endpoint.\n- **Reconciliation** – Validate the target cluster data with the source to make sure migration was completed without data loss and ensure data quality. Reconciliation at the table level isn’t sufficient, you need to ensure records have also been copied from the source. You can run a matching record count check followed by data validation using checksum for accuracy of data.\n\n#### **Solution overview**\n\nThe steps to prepare for migration are as follows:\n\n1.Take a snapshot of the existing production Amazon Redshift cluster running on DC2.\n2.Create another [Amazon Simple Storage Service](http://aws.amazon.com/s3) (Amazon S3) bucket, where [AWS Glue](https://aws.amazon.com/glue) writes the curated data in parallel.\n3.Use the snapshot to create an RA3 cluster.\n4.Configure [AWS Database Migration Service](https://aws.amazon.com/dms/) (AWS DMS) to load data from the migrated bucket to Amazon S3.\n5.After you confirm that the data is synced between the two clusters (DC and RA3) and all other downstream applications, stop the DC cluster and change the endpoint of your dependent downstream application to the newly created RA3 cluster.\n\nFollowing is the current architecture depicting a live workload.\n\n![image.png](https://dev-media.amazoncloud.cn/47f2927cc748460db6d20c45d3c06fa8_image.png)\n\nIn this solution, data comes from three source systems and are written into a raw S3 bucket:\n- Change data capture (CDC) from an RDS instance via AWS DMS (1 in the preceding diagram)\n- Events captured via an external API (2)\n- CSV files from an external source copied to the raw bucket (3)\n\nThese sources don’t have a pattern or an interval of pushing new data.\n\nEvery few minutes, the ingested data is picked up by an S3 event trigger to run an [AWS Glue workflow](https://docs.aws.amazon.com/glue/latest/dg/workflows_overview.html) (4 in the preceding diagram). It provides an orchestration layer to manage and run jobs and crawlers. This workflow includes a crawler (5) that updates the metadata schema and partitions of the dataset to the AWS Glue Data Catalog. Then the crawler triggers an AWS Glue job that writes the curated data to the S3 curated bucket. From there, another [AWS Glue job uploads data into Amazon Redshift](https://catalog.us-east-1.prod.workshops.aws/workshops/44c91c21-a6a4-4b56-bd95-56bd443aa449/en-US/lab-guide/redshift) (6).\n\nIn this scenario, if your workload is critical and you can’t afford a long downtime, then you need to plan your migration accordingly.\n\n##### **Dual write and transient data curation pipeline**\n\nAs a first step of the migration, you need a parallel data process pipeline as the AWS Glue job, which writes the data into the curated S3 bucket. Create another S3 bucket and name it ```migrated-curated-bucket``` and modify the AWS Glue transform job. You can also replicate another transform job to write data to a new reserve S3 bucket in parallel.\n\nIn this scenario, live data ingestion occurs every 30 minutes. When an iteration of the extract, transform, and load (ETL) job is complete, this triggers a manual snapshot of the Amazon Redshift cluster. After the snapshot is captured, a new Amazon Redshift cluster is created using that snapshot. Cluster creation time can vary depending on the snapshot volume.\n\nIf snapshot creation takes more than 30 minutes, then the ETL job should be stopped, and resume after the snapshot creation is complete. For example, if the ETL job is triggered at 8:00 AM and finishes at 8:10 AM, then snapshot creation starts at 8:10 AM. If it finishes by 8:30 AM (the next ETL job will run at 8:30 AM as per the half-hour interval), then the ETL process continues according to the schedule. Otherwise, the job stops, and resumes after the snapshot completion.\n\nNow we use the snapshot to launch a new RA3 redshift cluster. The process doesn’t pause the existing ETL pipeline, rather it starts writing curated data in parallel to the reserve S3 bucket. The following diagram illustrates this updated workflow.\n\n![image.png](https://dev-media.amazoncloud.cn/569b5f17432f4f22ab347c78105df157_image.png)\n\nAt this point, the existing cluster is still live and continues to process the live workload. Even if creation of the Amazon Redshift cluster takes time (owing to the huge volume of data), you should still be covered. The curated data in the S3 bucket acts as a staging reserve, and this data should be loaded into the RA3 cluster after its cluster is launched.\n\n### **Backfill the new RA3 cluster with missing data**\n\nAfter the RA3 cluster has been launched, you need to playback the captured live data from the reserve S3 bucket to the newly created cluster. Playback is only for the duration of the snapshot capture to the current timestamp. With this process, you’re trying to bring the RA3 cluster in sync with the existing live DC2 cluster.\n\nYou need to configure an AWS DMS migration task with the reserve S3 bucket as the [source endpoint](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.S3.html) and the newly created RA3 cluster as the [target endpoint](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Redshift.html).\n\nAWS DMS captures ongoing changes to the target data store. This process is called ongoing replication or change data capture (CDC). AWS DMS uses this process when replicating ongoing changes from a source data store. This process works by collecting changes to the database logs using the database engine’s native API. The following diagram illustrates this workflow.\n\n![image.png](https://dev-media.amazoncloud.cn/d73e2bce70644be69d3118747d43dd0b_image.png)\n\n#### **Reconciliation and cutover**\n\nData reconciliation is the process of verification of data between source and target. In this process, target data is compared with source data to ensure that the data is transferred completely without any alterations. To ensure reliability in the pipeline and the data processed, you should create an end-to-end reconciliation report. This report verifies the percentage of matching tables, columns, and data records. It also identifies missing records, missing values, incorrect values, badly formatted values, and duplicated records.\n\nYou can define the reconciliation process to check whether both clusters are running in sync. For that you can create simple Python scripts or shell scripts to query the source and target clusters, fetch the results, and compare.\n\nCutover is the final step of migration, and involves switching the existing cluster with the newly launched cluster. At this point, the clusters are running in parallel. Next, you validate that the downstream data consumption flows are up to date. Verify the reconciliation metrics from the DC2 and RA3 clusters such that table updates are in sync.\n\nYou can keep dual write while you switch from the migration data pipeline. If you discover any issues after cutting over, you can switch back to the old data pipeline, which is the source of truth until cutover. In this case, cutover involves updating the DC2 cluster endpoint to the new RA3 cluster endpoint in the application. Make sure to identify a relatively quiet window during the day to update the endpoint. To keep the same endpoint for your applications and users, you can rename the new RA3 cluster with the same name as the original DC2 cluster. To rename the cluster, modify the cluster in the Amazon Redshift console or ModifyCluster API operation. For more information, see [Renaming clusters](https://github.com/awsdocs/amazon-redshift-management-guide/blob/master/doc_source/managing-cluster-operations.md#rs-mgmt-rename-cluster) or [ModifyCluster API operation](https://docs.aws.amazon.com/redshift/latest/APIReference/API_ModifyCluster.html) in the [Amazon Redshift API Reference](https://docs.aws.amazon.com/redshift/latest/APIReference/Welcome.html).\n\nUp to this point, AWS DMS is continuing to update RA3. After you cut over to RA3, the DC2 cluster is no longer live and you can stop the AWS DMS replication job to RA3. Pause the last snapshot. Delete the reserve S3 bucket and AWS DMS resources used for RA3 load.\n\n#### **Conclusion**\n\nIn this post, we presented an approach to migrate an existing Amazon Redshift cluster with minimal to no data loss, which also allows the cluster to serve both read and write operations during the resize window. Elastic resize is a quick way to resize your cluster to maintain the same number of slices in the target cluster. Slice mapping reduces the time required to resize a cluster. If you choose a resize configuration that isn’t available on elastic resize, you can choose classic resize or perform a snapshot, restore, and resize.\n\nTo learn more about what’s new with RA3 instances, refer to [Amazon Redshift RA3 instances with managed storage](https://aws.amazon.com/redshift/features/ra3/#:~:text=The%20new%20RA3%20instances%20with,only%20for%20what%20you%20use.). Amazon Redshift delivers better price performance and at the same time helps you keep your costs predictable. [Amazon Redshift Serverless](https://aws.amazon.com/redshift/redshift-serverless/) automatically provisions and scales the data warehouse capacity to deliver high performance for demanding and unpredictable workloads, and you pay only for the resources you use. This provides greater flexibility to choose either or both based on custom requirements. After you’ve made your choice, try the [hands-on labs](https://catalog.us-east-1.prod.workshops.aws/workshops/9f29cdba-66c0-445e-8cbb-28a092cb5ba7/en-US/) on Amazon Redshift.\n\n#### **About the Authors**\n\n![image.png](https://dev-media.amazoncloud.cn/d2f3bebc881c4654bc4aabbb6f5e9e20_image.png)\n\n**Soujanya Konka** is a Solutions Architect and Analytics specialist at AWS, focused on helping customers build their ideas on cloud. Expertise in design and implementation of business information systems and Data warehousing solutions. Before joining AWS, Soujanya has had stints with companies such as HSBC, Cognizant.\n\n![image.png](https://dev-media.amazoncloud.cn/5e74d04c34c74d84a20778b2a5c551f9_image.png)\n\n**Dipayan Sarkar** is a Specialist Solutions Architect for Analytics at AWS, where he helps customers to modernise their data platform using AWS Analytics services. He works with customer to design and build analytics solutions enabling business to make data-driven decisions.","render":"<p><a href=\"https://aws.amazon.com/redshift/?whats-new-cards.sort-by=item.additionalFields.postDateTime&amp;whats-new-cards.sort-order=desc\" target=\"_blank\">Amazon Redshift</a> is a popular cloud data warehouse that allows you to process exabytes of data across your data warehouse, operational database, and data lake using standard SQL. Amazon Redshift offers different node types like DC2 (dense compute) and RA3, which you can use for your different workloads and use cases. For more information about the benefits of migrating from DS2 to RA3, refer to <a href=\"https://aws.amazon.com/blogs/big-data/scale-your-cloud-data-warehouse-and-reduce-costs-with-the-new-amazon-redshift-ra3-nodes-with-managed-storage/\" target=\"_blank\">Scale your cloud data warehouse and reduce costs with the new Amazon Redshift RA3 nodes with managed storage </a>and <a href=\"https://aws.amazon.com/blogs/apn/amazon-redshift-benchmarking-comparison-of-ra3-vs-ds2-instance-types/\" target=\"_blank\">Amazon Redshift Benchmarking: Comparison of RA3 vs. DS2 Instance Types.</a></p>\n<p>Many customers use DC2 nodes for their compute-intensive workloads. It’s natural to scale with your growing workload, namely separating compute from storage so they’re right-sized as per your needs. RA3 nodes with managed storage enable you to optimize your data warehouse by scaling and paying for compute and managed storage independently. Amazon Redshift managed storage uses large, high-performance SSDs in each RA3 node for fast local storage and Amazon S3 for longer-term durable storage. If the data in a node grows beyond the size of the large local SSDs, Amazon Redshift managed storage automatically offloads that data to Amazon S3. RA3 nodes keep track of the frequency of access for each data block and cache the hottest blocks. If the blocks aren’t cached, the large networking bandwidth and precise storing techniques return the data in sub-seconds. Also, if you’re looking for features like cross-cluster data sharing and cross-Availability Zone cluster relocation, these are a few of the reasons for migrating to RA3. Many customers on DC2 have benefitted from migrating to RA3 to serve their growing performance requirements and business use cases.</p>\n<p>As a first step of the migration, we always recommend finding the correct load of your system and determining the number of RA3 nodes that will meet your workload and give you the best cost-performance benefit. For this evaluation, you can use the simple Replay tool to conduct a what-if analysis and evaluate how your workload performs in different scenarios. For example, you can use the tool to benchmark your actual workload on a new instance type like RA3, evaluate a new feature, or assess different cluster configurations. To choose the right cluster type, you can <a href=\"https://aws.amazon.com/blogs/big-data/compare-different-node-types-for-your-workload-using-amazon-redshift/\" target=\"_blank\">compare different node types for your workload </a>and <a href=\"https://aws.amazon.com/blogs/big-data/simplify-amazon-redshift-ra3-migration-evaluation-with-simple-replay-utility/\" target=\"_blank\">choose the right configuration of RA3 with the Simple Replay utility.</a></p>\n<p>Once you know the cluster type and nodes, the next question is how to <a href=\"https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html#rs-upgrading-to-ra3\" target=\"_blank\">migrate your current workload to RA3</a> with minimum downtime or without disrupting your current workload. In this post, we describe an approach to do this with minimum downtime.</p>\n<h4><a id=\"Resizing_an_Amazon_Redshift_cluster_8\"></a><strong>Resizing an Amazon Redshift cluster</strong></h4>\n<ul>\n<li>There are three ways to resize or migrate an Amazon Redshift cluster from DC2 to RA3 :</li>\n<li><a href=\"https://docs.aws.amazon.com/redshift/latest/mgmt/rs-resize-tutorial.html#elastic-resize\" target=\"_blank\">Elastic resize</a> – If it’s available as an option, use elastic resize to change the node type, number of nodes, or both. Note that when you only change the number of nodes, the queries are temporarily paused and connections are kept open. An elastic resize can take between 10–15 minutes. During a resize operation, the cluster is read-only.</li>\n<li><a href=\"https://docs.aws.amazon.com/redshift/latest/mgmt/rs-resize-tutorial.html#classic-resize\" target=\"_blank\">Classic resize</a> – Use classic resize to change the node type, number of nodes, or both. Choose this option when you’re resizing to a configuration that isn’t available through elastic resize. A resize operation can take 2 hours or more, or last up to several days depending on your data size. During the resize operation, the source cluster is read-only.</li>\n<li><a href=\"https://docs.aws.amazon.com/redshift/latest/mgmt/rs-resize-tutorial.html#rs-tutorial-snapshot-restore-resize-overview\" target=\"_blank\">Snapshot, restore, and resize</a> – To keep your cluster available during a classic resize, make a copy of the existing cluster, then resize the new cluster. If data is written to the source cluster after a snapshot is taken, the data must be manually copied over after the migration is complete.</li>\n</ul>\n<h4><a id=\"Checkpoints_for_resize_15\"></a><strong>Checkpoints for resize</strong></h4>\n<p>When a cluster is resized using elastic resize with the same node type, the operation doesn’t create a new cluster. As a result, the operation completes quickly. In case of resize, there could be one or more challenges causing the delay in resize:</p>\n<ul>\n<li><strong>Data volumes</strong> – The time required to complete a classic resize or a snapshot and restore operation might vary, depending on factors like the workload on the source cluster, the number and volume of tables being transformed, how evenly data is distributed across the compute nodes and slices, and the node configuration in the source and target clusters.</li>\n<li><strong>Snapshots</strong> – Automated snapshots are automatically deleted when their retention period expires, when you disable automated snapshots, or when you delete a cluster. If you want to keep an automated snapshot, you can copy it to a manual snapshot. You can take a manual snapshot of the cluster before the migration, which is used for resize operations, but it may not include live data from the time the snapshot was captured.</li>\n<li><strong>Cluster unavailable during resize</strong> – It’s critical to know roughly how long the resize will take. To do so, you can try creating a cluster from the snapshot in a test account. However, this only gives a ballpark idea because resize times can vary, especially if you intend to query your cluster during the resize. If the cluster is live almost all the time with minimal or zero non-business hours, a resize can be a challenge because the cluster can’t upsert live data and serve read requests on this data during this window.</li>\n<li><strong>Cluster endpoint retention</strong> – Elastic resize and cluster resize allow you to change the node type, number of nodes, or both, but the endpoint is retained. With snapshot resize, a new cluster endpoint is created, which may require a change in your application to replace the endpoint.</li>\n<li><strong>Reconciliation</strong> – Validate the target cluster data with the source to make sure migration was completed without data loss and ensure data quality. Reconciliation at the table level isn’t sufficient, you need to ensure records have also been copied from the source. You can run a matching record count check followed by data validation using checksum for accuracy of data.</li>\n</ul>\n<h4><a id=\"Solution_overview_25\"></a><strong>Solution overview</strong></h4>\n<p>The steps to prepare for migration are as follows:</p>\n<p>1.Take a snapshot of the existing production Amazon Redshift cluster running on DC2.<br />\n2.Create another <a href=\"http://aws.amazon.com/s3\" target=\"_blank\">Amazon Simple Storage Service</a> (Amazon S3) bucket, where <a href=\"https://aws.amazon.com/glue\" target=\"_blank\">AWS Glue</a> writes the curated data in parallel.<br />\n3.Use the snapshot to create an RA3 cluster.<br />\n4.Configure <a href=\"https://aws.amazon.com/dms/\" target=\"_blank\">AWS Database Migration Service</a> (AWS DMS) to load data from the migrated bucket to Amazon S3.<br />\n5.After you confirm that the data is synced between the two clusters (DC and RA3) and all other downstream applications, stop the DC cluster and change the endpoint of your dependent downstream application to the newly created RA3 cluster.</p>\n<p>Following is the current architecture depicting a live workload.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/47f2927cc748460db6d20c45d3c06fa8_image.png\" alt=\"image.png\" /></p>\n<p>In this solution, data comes from three source systems and are written into a raw S3 bucket:</p>\n<ul>\n<li>Change data capture (CDC) from an RDS instance via AWS DMS (1 in the preceding diagram)</li>\n<li>Events captured via an external API (2)</li>\n<li>CSV files from an external source copied to the raw bucket (3)</li>\n</ul>\n<p>These sources don’t have a pattern or an interval of pushing new data.</p>\n<p>Every few minutes, the ingested data is picked up by an S3 event trigger to run an <a href=\"https://docs.aws.amazon.com/glue/latest/dg/workflows_overview.html\" target=\"_blank\">AWS Glue workflow</a> (4 in the preceding diagram). It provides an orchestration layer to manage and run jobs and crawlers. This workflow includes a crawler (5) that updates the metadata schema and partitions of the dataset to the AWS Glue Data Catalog. Then the crawler triggers an AWS Glue job that writes the curated data to the S3 curated bucket. From there, another <a href=\"https://catalog.us-east-1.prod.workshops.aws/workshops/44c91c21-a6a4-4b56-bd95-56bd443aa449/en-US/lab-guide/redshift\" target=\"_blank\">AWS Glue job uploads data into Amazon Redshift</a> (6).</p>\n<p>In this scenario, if your workload is critical and you can’t afford a long downtime, then you need to plan your migration accordingly.</p>\n<h5><a id=\"Dual_write_and_transient_data_curation_pipeline_50\"></a><strong>Dual write and transient data curation pipeline</strong></h5>\n<p>As a first step of the migration, you need a parallel data process pipeline as the AWS Glue job, which writes the data into the curated S3 bucket. Create another S3 bucket and name it <code>migrated-curated-bucket</code> and modify the AWS Glue transform job. You can also replicate another transform job to write data to a new reserve S3 bucket in parallel.</p>\n<p>In this scenario, live data ingestion occurs every 30 minutes. When an iteration of the extract, transform, and load (ETL) job is complete, this triggers a manual snapshot of the Amazon Redshift cluster. After the snapshot is captured, a new Amazon Redshift cluster is created using that snapshot. Cluster creation time can vary depending on the snapshot volume.</p>\n<p>If snapshot creation takes more than 30 minutes, then the ETL job should be stopped, and resume after the snapshot creation is complete. For example, if the ETL job is triggered at 8:00 AM and finishes at 8:10 AM, then snapshot creation starts at 8:10 AM. If it finishes by 8:30 AM (the next ETL job will run at 8:30 AM as per the half-hour interval), then the ETL process continues according to the schedule. Otherwise, the job stops, and resumes after the snapshot completion.</p>\n<p>Now we use the snapshot to launch a new RA3 redshift cluster. The process doesn’t pause the existing ETL pipeline, rather it starts writing curated data in parallel to the reserve S3 bucket. The following diagram illustrates this updated workflow.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/569b5f17432f4f22ab347c78105df157_image.png\" alt=\"image.png\" /></p>\n<p>At this point, the existing cluster is still live and continues to process the live workload. Even if creation of the Amazon Redshift cluster takes time (owing to the huge volume of data), you should still be covered. The curated data in the S3 bucket acts as a staging reserve, and this data should be loaded into the RA3 cluster after its cluster is launched.</p>\n<h3><a id=\"Backfill_the_new_RA3_cluster_with_missing_data_64\"></a><strong>Backfill the new RA3 cluster with missing data</strong></h3>\n<p>After the RA3 cluster has been launched, you need to playback the captured live data from the reserve S3 bucket to the newly created cluster. Playback is only for the duration of the snapshot capture to the current timestamp. With this process, you’re trying to bring the RA3 cluster in sync with the existing live DC2 cluster.</p>\n<p>You need to configure an AWS DMS migration task with the reserve S3 bucket as the <a href=\"https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.S3.html\" target=\"_blank\">source endpoint</a> and the newly created RA3 cluster as the <a href=\"https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Redshift.html\" target=\"_blank\">target endpoint</a>.</p>\n<p>AWS DMS captures ongoing changes to the target data store. This process is called ongoing replication or change data capture (CDC). AWS DMS uses this process when replicating ongoing changes from a source data store. This process works by collecting changes to the database logs using the database engine’s native API. The following diagram illustrates this workflow.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/d73e2bce70644be69d3118747d43dd0b_image.png\" alt=\"image.png\" /></p>\n<h4><a id=\"Reconciliation_and_cutover_74\"></a><strong>Reconciliation and cutover</strong></h4>\n<p>Data reconciliation is the process of verification of data between source and target. In this process, target data is compared with source data to ensure that the data is transferred completely without any alterations. To ensure reliability in the pipeline and the data processed, you should create an end-to-end reconciliation report. This report verifies the percentage of matching tables, columns, and data records. It also identifies missing records, missing values, incorrect values, badly formatted values, and duplicated records.</p>\n<p>You can define the reconciliation process to check whether both clusters are running in sync. For that you can create simple Python scripts or shell scripts to query the source and target clusters, fetch the results, and compare.</p>\n<p>Cutover is the final step of migration, and involves switching the existing cluster with the newly launched cluster. At this point, the clusters are running in parallel. Next, you validate that the downstream data consumption flows are up to date. Verify the reconciliation metrics from the DC2 and RA3 clusters such that table updates are in sync.</p>\n<p>You can keep dual write while you switch from the migration data pipeline. If you discover any issues after cutting over, you can switch back to the old data pipeline, which is the source of truth until cutover. In this case, cutover involves updating the DC2 cluster endpoint to the new RA3 cluster endpoint in the application. Make sure to identify a relatively quiet window during the day to update the endpoint. To keep the same endpoint for your applications and users, you can rename the new RA3 cluster with the same name as the original DC2 cluster. To rename the cluster, modify the cluster in the Amazon Redshift console or ModifyCluster API operation. For more information, see <a href=\"https://github.com/awsdocs/amazon-redshift-management-guide/blob/master/doc_source/managing-cluster-operations.md#rs-mgmt-rename-cluster\" target=\"_blank\">Renaming clusters</a> or <a href=\"https://docs.aws.amazon.com/redshift/latest/APIReference/API_ModifyCluster.html\" target=\"_blank\">ModifyCluster API operation</a> in the <a href=\"https://docs.aws.amazon.com/redshift/latest/APIReference/Welcome.html\" target=\"_blank\">Amazon Redshift API Reference</a>.</p>\n<p>Up to this point, AWS DMS is continuing to update RA3. After you cut over to RA3, the DC2 cluster is no longer live and you can stop the AWS DMS replication job to RA3. Pause the last snapshot. Delete the reserve S3 bucket and AWS DMS resources used for RA3 load.</p>\n<h4><a id=\"Conclusion_86\"></a><strong>Conclusion</strong></h4>\n<p>In this post, we presented an approach to migrate an existing Amazon Redshift cluster with minimal to no data loss, which also allows the cluster to serve both read and write operations during the resize window. Elastic resize is a quick way to resize your cluster to maintain the same number of slices in the target cluster. Slice mapping reduces the time required to resize a cluster. If you choose a resize configuration that isn’t available on elastic resize, you can choose classic resize or perform a snapshot, restore, and resize.</p>\n<p>To learn more about what’s new with RA3 instances, refer to <a href=\"https://aws.amazon.com/redshift/features/ra3/#:~:text=The%20new%20RA3%20instances%20with,only%20for%20what%20you%20use.\" target=\"_blank\">Amazon Redshift RA3 instances with managed storage</a>. Amazon Redshift delivers better price performance and at the same time helps you keep your costs predictable. <a href=\"https://aws.amazon.com/redshift/redshift-serverless/\" target=\"_blank\">Amazon Redshift Serverless</a> automatically provisions and scales the data warehouse capacity to deliver high performance for demanding and unpredictable workloads, and you pay only for the resources you use. This provides greater flexibility to choose either or both based on custom requirements. After you’ve made your choice, try the <a href=\"https://catalog.us-east-1.prod.workshops.aws/workshops/9f29cdba-66c0-445e-8cbb-28a092cb5ba7/en-US/\" target=\"_blank\">hands-on labs</a> on Amazon Redshift.</p>\n<h4><a id=\"About_the_Authors_92\"></a><strong>About the Authors</strong></h4>\n<p><img src=\"https://dev-media.amazoncloud.cn/d2f3bebc881c4654bc4aabbb6f5e9e20_image.png\" alt=\"image.png\" /></p>\n<p><strong>Soujanya Konka</strong> is a Solutions Architect and Analytics specialist at AWS, focused on helping customers build their ideas on cloud. Expertise in design and implementation of business information systems and Data warehousing solutions. Before joining AWS, Soujanya has had stints with companies such as HSBC, Cognizant.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/5e74d04c34c74d84a20778b2a5c551f9_image.png\" alt=\"image.png\" /></p>\n<p><strong>Dipayan Sarkar</strong> is a Specialist Solutions Architect for Analytics at AWS, where he helps customers to modernise their data platform using AWS Analytics services. He works with customer to design and build analytics solutions enabling business to make data-driven decisions.</p>\n"}
目录
亚马逊云科技解决方案 基于行业客户应用场景及技术领域的解决方案
联系亚马逊云科技专家
亚马逊云科技解决方案
基于行业客户应用场景及技术领域的解决方案
联系专家
0
目录
关闭
contact-us