Bỏ qua tới nội dung
CloudDojo
Phần 3/4 · 11 phút

Di chuyển server và database lên AWS

0/15
Từ khóa của phần nàyChọn một từ để xem nghĩa trước khi đọc

Server và database đang vận hành có thể được di chuyển lên AWS mà không cần cài đặt lại từ đầu, với downtime ngắn.

Server quản lý kho là máy ảo đã vận hành nhiều năm và không thể cài đặt lại. Quy trình di chuyển server này lên EC2 bằng Application Migration Service (MGN) gồm các bước sau:

Bước 0/3
Kho MFTECHAWSSource servercài Replication Agent
Kho có các máy ảo chạy ứng dụng. Mục tiêu: chuyển lên EC2 nguyên trạng (lift-and-shift) với downtime tối thiểu.

Database được di chuyển bằng bộ công cụ riêng. Chọn từng tình huống của MFTECH:

Giải pháp đề xuấtAWS SCT + AWS DMS

SCT chuyển đổi schema và code; DMS di chuyển dữ liệu.

Khi target table preparation mode là “Drop tables on target”, DMS chỉ tạo bảng, primary key và trong một số trường hợp unique index trên đích (basic schema migration); DMS không tự tạo secondary index, foreign key, constraint không phải primary key, giá trị mặc định của cột hay user account. Vì vậy, khi database có secondary index, foreign key và stored procedure: cùng engine thì chuyển schema bằng công cụ gốc (Oracle SQL Developer, MySQL Workbench, pgAdmin 4); khác engine thì dùng DMS Schema Conversion (tính năng của DMS) hoặc AWS SCT để chuyển đổi bảng, view, stored procedure, function, sau đó DMS di chuyển dữ liệu. Với full load + CDC, AWS khuyến nghị bỏ index và ràng buộc tham chiếu trong lúc full load, sau đó tạm dừng task trước pha CDC để tạo secondary index và ràng buộc tham chiếu rồi mới tiếp tục.

Với database Oracle tại kho, MFTECH cần chuyển dữ liệu hiện có sang RDS for Oracle và tiếp tục đồng bộ các giao dịch mới cho tới ngày chuyển đổi; khối lượng thay đổi biến động mạnh trong ngày. Chạy từng bước của một DMS Serverless replication:

Bước 0/4
Kho MFTECHAWSOracleredo log
Oracle tại kho vẫn tiếp nhận phiếu nhập hàng. Mục tiêu: RDS for Oracle có đủ dữ liệu cũ và liên tục nhận thay đổi mới, không phải chọn kích thước replication instance.
Xem server quản lý kho chuyển lên EC2 bằng Application Migration Service, và database Oracle chuyển lên RDS bằng DMS Serverless.

Các phương án khác đều thiếu một phần của yêu cầu. DMS Standard dùng replication instance (EC2 instance do DMS tạo trong VPC): người vận hành phải ước lượng capacity, chọn instance class và thay đổi kích thước khi tải thay đổi, đúng những tác vụ mà DMS Serverless loại bỏ; replication instance cũng không phải EC2 instance thuộc Auto Scaling group của MFTECH để gắn scaling policy. AWS Glue (ETL) và Lambda không có sẵn cơ chế đọc redo log của Oracle để sao chép thay đổi theo transaction; MFTECH sẽ phải tự xây dựng phần ghi nhận thay đổi.

Ghi nhớ:
  • Server: MGN (agent → test → cutover).
  • Database khác engine: SCT (hoặc DMS Schema Conversion) + DMS; DMS chỉ tạo bảng và primary key, không tạo secondary index, foreign key hay stored procedure.
  • SQL Server sang Aurora PostgreSQL với mức thay đổi code tối thiểu: Babelfish.
  • Dữ liệu hiện có và thay đổi liên tục: migration type full load + CDC (DMS đọc transaction log của nguồn).
  • Khối lượng thay đổi biến động, không muốn chọn kích thước replication instance: DMS Serverless (tự scale trong khoảng Min–Max DCU).
Part 3/4 · 11 phút

Migrating servers and databases to AWS

0/13
Từ khóa của phần nàyChọn một từ để xem nghĩa trước khi đọc

Running servers and databases can be migrated to AWS without being reinstalled, with only a short downtime.

The warehouse management server is a virtual machine that has been running for many years and cannot be reinstalled. Migrating this server to EC2 with Application Migration Service (MGN) takes the following steps:

Bước 0/3
MFTECH warehouseAWSSource serverReplication Agent installed
The warehouse has virtual machines running applications. Goal: move them to EC2 as is (lift-and-shift) with minimal downtime.

Databases are migrated with a separate set of tools. Choose each MFTECH scenario:

Giải pháp đề xuấtAWS SCT + AWS DMS

SCT converts the schema and code; DMS migrates the data.

With the “Drop tables on target” target table preparation mode, DMS creates only tables, primary keys and in some cases unique indexes on the target (basic schema migration); DMS does not create secondary indexes, foreign keys, nonprimary key constraints, column data defaults or user accounts. So when a database has secondary indexes, foreign keys and stored procedures: for the same engine, migrate the schema with native tools (Oracle SQL Developer, MySQL Workbench, pgAdmin 4); for a different engine, use DMS Schema Conversion (a DMS feature) or AWS SCT to convert tables, views, stored procedures and functions, then DMS migrates the data. For full load + CDC, AWS recommends leaving out indexes and referential integrity constraints during the full load, then pausing the task before the CDC phase to build the secondary indexes and referential integrity constraints before resuming.

For the Oracle database at the warehouse, MFTECH must move the existing data to RDS for Oracle and keep replicating new transactions until the cutover date; the volume of changes fluctuates strongly during the day. Run each step of a DMS Serverless replication:

Bước 0/4
MFTECH warehouseAWSOracleredo log
The warehouse Oracle database still receives goods receipts. Goal: RDS for Oracle holds all existing data and keeps receiving new changes, without sizing a replication instance.
Xem server quản lý kho chuyển lên EC2 bằng Application Migration Service, và database Oracle chuyển lên RDS bằng DMS Serverless.

The other options each miss part of the requirement. DMS Standard uses a replication instance (an EC2 instance that DMS creates in a VPC): the operations team must estimate capacity, pick an instance class and resize it as the load changes, which are exactly the tasks DMS Serverless removes; the replication instance is also not an EC2 instance in one of MFTECH’s Auto Scaling groups that could take a scaling policy. AWS Glue (ETL) and Lambda have no built-in way to read the Oracle redo logs and replicate changes transaction by transaction; MFTECH would have to build the change capture itself.

Ghi nhớ:
  • Servers: MGN (agent → test → cutover).
  • Databases with a different engine: SCT (or DMS Schema Conversion) + DMS; DMS alone creates only tables and primary keys, not secondary indexes, foreign keys or stored procedures.
  • SQL Server to Aurora PostgreSQL with minimal code changes: Babelfish.
  • Existing data plus ongoing changes: the full load + CDC migration type (DMS reads the source transaction logs).
  • A fluctuating volume of changes and no wish to size a replication instance: DMS Serverless (scales within the Min–Max DCU range).

Kiểm tra nhanh

Trả lời để ghi nhận đã đọc phần này. Câu trả lời sai sẽ được nhắc ôn lại vào những ngày sau.

MFTECH chuyển database Oracle sang Aurora PostgreSQL và cần giữ secondary index, foreign key và stored procedure. Kết hợp nào phù hợp?
Oracle tại kho cần chuyển dữ liệu hiện có và tiếp tục đồng bộ giao dịch mới sang RDS; khối lượng thay đổi biến động và đội vận hành không muốn chọn kích thước replication instance. Chọn gì?

Đã trả lời 0/2 câu