

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# Neptune을 대상으로 사용하여 AWS DMS 복제 작업 생성
<a name="dms-neptune-replication"></a>

표 매핑 및 그래프 매핑 구성을 만든 후에는 다음 프로세스를 사용하여 소스 스토어의 데이터를 Neptune에 로드합니다. 해당 API에 대한 자세한 내용은 AWS DMS 설명서를 참조하세요. APIs 

## AWS DMS 복제 인스턴스 생성
<a name="dms-neptune-replication-instance"></a>

Neptune DB 클러스터가 실행 중인 VPC에서 AWS DMS 복제 인스턴스를 생성합니다( AWS DMS 사용 설명서의 [AWS DMS 복제 인스턴스 작업](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_ReplicationInstance.html) 및 [CreateReplicationInstance](https://docs.aws.amazon.com/dms/latest/APIReference/API_CreateReplicationInstance.html) 참조). 다음과 같은 AWS CLI 명령을 사용하여이 작업을 수행할 수 있습니다.

```
aws dms create-replication-instance \
    --replication-instance-identifier {{(the replication instance identifier)}} \
    --replication-instance-class {{(the size and capacity of the instance, like 'dms.t2.medium')}} \
    --allocated-storage {{(the number of gigabytes to allocate for the instance initially)}} \
    --engine-version {{(the DMS engine version that the instance should use)}} \
    --vpc-security-group-ids {{(the security group to be used with the instance)}}
```

## 소스 데이터베이스의 AWS DMS 엔드포인트 생성
<a name="dms-neptune-source-endpoint"></a>

다음 단계는 소스 데이터 스토어에 대한 AWS DMS 엔드포인트를 생성하는 것입니다. 다음과 AWS CLI 같이에서 AWS DMS [CreateEndpoint](https://docs.aws.amazon.com/dms/latest/APIReference/API_CreateEndpoint.html) API를 사용할 수 있습니다.

```
aws dms create-endpoint \
    --endpoint-identifier {{(source endpoint identifier)}} \
    --endpoint-type source \
    --engine-name {{(name of source database engine)}} \
    --username {{(user name for database login)}} \
    --password {{(password for login)}} \
    --server-name {{(name of the server)}} \
    --port {{(port number)}} \
    --database-name {{(database name)}}
```

## 스테이징 데이터에 사용할 Neptune용 Amazon S3 버킷 설정
<a name="dms-neptune-s3-staging-bucket"></a>

데이터 스테이징에 사용할 수 있는 Amazon S3 버킷이 없는 경우, Amazon S3 시작 안내서의 [버킷 생성](https://docs.aws.amazon.com/AmazonS3/latest/userguide/CreatingABucket.html) 또는 콘솔 사용 설명서의 [S3 버킷을 생성하려면 어떻게 해야 합니까?](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket.html)에 설명된 대로 버킷을 생성하세요.

버킷에 `GetObject`, `PutObject`, `DeleteObject`, `ListObject` 권한을 부여하는 IAM 정책을 생성해야 합니다(이 정책이 없는 경우).

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Sid": "ListObjectsInBucket",
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket"
      ],
      "Resource": [
        "arn:aws:s3:::{{amzn-s3-demo-bucket}}"
      ]
    },
    {
      "Sid": "AllObjectActions",
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:PutObject",
        "s3:DeleteObject"
      ],
      "Resource": [
        "arn:aws:s3:::{{amzn-s3-demo-bucket}}/*"
      ]
    }
  ]
}
```

------

Neptune DB 클러스터에 IAM 인증이 활성화된 경우 다음 정책도 포함시켜야 합니다.

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Sid": "VisualEditor0",
      "Effect": "Allow",
      "Action": "neptune-db:*",
      "Resource": "arn:aws:neptune-db:{{us-east-1}}:{{111122223333}}:{{cluster-resource-id}}/*"
    }
  ]
}
```

------

