Skip to content

FEATURE: Add cluster deploy command - #46

Merged
oliviarla merged 1 commit into
developfrom
f1v3/cluster-deploy
Jul 29, 2026
Merged

FEATURE: Add cluster deploy command#46
oliviarla merged 1 commit into
developfrom
f1v3/cluster-deploy

Conversation

@f1v3-dev

@f1v3-dev f1v3-dev commented Jul 13, 2026

Copy link
Copy Markdown

🔗 Related Issue

⌨️ What I did

  • Arcus Cache Cluster 배포를 위한 cluster deploy 명령어를 추가합니다.
    • arcusctl cluster deploy <version> <topology.yml>
    • topology의 servers[].group 유무로 Community / Enterprise edition을 자동 판별합니다.

배포 절차

  1. topology 검증 (필수 필드, 중복 address, 유효한 Master/Slave 구성)
  2. 동일 Service Code 클러스터가 존재하는지 확인
  3. arcus-memcached tar.gz 준비
    • Community: GitHub release 기준 wget
    • Enterprise: 사용자가 ~/.arcusctl/images/arcus 에 넣어둔 tar.gz 사용
  4. 각 장비에서 압축 해제 → deps/install.sh 로 의존성 설치 → configure, make, make install 빌드
    • Enterprise: --enable-replication 옵션으로 빌드
  5. 내부 메타데이터 저장 (topology.yml)

명령 구조

./arcusctl cluster deploy <version> <topology.yaml>

설치 구조

topology.yaml 에서 정의한 path 정보와 버전 정보를 기반으로 아래와 같이 설치합니다.

<path>/<version>/
  bin/
  lib/
  include/
  share/
  arcus-memcached-<version>.tar.gz
  src/

또한, 다음 파일이 이미 존재하면 해당 호스트의 재설치를 생략합니다.

<path>/<version>/bin/memcached

@f1v3-dev
f1v3-dev requested review from namsic and oliviarla July 13, 2026 08:54
@f1v3-dev f1v3-dev self-assigned this Jul 13, 2026
@f1v3-dev
f1v3-dev force-pushed the f1v3/cluster-deploy branch from 4921ad0 to 4957fdc Compare July 13, 2026 09:00
@f1v3-dev

Copy link
Copy Markdown
Author

Clutser Topology의 Config 구조를 변경했습니다.

초기에 threads, max_connections, listen, engine.memory_limit 와 같은 뼈대를 만들어 뒀는데, 구동 옵션이 워낙 많고 대부분 -t, -c, -l, -m 같은 CLI 인자 형태라 이를 전부 구조체 필드로 관리하기는 힘들다고 판단을 했습니다.

그래서 memcached 구동 인자를 그대로 전달하는 options 를 문자열로 두는 방식으로 변경하였습니다.

global_config 와 서버별 config 모두 동일하게 적용됩니다.

AS-IS

servers:
  - address: cache3:11211
    config:
      listen: 192.168.1.3

global_config:
  threads: 4
  max_connections: 1024
  engine:
    memory_limit: 64
    eviction: true

TO-BE

servers:
  - address: cache3:11211
    config:
      options: "-l 192.168.1.3"

global_config:
  options: "-t 4 -c 1024 -m 64"

Comment thread internal/topology/cluster.go Outdated
Comment thread internal/cluster/znode.go Outdated
Comment thread internal/cluster/install.go Outdated
Comment thread cluster-sample-topology.yml
@f1v3-dev
f1v3-dev force-pushed the f1v3/cluster-deploy branch 2 times, most recently from 203d2f9 to c5836e7 Compare July 15, 2026 06:46
@f1v3-dev
f1v3-dev requested a review from namsic July 15, 2026 06:47
Comment thread cluster-sample-topology.yml Outdated
@f1v3-dev
f1v3-dev force-pushed the f1v3/cluster-deploy branch from c5836e7 to a67013e Compare July 21, 2026 07:06

@oliviarla oliviarla left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

생각해보니 znode 뼈대 생성하는 작업을 어디서 진행할 지 설계 문서에 명시해두질 않았는데요, deploy 시에 만들어두어야 할 것 같습니다. 혹은 start 시에 만드는 것도 고려할 수 있습니다.

Comment thread internal/topology/cluster.go
Comment thread internal/topology/cluster.go
Comment thread internal/topology/cluster.go Outdated
Comment thread internal/cluster/deploy.go Outdated
Comment thread internal/cluster/download.go Outdated
@f1v3-dev
f1v3-dev force-pushed the f1v3/cluster-deploy branch from a67013e to 633691c Compare July 27, 2026 01:51
@f1v3-dev
f1v3-dev requested a review from oliviarla July 27, 2026 05:46
@f1v3-dev

