brunch

You can make anything
by writing

C.S.Lewis

by Master Seo Apr 27. 2022

184. 아마존 RDS를 GCP로 마이그래이션(2/3)


구글 DMS로  아마존 RDS를 GCP Cloud SQL로 이전 해보자 !!

Database Migration 서비스  설정 순서를 알아보자~



<1> 환경설정

<2>  cloud shell에 AWS Cli  설치와 환경 설정

<3>   Database Migration 서비스 사용하기

<4>   Database Migration   >  Migration jobs. 사용하기

<5>  rds 보안 그룹 허용 

<6>  one-time migration job 실행

<7> 데이터 확인



<1> 환경설정


gcloud auth list


gcloud config list project




<2> cloud shell에 AWS Cli  설치와 환경 설정


1

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"

unzip awscliv2.zip

sudo ./aws/install


2

aws configure


us-east-1





<3>   Database Migration 서비스 사용하기



1

Database Migration > Connection profiles  > Create Profile.



2

지원 하는 디비?

Mysql

Postgre 

Amazon RDS for Mysql

Amazon RDS for Postgre 



mysql://qm1np0glebnhtj4.ccfdlervyjrd.us-east-1.rds.amazonaws.com:3306/SourceMySQLDatabase

qm1np0glebnhtj4.ccfdlervyjrd.us-east-1.rds.amazonaws.com


3

us-east-1







<4>   Database Migration   >  Migration jobs. 사용하기




1

Create Migration Job.


2

rds-to-cloudsql


Source database engine

Amazon RDS for MySQL

Migration job type

One-time

Save & Continue.


3

source ?

mysql-rds


4

destination ?

mysql-cloudsql

Cloud SQL for MySQL 5.7

Create & Continue.



5

연결 방법

IP Allow

(10분 걸림)

34.74.172.160

6

저장





<5> rds 보안 그룹 허용 


1

AWS RDS Database Security Group  =  sg-06700713f70076ad8

<a.b.c.d> 는 목적지 IP = Cloud SQL instance 


2

aws ec2 authorize-security-group-ingress \

    --group-id <sg-id> \

    --protocol tcp \

    --port 3306 \

    --cidr <a.b.c.d>/32


aws ec2 authorize-security-group-ingress --group-id sg-09f7dfc09f2a1af39 --protocol tcp --port 3306 --cidr 34.74.172.160/32



3

DMS 콘솔에서 ?


TEST job


4

Create JOB




<6>  Migration jobs. 에서 one-time migration job 실행


1

Migration jobs.


2

대상 클릭


3

Start




<7> 데이터 확인


1

Database Migration

Migration Job.



2

데이터 확인

gcloud sql connect mysql-cloudsql --user=root --quiet



3

use customers_data;


select count(*) from customers;





다음 자료

https://brunch.co.kr/@topasvga/2400






https://brunch.co.kr/@topasvga/2401



감사합니다.


매거진의 이전글 183.Cloud SQL for Mysql생성(1/3)

작품 선택

키워드 선택 0 / 3 0

댓글여부

afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari