- Cluster = 가용성과 Load Balancing을 고려(어플리케이션은 어디로 던지는지 고려 안함, 죽으면, fail over되면 알아서 해결)
세팅정보를 저장할 DB가 있어야 함(Key:Value를 저장하는 nosql형태의 DB 사용, 여기서는 Discovery Service - ETCD를 사용한다)
NODE이중화는 최소 3 NODE
- 과반수 이상의 같은 Data의 경우 Recovery 가능
ETCD는 로컬볼륨으로 각 Node에 설치한다.
Master Node는 어떤 데이터도 갖지 않고 어플리케이션만 고려
Node간 통신을 위해서는 overlay 네트웍이 필요(VxLAN)
그리고 외부망 통신은 bridge로 한다!
SWARM의 장점은 세팅이 간단하다는 것
Kubernetes는 설치가 어렵다
*SWARM Scale in Scale out 예제 :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | [root@host01-2 ~]# docker swarm join \ > --token SWMTKN-1-0qw1ki2xppg9rh6fhw310wi4dhczl54hl3uweydrfo2ld3aw2z-06n8xco8k8gpzwstwl5u2s0pr \ > 10.10.12.13:2377 Error response from daemon: This node is already part of a swarm. Use "docker swarm leave" to leave this swarm and join another one. [root@host01-2 ~]# docker network ls NETWORK ID NAME DRIVER SCOPE 76d13a20d92c bridge bridge local 2626920fe992 docker_gwbridge bridge local a4bddc4df10b host host local y39kmqh237vy ingress overlay swarm 1e75b30aa8ac isolated_nw bridge local e9ef483dde2d none null local 5c585fb9c7f2 temp_default bridge local efe418b38219 test bridge local [root@host01-2 ~]# docker service ls ID NAME MODE REPLICAS IMAGE PORTS [root@host01-2 ~]# docker service create --replicas 2 --name hello reg.cloud.com/alpine ping docker.com q86onfawwioyu50p9pfoh78om overall progress: 2 out of 2 tasks 1/2: running [==================================================>] 2/2: running [==================================================>] verify: Service converged [root@host01-2 ~]# docker service ps hello ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS c5q5vvadwnj7 hello.1 reg.cloud.com/alpine:latest host01-2.cloud.com Running Running 2 minutes ago wiqej3wj0xfy hello.2 reg.cloud.com/alpine:latest host01-2.cloud.com Running Running 2 minutes ago [root@host01-2 ~]# docker service scale hello=4 hello scaled to 4 overall progress: 4 out of 4 tasks 1/4: running [==================================================>] 2/4: running [==================================================>] 3/4: running [==================================================>] 4/4: running [==================================================>] verify: Service converged [root@host01-2 ~]# docker service ps hello ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS c5q5vvadwnj7 hello.1 reg.cloud.com/alpine:latest host01-2.cloud.com Running Running 3 minutes ago wiqej3wj0xfy hello.2 reg.cloud.com/alpine:latest host01-2.cloud.com Running Running 3 minutes ago n02v6wp29911 hello.3 reg.cloud.com/alpine:latest host01-2.cloud.com Running Running 27 seconds ago yse5jakppzod hello.4 reg.cloud.com/alpine:latest host01-2.cloud.com Running Running 27 seconds ago [root@host01-2 ~]# docker service scale hello=1 hello scaled to 1 overall progress: 1 out of 1 tasks 1/1: running [==================================================>] verify: Service converged [root@host01-2 ~]# | cs |
'Docker(도커) Kubernetes' 카테고리의 다른 글
Kubernetes 설치 및 사용법, Yaml으로 pod 및 rc 생성 (0) | 2018.05.25 |
---|---|
도커 관련 설정 파일 모음 (2) | 2018.05.24 |
Docker cp 명령어, Docker Compose (0) | 2018.05.24 |
docker network 네트워크 연결 및 구성 (0) | 2018.05.24 |
docker 볼륨(volume) 컨테이너 마운트 방법 (0) | 2018.05.24 |