

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

# `neptune-export` 명령줄 도구를 사용하여 Neptune에서 데이터 내보내기
<a name="export-utility"></a>

다음 단계에 따라 `neptune-export` 명령줄 유틸리티를 사용하여 Neptune DB 클러스터에서 Amazon S3로 데이터를 내보낼 수 있습니다.

## `neptune-export` 명령줄 유틸리티를 사용하기 위한 사전 조건
<a name="export-utility-setup"></a>

**시작하기 전에**
+ **JDK 버전 8 설치**   –   [Java SE 개발 키트(JDK)](https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html) 버전 8이 설치되어 있어야 합니다.
+ **neptune-export 유틸리티 다운로드**   –   [neptune-export.jar](https://s3.amazonaws.com/aws-neptune-customer-samples/neptune-export/bin/neptune-export.jar) 파일을 다운로드하고 설치합니다.
+ **`neptune-export`가 Neptune VPC에 액세스할 수 있는지 확인**   –   Neptune DB 클러스터가 있는 VPC에 액세스할 수 있는 위치에서 neptune-export를 실행합니다.

  예를 들어, Neptune VPC 내의 Amazon EC2 인스턴스에서 실행하거나 Neptune VPC와 피어링되는 별도의 VPC 또는 별도의 Bastion Host에서 실행할 수 있습니다.
+ **VPC 보안 그룹이 `neptune-export`에 액세스할 권한을 부여하는지 확인**   –   Neptune VPC에 연결된 VPC 보안 그룹이 `neptune-export` 환경과 연결된 IP 주소 또는 보안 그룹에서 DB 클러스터에 액세스할 수 있도록 허용하는지 확인합니다.
+ **필요한 IAM 권한 설정**   - 데이터베이스에 AWS Identity and Access Management (IAM) 데이터베이스 인증이 활성화된   경우가 `neptune-export` 실행되는 역할이 Neptune에 대한 연결을 허용하는 IAM 정책과 연결되어 있는지 확인합니다. Neptune 정책에 대한 내용은 [IAM 정책 사용](security-iam-access-manage.md)을 참조하세요.

  쿼리 요청에서 `clusterId` 내보내기 파라미터를 사용하려는 경우 `neptune-export`가 실행되는 역할에는 다음과 같은 IAM 권한이 필요합니다.
  + `rds:DescribeDBClusters`
  + `rds:DescribeDBInstances`
  + `rds:ListTagsForResource`

  복제된 클러스터에서 내보내려면 `neptune-export`가 실행되는 역할에는 다음과 같은 IAM 권한이 필요합니다.
  + `rds:AddTagsToResource`
  + `rds:DescribeDBClusters`
  + `rds:DescribeDBInstances`
  + `rds:ListTagsForResource`
  + `rds:DescribeDBClusterParameters`
  + `rds:DescribeDBParameters`
  + `rds:ModifyDBParameterGroup`
  + `rds:ModifyDBClusterParameterGroup`
  + `rds:RestoreDBClusterToPointInTime`
  + `rds:DeleteDBInstance`
  + `rds:DeleteDBClusterParameterGroup`
  + `rds:DeleteDBParameterGroup`
  + `rds:DeleteDBCluster`
  + `rds:CreateDBInstance`
  + `rds:CreateDBClusterParameterGroup`
  + `rds:CreateDBParameterGroup`

  내보낸 데이터를 Amazon S3에 게시하려면 `neptune-export`가 실행되는 역할에 Amazon S3 위치에 대해 다음과 같은 IAM 권한이 필요합니다.
  + `s3:PutObject`
  + `s3:PutObjectTagging`
  + `s3:GetObject`
+ **`SERVICE_REGION` 환경 변수 설정**   –   DB 클러스터가 위치한 리전을 식별하도록 `SERVICE_REGION` 환경 변수를 설정합니다(리전 식별자 목록은 [Neptune에 연결](iam-auth-connecting-gremlin-java.md) 참조).

## `neptune-export` 유틸리티를 실행하여 내보내기 작업 시작
<a name="export-utility-running"></a>

다음 명령을 사용하여 명령줄에서 neptune-export를 실행하고 내보내기 작업을 시작합니다.

```
java -jar neptune-export.jar nesvc \
  --root-path {{(path to a local directory)}} \
  --json {{(the JSON file that defines the export)}}
```

이 명령에는 2개의 파라미터가 있습니다.

**내보내기 시작 시 neptune-export용 파라미터**
+ **`--root-path`**   –   Amazon S3에 게시되기 전에 내보내기 파일이 기록되는 로컬 디렉터리의 경로입니다.
+ **`--json`**   –   내보내기를 정의하는 JSON 객체입니다.

## `neptune-export` 명령줄 유틸리티를 사용하는 예제 명령
<a name="export-utility-examples"></a>

소스 DB 클러스터에서 직접 속성 그래프 데이터를 내보내려면 다음을 수행합니다.

```
java -jar neptune-export.jar nesvc \
  --root-path /home/ec2-user/neptune-export \
  --json '{
            "command": "export-pg",
            "outputS3Path" : "s3://{{(your Amazon S3 bucket)}}/neptune-export",
            "params": {
              "endpoint" : "{{(your neptune DB cluster endpoint)}}"
            }
          }'
```

소스 DB 클러스터에서 직접 RDF 데이터를 내보내려면 다음을 수행합니다.

```
java -jar neptune-export.jar nesvc \
  --root-path /home/ec2-user/neptune-export \
  --json '{
            "command": "export-rdf",
            "outputS3Path" : "s3://{{(your Amazon S3 bucket)}}/neptune-export",
            "params": {
              "endpoint" : "{{(your neptune DB cluster endpoint)}}"
            }
          }'
```

`command` 요청 파라미터를 생략하면 `neptune-export` 유틸리티는 기본적으로 Neptune에서 속성 그래프 데이터를 내보냅니다.

DB 클러스터의 복제본에서 내보내려면 다음을 수행합니다.

```
java -jar neptune-export.jar nesvc \
  --root-path /home/ec2-user/neptune-export \
  --json '{
            "command": "export-pg",
            "outputS3Path" : "s3://(your Amazon S3 bucket)/neptune-export",
            "params": {
              "endpoint" : "(your neptune DB cluster endpoint)",
              "cloneCluster" : true
            }
          }'
```

IAM 인증을 사용하여 DB 클러스터에서 내보내려면 다음을 수행합니다.

```
java -jar neptune-export.jar nesvc \
  --root-path /home/ec2-user/neptune-export \
  --json '{
            "command": "export-pg",
            "outputS3Path" : "s3://{{(your Amazon S3 bucket)}}/neptune-export",
            "params": {
              "endpoint" : "{{(your neptune DB cluster endpoint)}}"
              "useIamAuth" : true
            }
          }'
```