정책을 연결할 신뢰 문서로 IAM 역할을 만듭니다.

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "Service": "dms.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    },
    {
      "Sid": "neptune",
      "Effect": "Allow",
      "Principal": {
        "Service": "rds.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
```

------

정책을 역할에 연결한 후 Neptune DB 클러스터에 역할을 연결합니다. 이렇게 하면가 로드 중인 데이터를 스테이징하는 데 버킷을 AWS DMS 사용할 수 있습니다.

## Neptune VPC에서 Amazon S3 엔드포인트 생성
<a name="dms-neptune-s3-endpoint"></a>

이제 Neptune 클러스터가 위치한 VPC에서 중간 Amazon S3 버킷에 대한 VPC 게이트웨이 엔드포인트를 생성합니다. [게이트웨이 엔드포인트 생성](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-gateway.html#create-gateway-endpoint)에 설명된 대로 AWS Management Console 또는 AWS CLI 를 사용하여이 작업을 수행할 수 있습니다.

## Neptune용 AWS DMS 대상 엔드포인트 생성
<a name="dms-neptune-target-endpoint"></a>

대상 Neptune DB 클러스터에 대한 AWS DMS 엔드포인트를 생성합니다. AWS DMS [CreateEndpoint](https://docs.aws.amazon.com/dms/latest/APIReference/API_CreateEndpoint.html) API를 다음과 같은 `NeptuneSettings` 파라미터와 함께 사용할 수 있습니다.

```
aws dms create-endpoint \
    --endpoint-identifier {{(target endpoint identifier)}} \
    --endpoint-type target \
    --engine-name neptune \
    --server-name {{(name of the server)}} \
    --port {{(port number)}} \
    --neptune-settings '{ \
      "ServiceAccessRoleArn": "{{(ARN of the service access role)}}", \
      "S3BucketName": "{{(name of S3 bucket to use for staging files when migrating)}}", \
      "S3BucketFolder": "{{(name of the folder to use in that S3 bucket)}}", \
      "ErrorRetryDuration": {{(number of milliseconds to wait between bulk-load retries)}}, \
      "MaxRetryCount": {{(the maximum number of times to retry a failing bulk-load job)}}, \
      "MaxFileSize": {{(maximum file size, in bytes, of the staging files written to S3)}}, \
      "IamAuthEnabled": {{(set to true if IAM authentication is enabled on the Neptune cluster)}} }'
```

`NeptuneSettings` 파라미터에서 API로 AWS DMS `CreateEndpoint` 전달되는 JSON 객체에는 다음 필드가 있습니다.

****
+ **`ServiceAccessRoleArn`**   –   *(필수)* Neptune으로의 데이터 마이그레이션을 준비하는 데 사용되는 S3 버킷에 대한 세분화된 액세스를 허용하는 IAM 역할의 ARN입니다. IAM 권한 부여가 활성화된 경우 이 역할에 Neptune DB 클러스터에 액세스할 수 있는 권한도 있어야 합니다.
+ **`S3BucketName`**   –   *(필수)* 전체 로드 마이그레이션의 경우 복제 인스턴스는 모든 RDS 데이터를 CSV로 변환하고, 쿼드 파일을 S3의 이 스테이징 버킷으로 업로드한 다음, Neptune에 대량 로드합니다.
+ **`S3BucketFolder`**   –   *(필수)* S3 스테이징 버킷에서 사용할 폴더입니다.
+ **`ErrorRetryDuration`**   –   *(선택 사항)* Neptune 요청이 실패한 후 요청을 재시도하기 전에 대기할 시간(밀리초)입니다. 기본값은 250입니다.
+ **`MaxRetryCount`**   –   *(선택 사항)* 재시도 가능한 실패 후 AWS DMS 수행해야 하는 최대 재시도 요청 수입니다. 기본값은 5입니다.
+ **`MaxFileSize`**   –   *(선택 사항)* 마이그레이션 중에 S3에 저장된 각 스테이징 파일의 최대 크기(바이트)입니다. 기본값은 1,048,576KB(1GB)입니다.
+ **`IsIAMAuthEnabled`**   –   *(선택 사항)* Neptune DB 클러스터에서 IAM 인증이 활성화되어 있는 경우 `true`로 설정하고, 그렇지 않으면 `false`로 설정합니다. 기본값은 `false`입니다.

## 새 엔드포인트에 대한 연결 테스트
<a name="dms-neptune-test-endpoints"></a>

다음과 같이 AWS DMS [TestConnection](https://docs.aws.amazon.com/dms/latest/APIReference/API_TestConnection.html) API를 사용하여 이러한 각 새 엔드포인트에 대한 연결을 테스트할 수 있습니다.

```
aws dms test-connection \
    --replication-instance-arn {{(the ARN of the replication instance)}} \
    --endpoint-arn {{(the ARN of the endpoint you are testing)}}
```

## AWS DMS 복제 작업 생성
<a name="dms-neptune-replication-task"></a>

이전 단계를 성공적으로 완료했으면 다음과 같이 AWS DMS [CreateReplicationTask](https://docs.aws.amazon.com/dms/latest/APIReference/API_CreateReplicationTask.html.html) API를 사용하여 소스 데이터 스토어의 데이터를 Neptune으로 마이그레이션하기 위한 복제 작업을 생성합니다.

```
aws dms create-replication-task \
    --replication-task-identifier {{(name for the replication task)}} \
    --source-endpoint-arn {{(ARN of the source endpoint)}} \
    --target-endpoint-arn {{(ARN of the target endpoint)}} \
    --replication-instance-arn {{(ARN of the replication instance)}} \
    --migration-type full-load \
    --table-mappings {{(table-mapping JSON object or URI like 'file:///tmp/table-mappings,json')}} \
    --task-data {{(a GraphMappingConfig object or URI like 'file:///tmp/graph-mapping-config.json')}}
```

`TaskData` 파라미터는 복사할 데이터를 Neptune에 저장하는 방법을 지정하는 [GraphMappingConfig](dms-neptune-graph-mapping.md)을 제공합니다.

## AWS DMS 복제 작업 시작
<a name="dms-neptune-start-task"></a>

이제 복제 태스크를 시작할 수 있습니다.

```
aws dms start-replication-task
    --replication-task-arn {{(ARN of the replication task started in the previous step)}}
    --start-replication-task-type start-replication
```