Skip to content

DOCS: Add zk/cluster scale-out, scale-in interface draft - #67

Open
oliviarla wants to merge 1 commit into
developfrom
feat/scale-in-out
Open

oliviarla wants to merge 1 commit into
developfrom
feat/scale-in-out

Conversation

@oliviarla

Copy link
Copy Markdown
Member

🔗 Related Issue

⌨️ What I did

  • ZK scale-out, scale-in 명령과 Cluster scale-out, scale-in 명령의 인터페이스를 상세하게 설계했습니다.
  • scale-out 시에는 설정을 입력받아야 하므로 yaml 파일을 인자로 받고, scale-in 시에는 노드의 고유값인 myid / address / group id 를 인자로 받도록 했습니다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Dec 3, 2026

Copy link
Copy Markdown

APL-208

@jhpark816 jhpark816 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰 완료

Comment thread docs/1-zk-guide.md
### 실행 예시

```sh
arcusctl zk scale-out my-ensemble zk-scale-out.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deploy 경우는 version 명시하고 있지만, 여기서는 명시하지 않습니다.
version 명시가 필요하지 않는지?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기존 클러스터의 버전을 따라갑니다.
만약 서로 다른 버전이 있는 경우라면 scale-out을 지원하지 않습니다.

Comment thread docs/1-zk-guide.md
- 각 서버는 다음 순서로 제거합니다.

```text
reconfig remove -> 서버 중지 -> (--purge) 설정·데이터 삭제 -> 토폴로지 반영

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

서버 2대를 줄이는 경우, 한꺼번에 2대를 remove하는가요
아니면 서버 1대씩 차례대로 위의 순서를 진행하나요?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove할 대상에 Leader가 포함될 경우에 대해 언급할 사항은 없는지?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사용자가 명령에서 입력한 순서대로 서버 1대씩 위의 순서를 진행합니다.
scale-in 시 사용자가 Leader 서버를 지정했다면 다음 사항을 Warning으로 적어두면 될 것 같은데 어떠신가요?

Leader 서버를 클러스터에서 제외하면 잠시 동안 쓰기 작업이 멈출 수 있다.
따라서 서버 교체 등 꼭 필요한 상황이 아니라면 Leader 서버는 scale-in 하지 않는 것을 권장한다.
여러 서버를 scale-in하는 경우 Leader 서버를 가장 마지막에 제외해주어야 여러 번 리더 교체되는 상황이 발생하지 않는다. 

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그렇게 하면 됩니다. 아래는 AI에게 문장 정리한 결과이니, 참고 바랍니다.
@namsic 추가 코멘트가 있으면 주세요.

서버를 클러스터에서 제외하면 리더 교체(선출) 과정에서 쓰기 작업이 일시적으로 지연되거나 멈출 수 있습니다. 서버 교체 등 꼭 필요한 상황이 아니라면 Leader 서버는 scale-in 대상에서 제외하는 것을 권장합니다. 여러 서버를 순차적으로 scale-in하는 경우에는 불필요한 리더 교체를 줄이기 위해 Leader 서버를 가장 마지막에 제외하세요.

Comment thread docs/1-zk-guide.md
설정·데이터 디렉터리 생성 -> 서버 시작 -> reconfig add -> 토폴로지 반영
```

- 서버 하나의 모든 단계가 완료되면 운영 장비의 `topology.yml`과 `meta.yml`에 반영합니다.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

추가 사항으로, 1-zk-guide.md 문서에
meta.yml 파일에 대한 설명/예시가 없는 데,
추가해 주면 좋겠습니다.

Comment thread docs/2-cluster-guide.md
> 제거 중 오류가 발생해도 완료된 작업은 자동으로 롤백되지 않습니다.

어느 단계에서든 실패하면 추가 작업을 중단하고 완료·실패·미처리 대상을 출력합니다.
원인을 해결한 뒤 남은 대상만 지정해 다시 실행하세요.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기존 명령을 아래와 같이 확장하면, scale-out/in 이 가능하다고 보입니다.

  • add 명령을 추가 (일부만 추가로 deploy함)
  • delete 명령이 전체 클러스터 외에 node/group 단위로 수행될 수 있게 확장

add 명령 추가 대신에 deploy 명령의 처리 로직을 확장하여,
새로운 서버가 추가된 topology 파일 기준으로 아직 배포되지 않은
새로운 서버에 대한 사항만 배포하는 것이 나을 것 같다는 생각이 듭니다.

Comment thread docs/2-cluster-guide.md
- Community 클러스터의 각 캐시 서버는 다음 순서로 추가합니다.

```text
ZNode 등록 -> 캐시 서버 시작 -> 클러스터 편입 확인(cache_list) -> 토폴로지 반영

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여러 캐시 서버를 추가하는 경우, 각 캐시 서버 추가 간격을 지정할 수 있어야 합니다.

여러 캐시 서버를 제거하는 경우도 마찬가지로 각 캐시 서버 제거 간격을 지정할 수 있어야 합니다.

따라서, 이러한 별도 설정을 가지지 않고,
add 명령 추가와 delete 명령 확장이 나을거라 생각합니다.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이부분은 업그레이드와 마찬가지로 사용자가 임의로 추가 간격을 두고 개별 명령을 수행하면 됩니다.
arcusctl zk scale-out server5.yml -> 5분 후 -> arcusctl zk scale-out server6.yml

Comment thread docs/1-zk-guide.md
> 제거 중 오류가 발생해도 완료된 작업은 자동으로 롤백되지 않습니다.

어느 단계에서든 실패하면 추가 작업을 중단하고 완료·실패·미처리 서버를 출력합니다.
원인을 해결한 뒤 남은 서버만 지정해 다시 실행하세요.

@jhpark816 jhpark816 Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zk에서도 add 명령 추가(or deploy 명령 확장)와 delete 명령 확장으로
ZK 서버 추가, 제거의 단위 작업을 처리할 수 있으면 좋겠습니다.

reconfig add/remove를 별도로 다루어야 하므로,
scale-out/in 명령을 두는 것이 필요해 보입니다.
즉, scale-out 명령에서 서버 추가 후에 reconfig add 수행하고,
scale-in 명령에서 reconfig remove 수행 후에 서버 제거합니다.

cache cluster에서는 scale-out/in 명령이 없는 것이 나을 것 같은 데,
zk ensemble 관리에서는 scale-out/in 명령을 두는 것이 필요해 보입니다.

@namsic
위의 의견을 검토 바랍니다.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저는 명령어를 최소화시키고 인자를 늘리거나 사용 설명을 덧붙이는 것보다
직관적으로 어떤 작업을 하겠다 라는 명령이 따로 있는게 사용자 입장에서 이해하기 더 좋아보입니다.

Comment thread docs/2-cluster-guide.md

실행 중 오류가 발생하면 일부 캐시 서버가 계속 실행 중일 수 있습니다. `status`로 전체 상태를 확인한 후 다시 중지하세요.

## `cluster scale-out`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기존 문서 내용 중 아래의 표기가 있는 데요.
arcusctl cluster start <servicecode> [options]

options 부분은 [<options>]로 표기하면 좋겠습니다.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

문서 명령어 표기는 나중에 memcached 참고해서 일괄 변경하여 PR 올리겠습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants