본문으로 건너뛰기

클러스터 모드 사용

다음 API는 클러스터 모드사용으로 설정한 클러스터에 사용할 수 있습니다.

주의
  • user.password 필드의 값은 암호화한 값을 넣어야지만 정상적으로 생성이 가능합니다.

클러스터 생성

새로운 클러스터를 생성합니다. 생성 시, 최소 샤드 개수는 1개, 최대 샤드 개수는 12개입니다.

Request
클러스터 생성 Request Syntax
curl -X POST "https://redis.kr-central-2.kakaocloud.com/v1/clusters" \
-H "X-Auth-Token: {token-id}" \
-H "Content-Type: application/json" \
-d '{Body}'
종류파라미터유형설명
Header{token-id}*StringAPI 인증 토큰 참고
Content-Type*String콘텐츠 타입 기본값: application/json
Bodyname*String클러스터 이름
descriptionString클러스터 설명
version*StringRedis 버전
port*IntegerRedis 포트 번호
shardCount*Integer샤드 수
nodeCountPerShard*Integer샤드 당 노드 수
flavorId*String플레이버 ID
subnets[]*Object Array배치 가능한 서브넷 목록
subnets[].id*String서브넷 ID
- 서브넷 ID는 콘솔 > VPC > 서브넷에서 확인
subnetAssignments[]*Object Array서브넷 배치 목록
subnetAssignments[].primary*ObjectPrimary에 배치할 서브넷
subnetAssignments[].primary.id*StringPrimary에 배치할 서브넷 ID
subnetAssignments[].replicas[]*Object ArrayReplica에 배치할 서브넷 목록
subnetAssignments[].replicas[].id*StringReplica에 배치할 서브넷 ID
securityGroups[]*Object Array클러스터에 연결할 보안 그룹 목록
securityGroups[].id*String클러스터에 연결할 보안 그룹 ID
- 보안 그룹 ID는 콘솔 > VPC > 보안 그룹에서 확인 가능
user.nameString데이터베이스 사용자 이름
user.passwordString데이터베이스 사용자 암호 (암호화된 형태 또는 암호 해시)
데이터베이스 사용자 암호 암호화 방법
클러스터 생성 Request Body Example
{
"name": "test-cluster",
"description": "test-cluster",
"version": "6.2.5",
"port": 6379,
"shardCount": 2,
"nodeCountPerShard": 3,
"flavorId": "3830ebad-ea2f-4822-8a7d-9e301c86a58d",
"subnets": [
{"id": "xxxxxxxx-0a69-4f8b-b56d-59ce12b4d55b"},
{"id": "yyyyyyyy-0a69-4f8b-b56d-59ce12b4d55b"}
],
"subnetAssignments": [
{
"primary": {"id": "xxxxxxxx-0a69-4f8b-b56d-59ce12b4d55b"},
"replicas": [
{"id": "yyyyyyyy-0a69-4f8b-b56d-59ce12b4d55b"},
{"id": "yyyyyyyy-0a69-4f8b-b56d-59ce12b4d55b"}
]
},
{
"primary": {"id": "xxxxxxxx-0a69-4f8b-b56d-59ce12b4d55b"},
"replicas": [
{"id": "yyyyyyyy-0a69-4f8b-b56d-59ce12b4d55b"},
{"id": "yyyyyyyy-0a69-4f8b-b56d-59ce12b4d55b"}
]
}
],
"securityGroups": [
{"id": "abcdxxxx-4870-4c4e-a267-2de13e38c2ea"},
{"id": "qwergggg-4870-4c4e-a267-2de13e38c2ea"}
]
}
Response
상태코드설명
201리소스 생성 요청에 대한 성공 응답
400사용자의 요청이 유효하지 않아 작업을 진행할 수 없음
401인증되지 않은 사용자가 요청한 경우
403권한이 없는 사용자가 요청한 경우
409현재 서버의 상태에 중복된 요청이 발생한 경우
422사용자의 요청 구문은 유효하지만 작업을 진행할 수 없는 경우
500내부 에러로 작업을 진행할 수 없는 경우
필드유형설명
objectIdString클러스터 ID
클러스터 생성 Response Example
201 Created
content-length: 52
content-type: application/json; charset=UTF-8

{
"objectId": "qwerqwer-7347-4d87-a49f-e705e91db2fb"
}

클러스터 정보 수정

특정 클러스터의 일부 정보를 변경합니다.

Request
클러스터 정보 수정 Request Syntax
curl -X PATCH "https://redis.kr-central-2.kakaocloud.com/v1/clusters/{cluster-id}" \
-H "accept: application/json" \
-H "X-Auth-Token: {token-id}" \
-d '{Body}'
종류파라미터유형설명
URL{cluster-id}*String클러스터 ID
Header{token-id}*StringAPI 인증 토큰 참고
Bodydescription*String변경할 정보(클러스터 설명)
클러스터 정보 수정 Request Body Example
{
"description": "modify description"
}
Response
상태코드설명
200리소스 수정 요청에 대한 성공 응답
400사용자의 요청이 유효하지 않아 작업을 진행할 수 없음
401인증되지 않은 사용자가 요청한 경우
403권한이 없는 사용자가 요청한 경우
404사용자가 요청한 리소스가 존재하지 않은 경우
500내부 에러로 작업을 진행할 수 없는 경우
필드유형설명
objectIdString클러스터 ID
클러스터 정보 수정 Response Example
200 OK
content-length: 52
content-type: application/json; charset=UTF-8

{
"objectId": "qwerqwer-7347-4d87-a49f-e705e91db2fb"
}

클러스터 삭제

특정 클러스터를 삭제합니다.

Request
클러스터 삭제 Request Syntax
curl -X DELETE "https://redis.kr-central-2.kakaocloud.com/v1/clusters/{cluster-id}" \
-H "X-Auth-Token: {token-id}"
종류파라미터유형설명
URL{cluster-id}*String클러스터 ID
Header{token-id}*StringAPI 인증 토큰 참고
Response
상태코드설명
200리소스 조회/삭제 요청에 대한 성공 응답
400사용자의 요청이 유효하지 않아 작업을 진행할 수 없음
401인증되지 않은 사용자가 요청한 경우
403권한이 없는 사용자가 요청한 경우
404사용자가 요청한 리소스가 존재하지 않은 경우
500내부 에러로 작업을 진행할 수 없는 경우
필드유형설명
objectIdString클러스터 ID
클러스터 삭제 Response Example
200 OK
content-length: 52
content-type: application/json; charset=UTF-8

{
"objectId": "qwerqwer-7347-4d87-a49f-e705e91db2fb"
}

샤드 추가

특정 클러스터에 샤드를 추가합니다.

Request
샤드 추가 Request Syntax
curl -X POST "https://redis.kr-central-2.kakaocloud.com/v1/clusters/{cluster-id}/shards" \
-H "X-Auth-Token: {token-id}" \
-d '{Body}'
종류파라미터유형설명
URL{cluster-id}*String클러스터 ID
Header{token-id}StringAPI 인증 토큰 참고
BodynodeCount*Integer샤드에 추가되는 노드 수
subnetAssignments[]*Object서브넷 배치 목록
subnetAssignments[].primary*ObjectPrimary에 배치할 서브넷
subnetAssignments[].primary.id*StringPrimary에 배치할 서브넷 ID
subnetAssignments[].replicas[]*ArrayReplica에 배치할 서브넷 목록
subnetAssignments[].replicas[].id*StringReplica에 배치할 서브넷 ID
샤드 추가 Request Body Example
{
"nodeCount": 3,
"subnetAssignments": {
"primary": {"id": "xxxxxxxx-0a69-4f8b-b56d-59ce12b4d55b"},
"replicas": [
{"id": "yyyyyyyy-0a69-4f8b-b56d-59ce12b4d55b"},
{"id": "yyyyyyyy-0a69-4f8b-b56d-59ce12b4d55b"}
]
}
}
Response
상태코드설명
201리소스 생성 요청에 대한 성공 응답
400사용자의 요청이 유효하지 않아 작업을 진행할 수 없음
401인증되지 않은 사용자가 요청한 경우
403권한이 없는 사용자가 요청한 경우
404사용자가 요청한 리소스가 존재하지 않은 경우
500내부 에러로 작업을 진행할 수 없는 경우
필드유형설명
objectIdString클러스터 ID
샤드 추가 Response Example
201 Created
content-length: 52
content-type: application/json; charset=UTF-8

{
"objectId": "875bb16f-7347-4d87-a49f-e705e91db2fb"
}

클러스터의 샤드 목록 조회

특정 클러스터의 샤드 목록을 조회합니다.

Request
샤드 목록 조회 Request Syntax
curl -X GET "https://redis.kr-central-2.kakaocloud.com/v1/clusters/{cluster-id}/shards" \
-H "X-Auth-Token: {token-id}"
종류파라미터유형설명
URL{cluster-id}*String클러스터 ID
Header{token-id}StringAPI 인증 토큰 참고
Response
상태코드설명
200리소스 조회/삭제 요청에 대한 성공 응답
400사용자의 요청이 유효하지 않아 작업을 진행할 수 없음
401인증되지 않은 사용자가 요청한 경우
403권한이 없는 사용자가 요청한 경우
404사용자가 요청한 리소스가 존재하지 않은 경우
500내부 에러로 작업을 진행할 수 없는 경우
필드유형설명
shards[]Object Array샤드 목록
shards[].idString샤드 ID
shards[].nameString샤드 이름
shards[].slotsString할당된 슬롯 범위
shards[].nodes[]Object Array노드 목록
shards[].nodes[].idString노드 ID
shards[].nodes[].nameString노드 이름
shards[].nodes[].subnetObject노드에 배치된 서브넷 정보
shards[].nodes[].subnet.idString노드에 배치된 서브넷 ID
shards[].nodes[].endpointString노드 엔드포인트 (프라이빗 IP)
shards[].nodes[].roleString노드 역할 (primary/replica)
shards[].nodes[].statusString노드 상태
shards[].nodes[].createdAtInteger노드 생성 시간 (RFC3339)
shards[].statusString샤드 상태
shards[].createdAtInteger샤드 생성 시간 (RFC3339)
샤드 목록 조회 Response Example
200 OK
content-type: application/json; charset=UTF-8

{
"shards": [
{
"id": "001",
"name": "test-cluster-001",
"slots": "0-8191",
"nodes": [
{
"id": "aaaaaaaa-c12e-46f9-81a0-60ab1950a480",
"name": "test-cluster-001-001",
"subnet": {"id": "xxxxxxxx-0a69-4f8b-b56d-59ce12b4d55b"},
"endpoint": "10.184.x.x",
"role": "primary",
"status": "Modifying",
"createdAt": 1637915937
},
{
"id": "bbbbbbbb-c12e-46f9-81a0-60ab1950a480",
"name": "test-cluster-001-002",
"subnet": {"id": "yyyyyyyy-0a69-4f8b-b56d-59ce12b4d55b"},
"endpoint": "10.184.x.x",
"role": "replica",
"status": "Modifying",
"createdAt": 1637915937
},
{
"id": "cccccccc-c12e-46f9-81a0-60ab1950a480",
"name": "test-cluster-001-003",
"subnet": {"id": "yyyyyyyy-0a69-4f8b-b56d-59ce12b4d55b"},
"endpoint": "10.184.x.x",
"role": "replica",
"status": "Modifying",
"createdAt": 1637915937
}
],
"status": "Modifying",
"createdAt": 1637915937
},
{
"id": "002",
"name": "test-cluster-002",
"slots": "8192-16383",
"nodes": [
{
"id": "dddddddd-c12e-46f9-81a0-60ab1950a480",
"name": "test-cluster-002-001",
"subnet": {"id": "yyyyyyyy-0a69-4f8b-b56d-59ce12b4d55b"},
"endpoint": "10.184.x.x",
"role": "primary",
"status": "Modifying",
"createdAt": 1637915937
},
{
"id": "eeeeeeee-c12e-46f9-81a0-60ab1950a480",
"name": "test-cluster-002-002",
"subnet": {"id": "xxxxxxxx-0a69-4f8b-b56d-59ce12b4d55b"},
"endpoint": "10.184.x.x",
"role": "replica",
"status": "Modifying",
"createdAt": 1637915937
},
{
"id": "ffffffff-c12e-46f9-81a0-60ab1950a480",
"name": "test-cluster-002-003",
"subnet": {"id": "xxxxxxxx-0a69-4f8b-b56d-59ce12b4d55b"},
"endpoint": "10.184.x.x",
"role": "replica",
"status": "Modifying",
"createdAt": 1637915937
}
],
"status": "Modifying",
"createdAt": 1637915937
}
]
}

샤드 상세 정보 조회

특정 클러스터의 특정 샤드의 상세 정보를 조회합니다.

Request
샤드 상세 정보 조회 Request Syntax
curl -X GET "https://redis.kr-central-2.kakaocloud.com/v1/clusters/{cluster-id}/shards/{shard-id}" \
-H "X-Auth-Token: {token-id}"
종류파라미터유형설명
URL{cluster-id}*String클러스터 ID
{shard-id}*String샤드 ID
Header{token-id}*StringAPI 인증 토큰 참고
Response
상태코드설명
200리소스 조회/삭제 요청에 대한 성공 응답
400사용자의 요청이 유효하지 않아 작업을 진행할 수 없음
401인증되지 않은 사용자가 요청한 경우
403권한이 없는 사용자가 요청한 경우
404사용자가 요청한 리소스가 존재하지 않은 경우
500내부 에러로 작업을 진행할 수 없는 경우
필드유형설명
idString샤드 ID
nameString샤드 이름
slotsString할당된 슬롯 범위
nodes[]Object Array노드 목록
nodes[].idString노드 ID
nodes[].nameString노드 이름
nodes[].subnetObject노드에 배치된 서브넷 정보
nodes[].subnet.idString노드에 배치된 서브넷 ID
nodes[].endpointString노드 엔드포인트 (프라이빗 IP)
nodes[].roleString노드 역할 (primary/replica)
nodes[].statusString노드 상태
nodes[].createdAtInteger노드 생성 시간 (RFC3339)
statusString샤드 상태
createdAtInteger샤드 생성 시간 (RFC3339)
샤드 상세 정보 조회 Response Example
200 OK
content-type: application/json; charset=UTF-8


{
"id": "001",
"name": "test-cluster-001",
"slots": "0-8191",
"nodes": [
{
"id": "aaaaaaaa-c12e-46f9-81a0-60ab1950a480",
"name": "test-cluster-001-001",
"subnet": {"id": "xxxxxxxx-0a69-4f8b-b56d-59ce12b4d55b"},
"endpoint": "10.184.x.x",
"role": "primary",
"status": "Modifying",
"createdAt": 2024-03-06T02:35:13Z
},
{
"id": "bbbbbbbb-c12e-46f9-81a0-60ab1950a480",
"name": "test-cluster-001-002",
"subnet": {"id": "yyyyyyyy-0a69-4f8b-b56d-59ce12b4d55b"},
"endpoint": "10.184.x.x",
"role": "replica",
"status": "Modifying",
"createdAt": 2024-03-06T02:35:13Z
},
{
"id": "cccccccc-c12e-46f9-81a0-60ab1950a480",
"name": "test-cluster-001-003",
"subnet": {"id": "yyyyyyyy-0a69-4f8b-b56d-59ce12b4d55b"},
"endpoint": "10.184.x.x",
"role": "replica",
"status": "Modifying",
"createdAt": 2024-03-06T02:35:13Z
}
],
"status": "Modifying",
"createdAt": 2024-03-06T02:35:13Z
}

샤드 삭제

특정 클러스터의 특정 샤드를 삭제합니다.