Copy link
Copy Markdown
Author

변경 사항

  1. arcusctl cluster deploy <version> <topology.yaml> 과 같이 deploy시 znode 생성하는 방식으로 변경하겠습니다.
  2. 또한, Enterprise의 경우 Replication 전용 port 설정을 포함시키지 않은 상태여서 해당 방식도 수정하도록 하겠습니다.

@f1v3-dev
f1v3-dev force-pushed the f1v3/cluster-deploy branch from 633691c to 6212528 Compare July 28, 2026 08:47
@f1v3-dev

Copy link
Copy Markdown
Author

@namsic @oliviarla

arcusctl zk deploy <version> <topology.yaml> 호출 시 아래와 같은 방식으로 ZNode를 생성하도록 수정하였습니다.

1. Cluster deploy - Community

community.yaml

servicecode: test-community
path: /tmp/arcusctl-test/arcus-memcached

zookeeper: localhost:3181,localhost:3182,localhost:3183

servers:
  - address: localhost:33533
  - address: localhost:33534
  - address: localhost:33535

global_config:
  threads: 4
  max_connections: 1024
  engine:
    memory_limit: 64

Run

./arcusctl cluster deploy 1.16.1 community.yaml

ZNode 구조

[zk: 127.0.0.1:3181(CONNECTED) 0] ls -R /
/
/arcus
/zookeeper
/arcus/cache_list
/arcus/cache_server_mapping
/arcus/client_list
/arcus/cache_list/test-community
/arcus/cache_server_mapping/localhost:33533
/arcus/cache_server_mapping/localhost:33534
/arcus/cache_server_mapping/localhost:33535
/arcus/cache_server_mapping/localhost:33533/test-community
/arcus/cache_server_mapping/localhost:33534/test-community
/arcus/cache_server_mapping/localhost:33535/test-community
/arcus/client_list/test-community
/zookeeper/config
/zookeeper/quota

2. Cluster deploy - Enterprise

enterprise.yaml

servicecode: test-enterprise
path: /tmp/arcusctl-test/arcus-memcached-ee

zookeeper: localhost:3181,localhost:3182,localhost:3183

servers:
  - address: localhost:13211
    group:
      name: g1
      role: master
      port: 33533
  - address: localhost:13212
    group:
      name: g1
      role: slave
      port: 33534
  - address: localhost:13213
    group:
      name: g2
      role: master
      port: 33535
  - address: localhost:13214
    group:
      name: g2
      role: slave
      port: 33536

global_config:
  threads: 4
  max_connections: 1024
  engine:
    memory_limit: 64

Run

// arcus-memecached-EE가 존재해야 함.
./arcusctl cluster deploy 0.12.1-E enterprise.yaml

ZNode 구조

[zk: 127.0.0.1:3181(CONNECTED) 0] ls -R /
/
/arcus_repl
/zookeeper
/arcus_repl/cache_list
/arcus_repl/cache_server_mapping
/arcus_repl/client_list
/arcus_repl/group_list
/arcus_repl/cache_list/test-enterprise
/arcus_repl/cache_server_mapping/localhost:13211
/arcus_repl/cache_server_mapping/localhost:13212
/arcus_repl/cache_server_mapping/localhost:13213
/arcus_repl/cache_server_mapping/localhost:13214
/arcus_repl/cache_server_mapping/localhost:13211/test-enterprise^g1^localhost:33533
/arcus_repl/cache_server_mapping/localhost:13212/test-enterprise^g1^localhost:33534
/arcus_repl/cache_server_mapping/localhost:13213/test-enterprise^g2^localhost:33535
/arcus_repl/cache_server_mapping/localhost:13214/test-enterprise^g2^localhost:33536
/arcus_repl/client_list/test-enterprise
/arcus_repl/group_list/test-enterprise
/arcus_repl/group_list/test-enterprise/g1
/arcus_repl/group_list/test-enterprise/g2
/zookeeper/config
/zookeeper/quota

@oliviarla oliviarla left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

오타 수정만 해주시면 될 것 같습니다.

Comment thread internal/cluster/deploy.go Outdated
Comment thread internal/cluster/znode.go Outdated
@f1v3-dev
f1v3-dev force-pushed the f1v3/cluster-deploy branch from 6212528 to 78521e0 Compare July 29, 2026 07:51
@f1v3-dev
f1v3-dev requested a review from oliviarla July 29, 2026 07:52
@oliviarla
oliviarla merged commit a2666b0 into develop Jul 29, 2026
1 check passed
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.

3 participants