서버리스 인덱스 관리하기

서버리스 인덱스 관리하기

인덱스를 만들었다면 이제 목록을 확인하고, 세부 정보를 조회하고, 필요하면 삭제하는 법을 알아야 해요. 서버리스 인덱스는 태그, 삭제 보호(deletion protection), 메타데이터 인덱스 구성까지 제어할 수 있어요. 이 문서에서는 이미 만든 서버리스 인덱스를 관리하는 방법을 각각의 API 연산과 함께 살펴볼게요.

출처: Manage serverless indexes (공식 문서)

인덱스 목록 조회

list_indexes 연산으로 프로젝트의 모든 인덱스에 대한 전체 설명을 얻을 수 있어요. Python SDK로는 pc.list_indexes()를 호출하고, gRPC 클라이언트도 동일하게 쓸 수 있어요.

from pinecone.grpc import PineconeGRPC as Pinecone

pc = Pinecone(api_key="YOUR_API_KEY")

index_list = pc.list_indexes()

print(index_list)

curl로도 같은 결과를 얻을 수 있어요.

PINECONE_API_KEY="YOUR_API_KEY"

curl -i -X GET "https://api.pinecone.io/indexes" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "X-Pinecone-Api-Version: 2025-10"

응답은 대략 이런 모습이에요.

{
  "indexes": [
    {
      "name": "docs-example-sparse",
      "vector_type": "sparse",
      "metric": "dotproduct",
      "dimension": null,
      "status": { "ready": true, "state": "Ready" },
      "host": "docs-example-sparse-govk0nt.svc.aped-4627-b74a.pinecone.io",
      "spec": { "serverless": { "region": "us-east-1", "cloud": "aws" } },
      "deletion_protection": "disabled",
      "tags": { "environment": "development" }
    },
    {
      "name": "docs-example-dense",
      "vector_type": "dense",
      "metric": "cosine",
      "dimension": 1536,
      "status": { "ready": true, "state": "Ready" },
      "host": "docs-example-dense-govk0nt.svc.aped-4627-b74a.pinecone.io",
      "spec": { "serverless": { "region": "us-east-1", "cloud": "aws" } },
      "deletion_protection": "disabled",
      "tags": { "environment": "development" }
    }
  ]
}

여기서 vector_type(dense/sparse), dimension, metric, host, 배포 지역과 클라우드, 삭제 보호 상태, 태그를 한 번에 확인할 수 있어요. Python SDK에서는 .names() 헬퍼를 써서 list_indexes() 응답의 인덱스 이름만 차례로 순회할 수 있어요.

from pinecone.grpc import PineconeGRPC as Pinecone
from pinecone import ServerlessSpec

for index_name in pc.list_indexes().names:
    print(index_name)

인덱스 세부 정보 조회

describe_index 엔드포인트로 특정 인덱스 하나의 전체 설명을 얻을 수 있어요.

from pinecone.grpc import PineconeGRPC as Pinecone

pc = Pinecone(api_key="YOUR_API_KEY")

pc.describe_index(name="docs-example")

curl로는 호스트 경로에 인덱스 이름을 붙여 GET 요청을 보내면 돼요.

PINECONE_API_KEY="YOUR_API_KEY"

curl -i -X GET "https://api.pinecone.io/indexes/docs-example" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-Api-Version: 2025-10"

인덱스 삭제·보호

운영 환경에서 실수로 인덱스를 지우는 사고를 막으려면 삭제 보호(deletion protection)를 켜두는 게 좋아요. 인덱스 자체를 삭제할 때는 상태를 다시 확인하고, 삭제 보호가 활성화된 인덱스는 보호를 먼저 해제해야 삭제할 수 있어요. 인덱스 삭제는 되돌릴 수 없으니 신중하게 진행해야 해요.

백업(Backup) 살펴보기

서버리스 인덱스의 백업 목록도 확인할 수 있어요. 백업은 인덱스의 정적 사본으로 스토리지만 소비하고 쿼리할 수 없는 데이터 표현이에요. 백업 응답에서 확인할 수 있는 필드는 이러해요.

  • backup_id — 백업의 고유 ID
  • source_index_name / source_index_id — 백업을 만든 원본 인덱스
  • statusPending, Initializing, Ready 등 백업 상태
  • cloud / region — 백업이 위치한 클라우드와 지역
  • dimension / record_count / namespace_count / size_bytes — 백업 크기 관련 정보
  • created_at — 생성 시각

curl로는 다음과 같이 확인할 수 있어요.

PINECONE_API_KEY="YOUR_API_KEY"

curl -i -X GET "https://api.pinecone.io/backups" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-Api-Version: 2025-10"

특정 인덱스의 백업은 Pinecone 콘솔의 Backups 탭이나 Indexes 탭에서도 볼 수 있어요.

더 알아보기