Request
샤드 삭제 Request Syntax
curl -X DELETE "https://redis.kr-central-2.kakaocloud.com/v1/clusters/{cluster-id}/shards/{shard-id}" \
-H "X-Auth-Token: {token-id}"
종류파라미터유형설명
URL{cluster-id}*String클러스터 ID
{shard-id}*String샤드 ID
Header{token-id}*StringAPI 인증 토큰 참고
Response
상태코드설명
200리소스 조회/삭제 요청에 대한 성공 응답
400사용자의 요청이 유효하지 않아 작업을 진행할 수 없음
401인증되지 않은 사용자가 요청한 경우
403권한이 없는 사용자가 요청한 경우
404사용자가 요청한 리소스가 존재하지 않은 경우
500내부 에러로 작업을 진행할 수 없는 경우
필드유형설명
objectIdString클러스터 ID
샤드 삭제 Response Example
200 OK
content-length: 52
content-type: application/json; charset=UTF-8

{
"objectId": "qwerqwer-7347-4d87-a49f-e705e91db2fb",
}

샤드에 Replica 추가

특정 클러스터의 특정 샤드에 Replica(복제본)를 추가합니다.

Request
샤드에 Replica 추가 Request Syntax
curl -X POST "https://redis.kr-central-2.kakaocloud.com/v1/clusters/{cluster-id}/shards/{shard-id}/nodes" \
-H "X-Auth-Token: {token-id}" \
-d '{Body}'
종류파라미터유형설명
URL{cluster-id}*String클러스터 ID
{shard-id}*String샤드 ID
Header{token-id}*StringAPI 인증 토큰 참고
Bodysubnet*Object서브넷 배치 정보
subnet.id*String배치할 서브넷 ID
샤드에 Replica 추가 Request Body Example
{
"subnet": {"id": "yyyyyyyy-0a69-4f8b-b56d-59ce12b4d55b"}
}
Response
상태코드설명
201리소스 생성 요청에 대한 성공 응답
400사용자의 요청이 유효하지 않아 작업을 진행할 수 없음
401인증되지 않은 사용자가 요청한 경우
403권한이 없는 사용자가 요청한 경우
404사용자가 요청한 리소스가 존재하지 않은 경우
500내부 에러로 작업을 진행할 수 없는 경우
필드유형설명
objectIdString클러스터 ID
샤드에 Replica 추가 Response Example
201 Created
content-length: 52
content-type: application/json; charset=UTF-8

{
"objectId": "qwerqwer-7347-4d87-a49f-e705e91db2fb"
}

샤드의 인스턴스(노드) 목록 조회

특정 클러스터의 특정 샤드의 인스턴스(node) 목록을 조회합니다.

Request
샤드의 인스턴스(노드) 목록 조회 Request Syntax
curl -X GET "https://redis.kr-central-2.kakaocloud.com/v1/clusters/{cluster-id}/shards/{shard-id}/nodes" \
-H "X-Auth-Token: {token-id}"
종류파라미터유형설명
URL{cluster-id}*String클러스터 ID
{shard-id}*String샤드 ID
Header{token-id}*StringAPI 인증 토큰 참고
Response
상태코드설명
200리소스 조회/삭제 요청에 대한 성공 응답
400사용자의 요청이 유효하지 않아 작업을 진행할 수 없음
401인증되지 않은 사용자가 요청한 경우
403권한이 없는 사용자가 요청한 경우
404사용자가 요청한 리소스가 존재하지 않은 경우
500내부 에러로 작업을 진행할 수 없는 경우
필드유형설명
nodes[]Object Array노드 목록
nodes[].idString노드 ID
nodes[].nameString노드 이름
nodes[].subnetObject노드에 배치된 서브넷 정보
nodes[].subnet.idString노드에 배치된 서브넷 ID
nodes[].endpointString노드 엔드포인트 (프라이빗 IP)
nodes[].roleString노드 역할 (primary/replica)
nodes[].statusString노드 상태
nodes[].createdAtInteger노드 생성 시간 (RFC3339)
샤드의 인스턴스(노드) 목록 조회 Response Example
200 OK
content-length: 52
content-type: application/json; charset=UTF-8

{
"nodes": [
{
"id": "aaaaaaaa-c12e-46f9-81a0-60ab1950a480",
"name": "test-cluster-001-001",
"subnet": {"id": "xxxxxxxx-0a69-4f8b-b56d-59ce12b4d55b"},
"endpoint": "10.184.x.x",
"role": "primary",
"status": "Modifying",
"createdAt": 2024-03-06T02:35:13Z
},
{
"id": "bbbbbbbb-c12e-46f9-81a0-60ab1950a480",
"name": "test-cluster-001-002",
"subnet": {"id": "yyyyyyyy-0a69-4f8b-b56d-59ce12b4d55b"},
"endpoint": "10.184.x.x",
"role": "replica",
"status": "Modifying",
"createdAt": 2024-03-06T02:35:13Z
},
{
"id": "cccccccc-c12e-46f9-81a0-60ab1950a480",
"name": "test-cluster-001-003",
"subnet": {"id": "yyyyyyyy-0a69-4f8b-b56d-59ce12b4d55b"},
"endpoint": "10.184.x.x",
"role": "replica",
"status": "Modifying",
"createdAt": 2024-03-06T02:35:13Z
}
]
}

인스턴스(노드)의 상세 정보 조회

특정 클러스터의 특정 샤드의 특정 인스턴스(노드)의 상세 정보를 조회합니다.

Request
인스턴스(노드)의 상세 정보 조회 Request Syntax
curl -X GET "https://redis.kr-central-2.kakaocloud.com/v1/clusters/{cluster-id}/shards/{shard-id}/nodes/{node-id}" \
-H "X-Auth-Token: {token-id}"
종류파라미터유형설명
URL{cluster-id}*String클러스터 ID
{shard-id}*String샤드 ID
{node-id}*String노드 ID
Header{token-id}*StringAPI 인증 토큰 참고
Response
상태코드설명
200리소스 조회/삭제 요청에 대한 성공 응답
400사용자의 요청이 유효하지 않아 작업을 진행할 수 없음
401인증되지 않은 사용자가 요청한 경우
403권한이 없는 사용자가 요청한 경우
404사용자가 요청한 리소스가 존재하지 않은 경우
500내부 에러로 작업을 진행할 수 없는 경우
필드유형설명
idString노드 ID
nameString노드 이름
subnetObject노드에 배치된 서브넷 정보
subnet.idString노드에 배치된 서브넷 ID
endpointString노드 엔드포인트 (프라이빗 IP)
roleString노드 역할 (primary/replica)
statusString노드 상태
createdAtInteger노드 생성 시간 (RFC3339)
인스턴스(노드)의 상세 정보 조회 Response Example
200 OK
content-length: 52
content-type: application/json; charset=UTF-8

{
"id": "aaaaaaaa-c12e-46f9-81a0-60ab1950a480",
"name": "test-cluster-001-001",
"subnet": {"id": "xxxxxxxx-0a69-4f8b-b56d-59ce12b4d55b"},
"endpoint": "10.184.x.x",
"role": "primary",
"status": "Modifying",
"createdAt": 2024-03-06T02:35:13Z
}

인스턴스(노드) 삭제

특정 클러스터의 특정 샤드의 특정 인스턴스(노드)를 삭제합니다. 단, Primary 노드는 삭제할 수 없습니다.

Request
인스턴스(노드) 삭제 Request Syntax
curl -X DELETE "https://redis.kr-central-2.kakaocloud.com/v1/clusters/{cluster-id}/shards/{shard-id}/nodes/{node-id}" \
-H "X-Auth-Token: {token-id}"
종류파라미터유형설명
URL{cluster-id}*String클러스터 ID
{shard-id}*String샤드 ID
{node-id}*String노드 ID
Header{token-id}*StringAPI 인증 토큰 참고
Response
상태코드설명
200리소스 조회/삭제 요청에 대한 성공 응답
400사용자의 요청이 유효하지 않아 작업을 진행할 수 없음
401인증되지 않은 사용자가 요청한 경우
403권한이 없는 사용자가 요청한 경우
404사용자가 요청한 리소스가 존재하지 않은 경우
500내부 에러로 작업을 진행할 수 없는 경우
필드유형설명
objectIdString클러스터 ID
인스턴스(노드) 삭제 Response Example
200 OK
content-length: 52
content-type: application/json; charset=UTF-8

{
"objectId": "qwerqwer-7347-4d87-a49f-e705e91db2fb" /* cluster id */
}