

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

# Amazon Keyspaces에서 키스페이스 삭제
<a name="getting-started.clean-up.keyspace"></a>

키스페이스 요금이 부과되지 않도록 하려면 사용하지 않는 모든 키스페이스를 삭제합니다. 키스페이스를 삭제하면 키스페이스와 모든 해당 테이블이 삭제되고 이에 대한 요금 발생이 중지됩니다.

콘솔, CQL 또는 AWS CLI를 사용하여 키스페이스를 삭제할 수 있습니다.

## 콘솔 사용
<a name="getting-started.clean-up.keyspace.con"></a>

다음 절차에서는 콘솔을 사용하여 키스페이스와 모든 해당 테이블 및 데이터를 삭제합니다.

**콘솔을 사용하여 키스페이스를 삭제하려면**

1. 에 로그인 AWS Management Console하고 [https://console.aws.amazon.com/keyspaces/home](https://console.aws.amazon.com/keyspaces/home) Amazon Keyspaces 콘솔을 엽니다.

1. 탐색 창에서 **Keyspaces**를 선택합니다.

1. 삭제할 각 키스페이스의 이름 왼쪽에 있는 상자를 선택합니다.

1. **삭제**를 선택합니다.

1. **키스페이스 삭제** 화면에서 상자에 **Delete**를 입력합니다. 그런 다음 **키스페이스 삭제**를 선택합니다.

1. 키스페이스 `catalog`가 삭제되었는지 확인하려면 탐색 창에서 **Keyspaces**를 선택하고 키스페이스가 더 이상 목록에 없는지 확인합니다. 키스페이스를 삭제했으므로 **Tables** 아래의 `book_awards` 테이블도 나열되지 않아야 합니다.

## CQL 사용
<a name="getting-started.clean-up.keyspace.cql"></a>

다음 절차에서는 CQL을 사용하여 키스페이스와 모든 해당 테이블 및 데이터를 삭제합니다.

**CQL을 사용하여 키스페이스를 삭제하려면**

1. 를 AWS CloudShell 열고 다음 명령을 사용하여 Amazon Keyspaces에 연결합니다. *us-east-1*을 자체 리전으로 업데이트해야 합니다.

   ```
   cqlsh-expansion cassandra.us-east-1.amazonaws.com 9142 --ssl
   ```

1. 다음 문을 입력하여 키스페이스를 삭제합니다.

   ```
   DROP KEYSPACE IF EXISTS catalog ;
   ```

1. 키스페이스가 삭제되었는지 확인합니다.

   ```
   SELECT * from system_schema.keyspaces ;
   ```

   키스페이스가 나열되어서는 안 됩니다. 이 작업은 비동기 작업이므로 키스페이스가 삭제될 때까지 지연이 발생할 수 있습니다. 키스페이스가 삭제된 후에는 문 출력이 다음과 같아야 합니다.

   ```
   keyspace_name           | durable_writes | replication
   -------------------------+----------------+-------------------------------------------------------------------------------------
              system_schema |           True | {'class': 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '3'}
          system_schema_mcs |           True | {'class': 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '3'}
                     system |           True | {'class': 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '3'}
    system_multiregion_info |           True | {'class': 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '3'}
   
   (4 rows)
   ```

## 사용 AWS CLI
<a name="getting-started.clean-up.keyspace.cli"></a>

다음 절차에서는 AWS CLI을 사용하여 키스페이스와 모든 해당 테이블 및 데이터를 삭제합니다.

**를 사용하여 키스페이스를 삭제하려면 AWS CLI**

1.  AWS CloudShell 을 엽니다.

1. 다음 문을 입력하여 키스페이스를 삭제합니다.

   ```
   aws keyspaces delete-keyspace --keyspace-name 'catalog' 
   ```

1. 키스페이스가 삭제되었는지 확인합니다.

   ```
   aws keyspaces list-keyspaces
   ```

   이 문의 출력은 이와 비슷해야 하며 시스템 키스페이스만 나열해야 합니다. 이 작업은 비동기식 작업이므로 키스페이스가 삭제될 때까지 지연이 발생할 수 있습니다.

   ```
   {
       "keyspaces": [
           {
               "keyspaceName": "system_schema",
               "resourceArn": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/system_schema/",
               "replicationStrategy": "SINGLE_REGION"
           },
           {
               "keyspaceName": "system_schema_mcs",
               "resourceArn": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/system_schema_mcs/",
               "replicationStrategy": "SINGLE_REGION"
           },
           {
               "keyspaceName": "system",
               "resourceArn": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/system/",
               "replicationStrategy": "SINGLE_REGION"
           },
           {
               "keyspaceName": "system_multiregion_info",
               "resourceArn": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/system_multiregion_info/",
               "replicationStrategy": "SINGLE_REGION"
           }
       ]
   }
   ```