introduce to spring cloud

23
Introduce to Spring Cloud 2016.10.28 엄두성

Transcript of introduce to spring cloud

Page 1: introduce to spring cloud

Introduce to

Spring Cloud

2016.10.28

엄두성

Page 2: introduce to spring cloud

목차

1. Spring Cloud?

a. Spring Cloud 소개

2. 더 들여다 보기

a. Cental Configuration

b. Eureka

c. Zuul

d. Hystrix

3. Sample

4. QnA

Page 3: introduce to spring cloud

Spring Cloud?

Page 4: introduce to spring cloud

1-1 Spring Cloud?

4 / 12

Page 5: introduce to spring cloud

1-2

• 분산된 시스템의 공통 패턴(Cloud Native)을 신속하게 구축할 수 있는 도구 제공

• 일종의 컴포넌트 연합

- Service registration and discovery (Netflix Eureka)

- Central configuration (Spring Cloud Configuration Server)

- Proxy / Dynamic Load balancer (Netflix Ribbon)

- Circuit Breakers (Netflix Hystrix)

- ETC

• Cloud Native라는 개념을 다른 언어, 다른 컴포넌트로도 풀어낼 수 있다

Spring Cloud?

5 / 12

Page 6: introduce to spring cloud

더들여다보기

Page 7: introduce to spring cloud

2-1

주요 기능 구성들

• Central configuration (Spring Cloud Configuration Server)

• Service registration and discovery (Netflix Eureka)

• Proxy / Dynamic Load balancer (Netflix Zuul)

• Circuit Breakers (Netflix Hystrix)

그 외 주요기능을 지원할 수 있는 필요 구성들

• OAuth 2.0 protected APIs

• Monitoring (Zipkin)

• Centralized Log Analysis (ELK)

더 들여다 보기

7 / 12

Page 8: introduce to spring cloud

2-2

Central configuration (Spring Cloud Configuration Server)

더 들여다 보기

8 / 12

서버1

시스템

환경변수정보

서버2

시스템

환경변수정보

서버3

시스템

환경변수정보

소스 버전 관리 시스템

Page 9: introduce to spring cloud

2-3

Central configuration (Spring Cloud Configuration Server)

• 환경변수를 제공해주는 Rest API 서버(필수)와 환경변수를 받는 클라이언트로 구성(옵션)

• JSON 형식으로 제공 (어떤 서버에서도 사용가능)

• 버전관리 저장소에 의해 지원되는 중앙 집중식 외부 구성 관리

더 들여다 보기

9 / 12

Page 10: introduce to spring cloud

2-4

Spring Cloud Netflix Project

• 기존의 Netflix OSS를 Spring에서 쓰기 쉽게 Integration

• 다양한 Netflix OSS 구성 요소

EUREKA

Hystrix

Zuul

ETC

더 들여다 보기

10 / 12

Page 11: introduce to spring cloud

2-5

Spring Cloud Netflix – Eureka (Service Discovery Server)

• 어떤 서버가 어떤 정보를 가지고 동작하는지에 대한 내용을 실시간으로 서비스에 반영

• Eureka Server와 Eureka Discovery(Client)로 나뉨

더 들여다 보기

11 / 12

Page 12: introduce to spring cloud

2-6

Spring Cloud Netflix – Eureka (Service Discovery Server)

더 들여다 보기

12 / 12

Page 13: introduce to spring cloud

2-7

Spring Cloud Netflix – Eureka (Service Discovery Server)

• Eureka를 통해 각 클라이언트의 정보 확인

더 들여다 보기

13 / 12

Page 14: introduce to spring cloud

2-8

Spring Cloud Netflix – Zuul (Proxy / Dynamic Load balancer )

• 인증 및 보안

• 모니터링

• 동적 라우팅

• 부하테스트

• 트래픽 드롭(정확히는 Shedding)

더 들여다 보기

14 / 12

Page 15: introduce to spring cloud

2-9

Spring Cloud Netflix – Zuul (Proxy / Dynamic Load balancer )

• Proxy

더 들여다 보기

15 / 12

B Service

A Service

클라이언트

abc.cd:8080/hello

abc.cd:8888/eureka

B Service

A Service

클라이언트

abc.cd:8080/hello

abc.cd:8888/eureka

EdgeServer

abc.cd:9999/hello

abc.cd:9999/eureka

Page 16: introduce to spring cloud

2-10

Spring Cloud Netflix – Zuul (Proxy / Dynamic Load balancer )

• Dynamic Load balancer

더 들여다 보기

16 / 12

A Service

A Service

클라이언트 EdgeServer

abc.cd:9999/hello/id

abc.cd:9999/hello/id

abc.cd:8000/hello/id

abc.cd:9998/hello/id

첫번째 요청

첫번째 요청

두번째 요청

두번째 요청

Page 17: introduce to spring cloud

2-11

Spring Cloud Netflix – Zuul (Proxy / Dynamic Load balancer )

• Zipkin (monitoring)

더 들여다 보기

Page 18: introduce to spring cloud

2-12

Spring Cloud Netflix – Hystrix (Circuit Breaker)

더 들여다 보기

18 / 12

Page 19: introduce to spring cloud

2-13

Spring Cloud Netflix – Hystrix (Circuit Breaker)

더 들여다 보기

19 / 12

Supplier클라이언트 CircuitBreaker

연결 성공

Supplier클라이언트 CircuitBreaker

abc.cd:8090/connect

연결 문제 발생

fallbackMethod 실행

abc.cd:8090/connectabc.cd:8080/connect

abc.cd:8080/connect

Page 20: introduce to spring cloud

2-14

Spring Cloud Netflix – Hystrix (Circuit Breaker)

더 들여다 보기

20 / 12

Circuit Breaker – Supplier Connect Success Circuit Breaker – Supplier Connect Problem

Page 21: introduce to spring cloud

Sample

Page 22: introduce to spring cloud

3-1 Sample

22 / 12

코드 저장소

Config Server

Eureka Server

Edge Server S ServerS Server

Service Server

Client

밸런싱

요청설정 설정

즉시 참조

커밋

등록 등록

전달전달

Page 23: introduce to spring cloud

감사합니다.