FEATURE: Add cluster deploy command#46
Conversation
4921ad0 to
4957fdc
Compare
|
Clutser Topology의 Config 구조를 변경했습니다. 초기에 그래서 memcached 구동 인자를 그대로 전달하는
AS-IS servers:
- address: cache3:11211
config:
listen: 192.168.1.3
global_config:
threads: 4
max_connections: 1024
engine:
memory_limit: 64
eviction: trueTO-BE servers:
- address: cache3:11211
config:
options: "-l 192.168.1.3"
global_config:
options: "-t 4 -c 1024 -m 64" |
203d2f9 to
c5836e7
Compare
c5836e7 to
a67013e
Compare
oliviarla
left a comment
There was a problem hiding this comment.
생각해보니 znode 뼈대 생성하는 작업을 어디서 진행할 지 설계 문서에 명시해두질 않았는데요, deploy 시에 만들어두어야 할 것 같습니다. 혹은 start 시에 만드는 것도 고려할 수 있습니다.
| @@ -22,26 +33,115 @@ type GroupInfo struct { | |||
| } | |||
|
|
|||
| type CacheConfig struct { | |||
There was a problem hiding this comment.
CacheConfig라는 타입을 유지하는 것이 좋은가요? string 필드 하나만 두고 있어서 질문합니다.
| edition, err := topo.Edition() | ||
| if err != nil { | ||
| return err | ||
| } |
There was a problem hiding this comment.
현재는 edition 확인을 2번 진행하고 있는데, edition 정보를 Validate 함수 인자로 받아서 1번만 진행하도록 변경하면 어떤가요?
| for name := range slaves { | ||
| if _, ok := masters[name]; !ok { | ||
| return fmt.Errorf("group %q: has slave but no master", name) | ||
| } | ||
| } | ||
|
|
||
| for name, count := range slaves { | ||
| if count != 1 { | ||
| return fmt.Errorf("group %q: must have exactly 1 slave, got %d", name, count) | ||
| } | ||
| } |
| fmt.Fprintln(writer, "ROLE\tGROUP\tADDRESS\tDIRECTORY") | ||
| fmt.Fprintln(writer, "\t\t\t") | ||
|
|
||
| for _, server := range topo.Servers { | ||
| role := "cache" | ||
| group := "-" | ||
|
|
||
| if server.Group != nil { | ||
| role = server.Group.Role | ||
| group = server.Group.Name | ||
| } | ||
|
|
||
| fmt.Fprintf(writer, "%s\t%s\t%s\t%s\n", role, group, server.Address, installPath) |
There was a problem hiding this comment.
edition에 따라 print하는 포맷이 다른 것이 좋을 것 같습니다.
community edition은 ADDRESS, DIRECTORY만 표현해도 될 것 같아서요
| return localTarPath, nil | ||
| } | ||
|
|
||
| func imageDir() string { |
There was a problem hiding this comment.
community / enterprise 각각 디렉토리를 분리하는게 낫지 않을까요?
🔗 Related Issue
⌨️ What I did
cluster deploy명령어를 추가합니다.arcusctl cluster deploy <version> <topology.yml>servers[].group유무로 Community / Enterprise edition을 자동 판별합니다.배포 절차
arcus-memcachedtar.gz 준비wget~/.arcusctl/images/arcus에 넣어둔 tar.gz 사용deps/install.sh로 의존성 설치 →configure,make,make install빌드--enable-replication옵션으로 빌드topology.yml)명령 구조
설치 구조
topology.yaml에서 정의한 path 정보와 버전 정보를 기반으로 아래와 같이 설치합니다.또한, 다음 파일이 이미 존재하면 해당 호스트의 재설치를 생략합니다.