SlideShare a Scribd company logo
데이터 마이그레이션 AWS와 같이 하기
김일호 | Solutions Architect
AWS Global Infrastructure yesterday
Region
Edge	Location
11 Regions
30 Availability	Zones
54 Edge	Locations
Need	to	update
AWS Global Infrastructure TODAY
Region
Edge	Location
12 Regions
32 Availability	Zones
54 Edge	Locations
Need	to	update
Seoul	Region	launched
Design Options on AWS
Multi-AZ Cross	Region Hybrid
IT
Single	AZ
AZ AZ AZ Region Region
Design Options on AWS
Multi-AZ Cross	Region Hybrid
IT
Single	AZ
AZ AZ AZ Region Region
Compute
A example architecture on AWS
RDS	DB	Instance
Active	(Multi-AZ)
Availability Zone
ELB	Balancer
Amazon	S3
Amazon	
CloudFront
Amazon	
Route	53
User
Web	Instances
Amazon	DynamoDB Amazon	DynamoDB
Ap-southeast-1
Ap-northeast-1
AWS	Data	Pipeline
AMI
Amazon EBS
AMI
Copy
Copy
Copy
RDS SnapshotAmazon RDS Snapshot
Amazon EBSAmazon EBS SnapshotAmazon EBS Snapshot
Snapshot Restore
EC2 EC2
RestoreCreate
Snapshot Restore
Copy
AWS provided cross-region copies
Migrating compute and network – EC2 instance
§ Resources
§ SSH Keys
§ Security Groups
§ AMI
§ EBS Volumes
§ Elastic IP Addresses
§ ELB
§ Launch configurations and AutoScaling group
§ VPC
§ Considerations
§ Reserved Instances
§ Services Limits
AMI Copy
Migrating compute and network – EC2 instance
1. Run Copy AMI at console
2. Check the status of copy AMI across region
3. Launch a new instance in target region
Migrating compute and network – EC2 instance
1. Create EBS volume snapshot à Copy Snapshot
2. Check the status of Snapshot copy cross region
3. Create a new volume in target region
Migrating compute and network – EC2 instance
§ Collect security group configuration with AWS CLI
§ $ ec2-describe-group -H --region ap-northeast-1 >> sg.txt
VM Import/Export
What is VM Import/Export
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UsingVirtualMachinesinAmazonEC2.html
VM Import/Export will help
§Migrate existing applications and workloads to Amazon
EC2
§Copy your VM image catalog to Amazon EC2
§Create a disaster recovery repository for VM images
VM Import/Export steps
1. Install the AWS CLI. For more information.
2. Prepare the VM for import to Amazon EC2.
3. Export the VM from the virtualization environment.
4. Import the VM into Amazon EC2. For information.
Launch the instance in Amazon EC2.
§ Microsoft Windows Server 2003 (Standard,
Datacenter, Enterprise) with Service Pack 1
(SP1) or later
§ Microsoft Windows Server 2003 R2
(Standard, Datacenter, Enterprise)
§ Microsoft Windows Server 2008 (Standard,
Datacenter, Enterprise)
§ Microsoft Windows Server 2008 R2
(Standard, Datacenter, Enterprise)
§ Microsoft Windows Server 2012 (Standard,
Datacenter)
§ Microsoft Windows Server 2012 R2
(Standard, Datacenter)
§ Red Hat Enterprise Linux (RHEL) 5.1-
5.11, 6.1-6.6, 7.0-7.1
§ SUSE Linux Enterprise Server 11-12
§ Ubuntu 12.04, 12.10, 13.04, 13.10,
14.04, 14.10, 15.04
§ CentOS 5.1-5.11, 6.1-6.6, 7.0-7.1
§ Debian 6.0.0-6.0.8, 7.0.0-7.8.0, 8.0.0
§ Oracle Enterprise Linux 6.1-6.6, 7.0-
7.1
§ Fedora Server 19-21
OSs supported by VM Import/Export
Note:	From	21-Dec-2015	Document
You	can	import	Windows	and	Linux	VMs	that	use	VMware	ESX	or	Workstation,	 Microsoft	Hyper-V,	
and	Citrix	Xen virtualization	formats
Design Options on AWS
Multi-AZ Cross	Region Hybrid
IT
Single	AZ
Files	and	
Objects
AZ AZ AZ Region Region
Compute
COPY Files from IDC to S3
Copy files from IDC to S3
Corporate Data Center
Amazon	S3
Bucket
Storage	Servers
Files	
File	systems
Think Parallel
1	File 1	File
2	Seconds
Multipart
Think Parallel
1	File
2	Seconds
1	File
2	Seconds
1	File
2	Seconds
1	File
2	Seconds
8	Seconds
Foreach($file	in	$files)	{Write-S3Object	-BucketName mybucket -Key	$file.filename}
Think Parallel
120,000	Files
Nearly	3		Days
Think Parallel
1	File
2	Seconds
1	File
2	Seconds
1	File
2	Seconds
1	File
2	Seconds
1	File
2	Seconds
1	File
2	Seconds
1	File
2	Seconds
1	File
2	Seconds
1	File
2	Seconds
1	File
2	Seconds
1	File
2	Seconds
1	File
2	Seconds
120,000	files	@	15,000	TPS	=	8	seconds
Multiple	Machines,	Multiple	Threads,	Multiple	Parts
AWS S3 Multipart Upload
Corporate Data center
Amazon	S3
Bucket
Storage	Servers
Files	
File	systems
COPY Files from S3 to S3
Example:
Source Bucket : distcptest Region: Tokyo Size : 9GB Files : 90
Target Bucket : distcptestsydney Region: Sydney
How to copy objects from S3 bucket to another S3 bucket?
Copy files from S3 to S3 with AWSCLI
$aws s3 sync s3://distcptest/moveiclip s3://distcptestsydney/movieclip
* Time: 14 mins
Copy files from S3 to S3 with AWSCLI
Distrubuted Copy using Elastic MapReduce Hadoop cluster
Copy files from S3 to S3 with EMR
1.	Launch	EMR	cluster	with	selecting	instance	size	and	the	number	of	instances.
Copy files from S3 to S3 with EMR
$	aws emr add-steps	--cluster-id	j-XXXXXXXXXX --steps	Type=CUSTOM_JAR,Name="S3DistCp	step",Jar=
/home/hadoop/lib/emr-s3distcp-1.0.jar,
Args=["--src,s3://distcptest/moveiclip ","--dest,s3://distcptestsydney/movieclip”]
2.	Submit	s3DistCp	Job	to	the	cluster.	
(3DistCp is	an	extension	of	DistCp that	is	optimized	to	work	with	AWS)
EMR Job result log
Copy files from S3 to S3 with EMR
* Time: 3.5 mins
(CLI: 14 mins)
Bigger cluster, Save more time to copy
Resizing cluster to more 6 core nodes and test copying
Copy files from S3 to S3 with EMR
* Time: 1.5 mins
Design Options on AWS
Multi-AZ Cross	Region Hybrid
IT
Single	AZ
Databases
Files	and	
Objects
AZ AZ AZ Region Region
Compute
Database Migration – RDS
§ RDS supports cross
region DB snapshot copy
§ Full and incremental
copy
§ Simultaneously multiple
regional copy supported
Primary
Secondary
Secondary
Database Migration – RDS
§ A snapshot copied across regions does not include either the parameter group or
option group that was used by the DB instance the snapshot was created from.
$	awsrds copy-db-parameter-group	--region	us-east-1	--source-db-parameter-group-identifier	
arn:aws:rds:ap-northeast-1:389941452291:pg:src-parameter	--target-db-parameter-group-identifier	
dest-test-params--target-db-parameter-group-description	TEST
A	client	error	(DBParameterGroupNotFound)	occurred	when	calling	the	CopyDBParameterGroup
operation:	DB	ParameterGroupnot	found,	not	allowed	to	do	cross	region	copy.
$
AWSCLI Copy-DB-Parameter-group
Database Migration – RDS
$ python copy_db_parameter_group.py --src=src-test --
src_region=ap-northeast-1 --dest=desttestparam --
dest_region=ap-southeast-1
Database Migration – RDS
§Using a custom python script,
§ https://aws.amazon.com/ko/blogs/korea/copy-db-parameters-
between-regions-using-aws-cli/
§Python, boto3 library, deepdiff library required
AWS Database Migration Service
Purposes of data migration
One-time	data	migration
Between	on	premises	and	AWS
Between	Amazon	EC2	and	Amazon	
RDS
Ongoing	Replication
Replicate	on	premises	to	AWS
Replicate	AWS	to	on	premises
Replicate	OLTP	to	BI
Replicate	for	query	offloading
Ways to migrate data
Bulk	Load
AWS	Database	Migration	Service
Oracle	Import/Export
Oracle	Data	Pump	Network	Mode
Oracle	SQL*Loader
Oracle	Materialized	Views
CTAS	/	INSERT	over	dblink
Ongoing	Replication
AWS	Database	Migration	Service
Oracle	Data	Pump	Network	Mode
Oracle	Materialized	Views
Oracle	GoldenGate
High-speed database migration prior to AWS DMS
EC2	
Instance
Linux	
Host
On-Premises AWS	Availability	Zone
Oracle	DB
RDS	
Oracle
Tsunami Tsunami
DATA_PUMP_DIR
500GB
175GB	
~2.5	hours~2.5	hours
Total	Time
~7	hours
~3.5	hours
~4	hours
Start	your	first	migration	in	10	minutes	or	less
Keep	your	apps	running	during	the	migration
Replicate	within,	to	or	from	Amazon	EC2	or	RDS
Move	data	to	the	same	or	different	database	engine	
Sign	up	for	preview	at	aws.amazon.com/dms
AWS
Database Migration
Service
10 minutes or less to migration
Customer
Premises
Application Users
AWS
Internet
VPN
§ Start a replication instance
§ Connect to source and target
databases
§ Select tables, schemas, or databases
Let AWS Database Migration Service
create tables, load data, and keep
them in sync
Switch applications over to the target
at your convenience
Keep your apps running during the migration
AWS
Database Migration Service
After migration, use for replication and data
integration
§Replicate data in on-premises databases to AWS
§Replicate OLTP data to Amazon Redshift
§Integrate tables from third-party software into your
reporting or core OLTP systems
§Hybrid cloud is a stepping stone in migration to AWS
Cost-effective and no upfront costs
§ T2 pricing starts at $0.018 per Hour for T2.micro
§ C4 pricing starts at $0.154 per Hour for C4.large
§ 50GB GP2 storage included with T2 instances
§ 100GB GP2 storage included with C4 instances
§
§ Data transfer inbound and within AZ is free
§ Data transfer across AZs starts at $0.01 per GB
Swap
Logs
Cache
Migrate and replicate between database
engines
Introducing
AWS Schema Conversion Tool
Migrate	off	Oracle	and	SQL	Server
Move	your	tables,	views,	stored	procedures	and	D
ML	to	MySQL,	MariaDB,	and	Amazon	Aurora
Know	exactly	where	manual	edits	are	needed
Download	at	aws.amazon.com/dms
AWS
Schema Conversion
Tool
Get help with converting tables, views, and code
Schemas
Tables
Indexes
Views
Packages
Stored	Procedures
Functions
Triggers
Sequences
User	Defined	Types
Synonyms
Know exactly where manual edits are needed
DynamoDB cross region
replication
DynamoDB
Data	Pipeline	
Region A Region B
DynamoDB cross region replication
DynamoDB cross region replication
DynamoDB cross region replication
Design Options on AWS
Multi-AZ Cross	Region Hybrid
IT
Single	AZ
Databases
Files	and	
Objects
AZ AZ AZ Region Region
Compute
Network
Transition traffic with Route53
Amazon Route 53 weighted routing
AWS Data Migration Service
Continuous Data Replication
Passive
Amazon
Route 53
Database Server
Weighted Routing example #1
VM Import/Export
AWS	Region
Database
Corporate	Data	Center
100%
Web/ App Server
0%
AWS Data Migration Service
Continuous Data Replication
Passive
Amazon
Route 53
Database Server
Weighted Routing example #2
VM Import/Export
AWS	Region
Database
Corporate	Data	Center
90%
Web/ App Server
10%
AWS Data Migration Service
Continuous Data Replication
Passive
Amazon
Route 53
Database Server
Weighted Routing example #3
VM Import/Export
AWS	Region
Database
Corporate	Data	Center
50%
Web/ App Server
50%
AWS Data Migration Service
Continuous Data Replication
Passive
Amazon
Route 53
Database Server
Weighted Routing example #4
VM Import/Export
AWS	Region
Database
Corporate	Data	Center
0%
Web/ App Server
100%
Thank	you!

More Related Content

데이터 마이그레이션 AWS와 같이하기 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming