SlideShare a Scribd company logo
1 of 28
Download to read offline
1
Message Queue 가용성, 신뢰성을
위한 RabbitMQ Server, Client 구성
Chloe
2018.01.26
RabbitMQ Concept & How to work
High Availability in RabbitMQ
Clustering & Mirrored Queue
HAProxy
Spring Cloud Stream Sample & configuration: Spring Boot App with Rabbit
2
Message Broker:RabbitMQ
1 Message queueing
2 Delivery acknowledgement
- Acknowledgements and Confirms
- Clustering and High Availability
-Mirrored queue
3 Flexible routing to queues
4 Multiple exchange type
RabbitMQ – 특징
3
Message Broker:RabbitMQ
RabbitMQ 기본 – 메시지 전달 흐름
4
Message Broker:RabbitMQ
RabbitMQ 기본 – 성공적인 메시지 전달을 위한 Broker 구성요소
Exchange
publish된 메시지를 받는 곳
-> Queue
consume가 일어나는 곳
Bindings
Exchange와 Queue 매핑정보
Queue 결정방식
exchange type + routing key
Queue 동작방식
메시지 도착 → 메시지 전송
→ Acknowlegement from Consumer
→ Queue에서 메시지 삭제
5
Message Broker: RabbitMQ
queue name = routing key routing key(*,#,.)로 받을 메시지를 필터링
RabbitMQ 기본 – Exchange Type별 메시지 흐름
6
RabbitMQ High Availability
High Availability
Mission 1 // Rabbit Node가 죽더라도 정상적인 서비스가 가능하도록 만들기
7
RabbitMQ High Availability
High Availability
Wiki
고가용성(HA)이란 서버와 네트워크, 프로그램 등의 정보 시스템이 상당히 오랜 기간 동안
지속적으로 정상 운영이 가능한 성질을 말한다.
고(高)가용성이란 "가용성이 높다"는 뜻으로서, "절대 고장 나지 않음"을 의미한다.
만약 클러스터로 묶인 2개의 서버 중 1대의 서버에서 장애가 발생할 경우,
다른 서버가 즉시 그 업무를 대신 수행하므로, 시스템 장애를 불과 몇 초만에 복구할 수 있다.
8
RabbitMQ High Availability
1 Clustering – 의미와 특징
Clustering 설계 목표
1 하나의 Node가 죽더라도 Producer와 Consumer가 계속 메시지를 교환할 수 있도록 한다
2 메시지 처리량이 많아지면 클러스터에 노드를 새로 추가하여 처리 성능을 높일 수 있다
Cluster
rabbit3 Node
rabbit2 Node
rabbit1 Node
Producer Consumer
9
RabbitMQ High Availability
1 Clustering – 클러스터링 확인
$ ./sbin/rabbitmqctl –n rabbit2 join_cluster rabbit1@`hostname -s`
10
RabbitMQ High Availability
1 Clustering – 클러스터링 확인
$ ./sbin/rabbitmqctl –n rabbit2 list_queues
rabbit1 Node rabbit2 Node
11
RabbitMQ High Availability
1 Clustering – Producer/Consumer App 실행/결과 확인
Cluster
Producer Consumer
localhost:5673
localhost:5672
Case1 – 큐를 선언하지 않은 노드를 중단
Producer: 5 message publish to 5673
5673 down
Consumer: connection consume from 5674
결과: Consumer receives 5 messages
Case2 – 큐를 선언한 노드를 중단
Producer: 5 message publish to 5673
5672 down
Consumer: connection consume from 5674
결과: Consumer ? 5 messages
localhost:5674
rabbit3 Node
rabbit2 Node
rabbit1 Node
12
RabbitMQ High Availability
1 Clustering – 왜 rabbit1에 선언한 Queue에 접근하지 못할까?
Cluster
localhost:5673
localhost:5672 localhost:5674
rabbit3 Node
rabbit2 Node
rabbit1 Node
Queue 위치
Queue는 특정 노드에만 위치한다
다른 노드들은 실제 Queue가 아닌 Queue 메타데이터만 복제하고 있다
13
RabbitMQ High Availability
2 Mirrored Queue – 모든 노드에 메시지 동기화
Cluster
rabbit3 Node
rabbit2 Node
rabbit1 Node
Master Slave (Mirror) Slave (Mirror)
Mirrored Queue 선언
ha-policy 설정
$ sbin/rabbitmqctl -n rabbit1 set_policy ha-all “Queue1” ‘{“ha-mode”:”all”}’
Producer
14
RabbitMQ High Availability
2 Mirrored Queue – ha-all policy 적용 확인
15
RabbitMQ High Availability
2 Mirrored Queue – Master 중단, 새로운 Node 추가 시 동작
Cluster
rabbit3 Node
rabbit2 Node
rabbit1 Node
Master Master Slave (Mirror)
Master queue가 있는 Node가 중단 되었을 때
가장 오래된 Slave가 Master로 전환
새로운 노드가 Cluster에 추가 되었을 때
추가된 시점부터 들어온 메시지만 Mirroring, 이전 메시지는 복사하지 않는다
과거 데이터를 모두 복사하려면 ha-sync-mode 설정
16
RabbitMQ High Availability
2 Mirrored Queue – ha-all 설정 테스트 실행/결과 확인
Producer Consumer
localhost:5673
localhost:5672
Case1 – Mirrored Queue 선언 전
Producer: 5 message publish to 5673
5673 down (Queue 선언 노드)
Consumer: connection consume from 5674
결과: Consumer can’t receives 5 messages
Case2 – Mirrored Queue 선언 전
Producer: 5 message publish to 5673
5672 down (Master)
Consumer: connection consume from 5674
결과: Consumer receives messages
localhost:5674
Cluster
rabbit3 Node
rabbit2 Node
rabbit1 Node
Master Slave (Mirror) Slave (Mirror)
17
RabbitMQ High Availability
HAProxy – Reverse Proxy server
Cluster
rabbit3 Node
rabbit2 Node
rabbit1 Node
Producer Consumer
HAProxy
localhost:5670
18
RabbitMQ High Availability
HAProxy – 특징
http://seokjun.kr/haproxy-and-nginx-load-balancing/일부 요약
Haproxy 는 L4, L7 과 같은 하드웨어 로드밸런서를 대체하기 위한 오픈소스 소프트에어
Reverse Proxy를 기반으로 로드밸런싱을 하기에 매우 강력하고 가벼움
HA (High Availability) 라는 이름처럼 고가용성을 위하여 설계됨
Nginx 로드밸런싱과 다른 점은 헬스체크라고 볼 수 있는데,
특정 API 에 접근하여 서버 상태를 점검하고, 문제가 있으면 다른 node 로 트래픽을 넘겨줄 수 있는 기능을 함
Nginx 자체의 로드밸런싱도 훌륭하지만, 굳이 웹 서버로서의 역할이 필요가 없다면
HAProxy 로드 밸런싱이 헬스체크가 가능하기도 하고 좀 더 가벼우니 필요에 따라 선택하면 좋을 것이다.
Stats 페이지 기본 제공, 어떤 서버에 접속되고 작동하고 있는지 확인하기 편리
간단하게 Nginx 와 HAProxy 의 로드밸런싱에 대해서 알아보았다.
19
RabbitMQ High Availability
HAProxy – 테스트 확인
Case1 – Mirrored Queue 선언 전
Consumer: connection consume from 5674
5674 down (Queue 선언 노드)
결과: Connection failed
Case2 – Mirrored Queue 선언 전
Consumer: connection consume from 5670
Node which connected with consumer down
결과: Re-connected automatically
Producer Consumer
localhost:5670
Cluster
HAProxy
Producer Consumer
Cluster
localhost:567x localhost:567x
20
RabbitMQ High Availability
HAProxy – haproxy.cfg
… (중략)
listen rabbitmq_local_cluster
bind *:5670
mode tcp
balance roundrobin
server rabbit1 127.0.0.1:5672 check inter 5000 rise 2 fall 3
server rabbit2 127.0.0.1:5673 check inter 5000 rise 2 fall 3
server rabbit3 127.0.0.1:5674 check inter 5000 rise 2 fall 3
listen private_monitoring
bind *:8100
mode http
option httplog
stats enable
stats uri /stats
stats refresh 5s
21
RabbitMQ High Availability
HAProxy – localhost:8100/stats
22
Spring Cloud Stream& Sleuth
Message-driven microservices with Rabbit
Mission 2 // Message queue를 통해 서비스간 커뮤니케이션 하는 경우에도
Sleuth가 trace Id, span Id를 전달하는지 확인할 것
관련 Spring Cloud Framework
Spring cloud Stream
Spring cloud stream-binder rabbit
Spring Sleuth
23
Message-driven microserviceswith Rabbit
Spring Cloud Stream with binder-rabbit
24
Message-driven microserviceswith Rabbit
Sample Boot Apps with Stream & Rabbit
order-service payment-service
product-service
shipment-service
PUB
PUB/SUB
SUB
PUB/SUB
25
Message-driven microserviceswith Rabbit
Spring Cloud Stream 설정과 주의사항
- RabbitMQ의 exchage type를 지정하기 위해서는 stream 1.2 이상, boot 1.5.6 이상 사용해야 함
- destination
- group
- routingKeyExpression
26
Distributedtracing
Spring Cloud Sleuth
27
Distributedtracing
Spring Cloud Sleuth
28
Thank you!
QNA

More Related Content

What's hot

[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기NHN FORWARD
 
[AWS Dev Day] 앱 현대화 | DevOps 개발자가 되기 위한 쿠버네티스 핵심 활용 예제 알아보기 - 정영준 AWS 솔루션즈 아키...
[AWS Dev Day] 앱 현대화 | DevOps 개발자가 되기 위한 쿠버네티스 핵심 활용 예제 알아보기 - 정영준 AWS 솔루션즈 아키...[AWS Dev Day] 앱 현대화 | DevOps 개발자가 되기 위한 쿠버네티스 핵심 활용 예제 알아보기 - 정영준 AWS 솔루션즈 아키...
[AWS Dev Day] 앱 현대화 | DevOps 개발자가 되기 위한 쿠버네티스 핵심 활용 예제 알아보기 - 정영준 AWS 솔루션즈 아키...Amazon Web Services Korea
 
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법Ji-Woong Choi
 
MySQL operator for_kubernetes
MySQL operator for_kubernetesMySQL operator for_kubernetes
MySQL operator for_kubernetesrockplace
 
[OpenInfra Days Korea 2018] (Track 1) TACO (SKT All Container OpenStack): Clo...
[OpenInfra Days Korea 2018] (Track 1) TACO (SKT All Container OpenStack): Clo...[OpenInfra Days Korea 2018] (Track 1) TACO (SKT All Container OpenStack): Clo...
[OpenInfra Days Korea 2018] (Track 1) TACO (SKT All Container OpenStack): Clo...OpenStack Korea Community
 
MySQL GTID 시작하기
MySQL GTID 시작하기MySQL GTID 시작하기
MySQL GTID 시작하기I Goo Lee
 
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-RegionJi-Woong Choi
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바NeoClova
 
HAProxy TCP 모드에서 내부 서버로 Source IP 전달 방법
HAProxy TCP 모드에서 내부 서버로 Source IP 전달 방법HAProxy TCP 모드에서 내부 서버로 Source IP 전달 방법
HAProxy TCP 모드에서 내부 서버로 Source IP 전달 방법Young D
 
오픈스택 기반 클라우드 서비스 구축 방안 및 사례
오픈스택 기반 클라우드 서비스 구축 방안 및 사례오픈스택 기반 클라우드 서비스 구축 방안 및 사례
오픈스택 기반 클라우드 서비스 구축 방안 및 사례SONG INSEOB
 
[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육
[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육
[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육Ji-Woong Choi
 
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기Ji-Woong Choi
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with AnsibleRayed Alrashed
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to AnsibleKnoldus Inc.
 
LoadBalancer using KeepAlived
LoadBalancer using KeepAlivedLoadBalancer using KeepAlived
LoadBalancer using KeepAlivedKhushalChandak1
 
Dkos(mesos기반의 container orchestration)
Dkos(mesos기반의 container orchestration)Dkos(mesos기반의 container orchestration)
Dkos(mesos기반의 container orchestration)Won-Chon Jung
 
Paul Angus - CloudStack Backup and Recovery Framework
Paul Angus - CloudStack Backup and Recovery FrameworkPaul Angus - CloudStack Backup and Recovery Framework
Paul Angus - CloudStack Backup and Recovery FrameworkShapeBlue
 

What's hot (20)

[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기
 
[AWS Dev Day] 앱 현대화 | DevOps 개발자가 되기 위한 쿠버네티스 핵심 활용 예제 알아보기 - 정영준 AWS 솔루션즈 아키...
[AWS Dev Day] 앱 현대화 | DevOps 개발자가 되기 위한 쿠버네티스 핵심 활용 예제 알아보기 - 정영준 AWS 솔루션즈 아키...[AWS Dev Day] 앱 현대화 | DevOps 개발자가 되기 위한 쿠버네티스 핵심 활용 예제 알아보기 - 정영준 AWS 솔루션즈 아키...
[AWS Dev Day] 앱 현대화 | DevOps 개발자가 되기 위한 쿠버네티스 핵심 활용 예제 알아보기 - 정영준 AWS 솔루션즈 아키...
 
CDN overview
CDN overviewCDN overview
CDN overview
 
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
[오픈소스컨설팅]Day #1 MySQL 엔진소개, 튜닝, 백업 및 복구, 업그레이드방법
 
MySQL operator for_kubernetes
MySQL operator for_kubernetesMySQL operator for_kubernetes
MySQL operator for_kubernetes
 
[OpenInfra Days Korea 2018] (Track 1) TACO (SKT All Container OpenStack): Clo...
[OpenInfra Days Korea 2018] (Track 1) TACO (SKT All Container OpenStack): Clo...[OpenInfra Days Korea 2018] (Track 1) TACO (SKT All Container OpenStack): Clo...
[OpenInfra Days Korea 2018] (Track 1) TACO (SKT All Container OpenStack): Clo...
 
MySQL GTID 시작하기
MySQL GTID 시작하기MySQL GTID 시작하기
MySQL GTID 시작하기
 
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바
 
HAProxy TCP 모드에서 내부 서버로 Source IP 전달 방법
HAProxy TCP 모드에서 내부 서버로 Source IP 전달 방법HAProxy TCP 모드에서 내부 서버로 Source IP 전달 방법
HAProxy TCP 모드에서 내부 서버로 Source IP 전달 방법
 
오픈스택 기반 클라우드 서비스 구축 방안 및 사례
오픈스택 기반 클라우드 서비스 구축 방안 및 사례오픈스택 기반 클라우드 서비스 구축 방안 및 사례
오픈스택 기반 클라우드 서비스 구축 방안 및 사례
 
[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육
[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육
[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육
 
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
LoadBalancer using KeepAlived
LoadBalancer using KeepAlivedLoadBalancer using KeepAlived
LoadBalancer using KeepAlived
 
Dkos(mesos기반의 container orchestration)
Dkos(mesos기반의 container orchestration)Dkos(mesos기반의 container orchestration)
Dkos(mesos기반의 container orchestration)
 
Paul Angus - CloudStack Backup and Recovery Framework
Paul Angus - CloudStack Backup and Recovery FrameworkPaul Angus - CloudStack Backup and Recovery Framework
Paul Angus - CloudStack Backup and Recovery Framework
 
Docker compose
Docker composeDocker compose
Docker compose
 
ansible why ?
ansible why ?ansible why ?
ansible why ?
 

Similar to Message Queue 가용성, 신뢰성을 위한 RabbitMQ Server, Client 구성

오픈스택 멀티노드 설치 후기
오픈스택 멀티노드 설치 후기오픈스택 멀티노드 설치 후기
오픈스택 멀티노드 설치 후기영우 김
 
Mcollective orchestration tool 소개
Mcollective orchestration tool 소개Mcollective orchestration tool 소개
Mcollective orchestration tool 소개태준 문
 
ShieldOne-SIG 제품소개서 3.5
ShieldOne-SIG 제품소개서 3.5ShieldOne-SIG 제품소개서 3.5
ShieldOne-SIG 제품소개서 3.5PLUS-I
 
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0Ji-Woong Choi
 
Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)
Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)
Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)Cloud-Barista Community
 
Implementing remote procedure calls rev2
Implementing remote procedure calls rev2Implementing remote procedure calls rev2
Implementing remote procedure calls rev2Sung-jae Park
 
멀티클라우드 Service Mesh
멀티클라우드 Service Mesh멀티클라우드 Service Mesh
멀티클라우드 Service MeshJeong-Ho Na
 
Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Larva - Cloud-Barista 인큐베이터(Cloud-Barista Incu...
Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Larva - Cloud-Barista 인큐베이터(Cloud-Barista Incu...Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Larva - Cloud-Barista 인큐베이터(Cloud-Barista Incu...
Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Larva - Cloud-Barista 인큐베이터(Cloud-Barista Incu...Cloud-Barista Community
 
[2B5]nBase-ARC Redis Cluster
[2B5]nBase-ARC Redis Cluster[2B5]nBase-ARC Redis Cluster
[2B5]nBase-ARC Redis ClusterNAVER D2
 
MySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software TestMySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software TestI Goo Lee
 
1st SDN Interest Group Seminar - Session1 (121017)
1st SDN Interest Group Seminar - Session1 (121017)1st SDN Interest Group Seminar - Session1 (121017)
1st SDN Interest Group Seminar - Session1 (121017)NAIM Networks, Inc.
 
Cisco VxLAN, LTRDCT-1223 Implementing VXLAN in a Data Center.pdf
Cisco VxLAN, LTRDCT-1223 Implementing VXLAN in a Data Center.pdfCisco VxLAN, LTRDCT-1223 Implementing VXLAN in a Data Center.pdf
Cisco VxLAN, LTRDCT-1223 Implementing VXLAN in a Data Center.pdfssusercbaa33
 
Elastic Load Balancing 심층 분석 - AWS Summit Seoul 2017
Elastic Load Balancing 심층 분석 - AWS Summit Seoul 2017Elastic Load Balancing 심층 분석 - AWS Summit Seoul 2017
Elastic Load Balancing 심층 분석 - AWS Summit Seoul 2017Amazon Web Services Korea
 
[Main Session] 카프카, 데이터 플랫폼의 최강자
[Main Session] 카프카, 데이터 플랫폼의 최강자[Main Session] 카프카, 데이터 플랫폼의 최강자
[Main Session] 카프카, 데이터 플랫폼의 최강자Oracle Korea
 
Cloud-Barista 제4차 오픈 컨퍼런스 : CB-Larva - 멀티클라우드 인프라 및 응용을 위한 네트워킹 (Networking f...
Cloud-Barista 제4차 오픈 컨퍼런스 : CB-Larva - 멀티클라우드 인프라 및 응용을 위한 네트워킹 (Networking f...Cloud-Barista 제4차 오픈 컨퍼런스 : CB-Larva - 멀티클라우드 인프라 및 응용을 위한 네트워킹 (Networking f...
Cloud-Barista 제4차 오픈 컨퍼런스 : CB-Larva - 멀티클라우드 인프라 및 응용을 위한 네트워킹 (Networking f...Cloud-Barista Community
 
Dropbox와 같은 시스템은 파일을 어떻게 저장할까?
Dropbox와 같은 시스템은 파일을 어떻게 저장할까?Dropbox와 같은 시스템은 파일을 어떻게 저장할까?
Dropbox와 같은 시스템은 파일을 어떻게 저장할까?nexusz99
 
Understanding of Apache kafka metrics for monitoring
Understanding of Apache kafka metrics for monitoring Understanding of Apache kafka metrics for monitoring
Understanding of Apache kafka metrics for monitoring SANG WON PARK
 

Similar to Message Queue 가용성, 신뢰성을 위한 RabbitMQ Server, Client 구성 (20)

L4교육자료
L4교육자료L4교육자료
L4교육자료
 
오픈스택 멀티노드 설치 후기
오픈스택 멀티노드 설치 후기오픈스택 멀티노드 설치 후기
오픈스택 멀티노드 설치 후기
 
Mcollective orchestration tool 소개
Mcollective orchestration tool 소개Mcollective orchestration tool 소개
Mcollective orchestration tool 소개
 
ShieldOne-SIG 제품소개서 3.5
ShieldOne-SIG 제품소개서 3.5ShieldOne-SIG 제품소개서 3.5
ShieldOne-SIG 제품소개서 3.5
 
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
 
Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)
Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)
Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)
 
Implementing remote procedure calls rev2
Implementing remote procedure calls rev2Implementing remote procedure calls rev2
Implementing remote procedure calls rev2
 
멀티클라우드 Service Mesh
멀티클라우드 Service Mesh멀티클라우드 Service Mesh
멀티클라우드 Service Mesh
 
Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Larva - Cloud-Barista 인큐베이터(Cloud-Barista Incu...
Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Larva - Cloud-Barista 인큐베이터(Cloud-Barista Incu...Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Larva - Cloud-Barista 인큐베이터(Cloud-Barista Incu...
Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Larva - Cloud-Barista 인큐베이터(Cloud-Barista Incu...
 
[2B5]nBase-ARC Redis Cluster
[2B5]nBase-ARC Redis Cluster[2B5]nBase-ARC Redis Cluster
[2B5]nBase-ARC Redis Cluster
 
MySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software TestMySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software Test
 
1st SDN Interest Group Seminar - Session1 (121017)
1st SDN Interest Group Seminar - Session1 (121017)1st SDN Interest Group Seminar - Session1 (121017)
1st SDN Interest Group Seminar - Session1 (121017)
 
Kafka slideshare
Kafka   slideshareKafka   slideshare
Kafka slideshare
 
Cisco VxLAN, LTRDCT-1223 Implementing VXLAN in a Data Center.pdf
Cisco VxLAN, LTRDCT-1223 Implementing VXLAN in a Data Center.pdfCisco VxLAN, LTRDCT-1223 Implementing VXLAN in a Data Center.pdf
Cisco VxLAN, LTRDCT-1223 Implementing VXLAN in a Data Center.pdf
 
Elastic Load Balancing 심층 분석 - AWS Summit Seoul 2017
Elastic Load Balancing 심층 분석 - AWS Summit Seoul 2017Elastic Load Balancing 심층 분석 - AWS Summit Seoul 2017
Elastic Load Balancing 심층 분석 - AWS Summit Seoul 2017
 
[Main Session] 카프카, 데이터 플랫폼의 최강자
[Main Session] 카프카, 데이터 플랫폼의 최강자[Main Session] 카프카, 데이터 플랫폼의 최강자
[Main Session] 카프카, 데이터 플랫폼의 최강자
 
Cloud-Barista 제4차 오픈 컨퍼런스 : CB-Larva - 멀티클라우드 인프라 및 응용을 위한 네트워킹 (Networking f...
Cloud-Barista 제4차 오픈 컨퍼런스 : CB-Larva - 멀티클라우드 인프라 및 응용을 위한 네트워킹 (Networking f...Cloud-Barista 제4차 오픈 컨퍼런스 : CB-Larva - 멀티클라우드 인프라 및 응용을 위한 네트워킹 (Networking f...
Cloud-Barista 제4차 오픈 컨퍼런스 : CB-Larva - 멀티클라우드 인프라 및 응용을 위한 네트워킹 (Networking f...
 
Dropbox와 같은 시스템은 파일을 어떻게 저장할까?
Dropbox와 같은 시스템은 파일을 어떻게 저장할까?Dropbox와 같은 시스템은 파일을 어떻게 저장할까?
Dropbox와 같은 시스템은 파일을 어떻게 저장할까?
 
KAFKA 3.1.0.pdf
KAFKA 3.1.0.pdfKAFKA 3.1.0.pdf
KAFKA 3.1.0.pdf
 
Understanding of Apache kafka metrics for monitoring
Understanding of Apache kafka metrics for monitoring Understanding of Apache kafka metrics for monitoring
Understanding of Apache kafka metrics for monitoring
 

Recently uploaded

JMP를 활용한 가속열화 분석 사례
JMP를 활용한 가속열화 분석 사례JMP를 활용한 가속열화 분석 사례
JMP를 활용한 가속열화 분석 사례JMP Korea
 
JMP를 활용한 전자/반도체 산업 Yield Enhancement Methodology
JMP를 활용한 전자/반도체 산업 Yield Enhancement MethodologyJMP를 활용한 전자/반도체 산업 Yield Enhancement Methodology
JMP를 활용한 전자/반도체 산업 Yield Enhancement MethodologyJMP Korea
 
공학 관점에서 바라본 JMP 머신러닝 최적화
공학 관점에서 바라본 JMP 머신러닝 최적화공학 관점에서 바라본 JMP 머신러닝 최적화
공학 관점에서 바라본 JMP 머신러닝 최적화JMP Korea
 
JMP가 걸어온 여정, 새로운 도약 JMP 18!
JMP가 걸어온 여정, 새로운 도약 JMP 18!JMP가 걸어온 여정, 새로운 도약 JMP 18!
JMP가 걸어온 여정, 새로운 도약 JMP 18!JMP Korea
 
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석JMP Korea
 
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?Jay Park
 
데이터 분석 문제 해결을 위한 나의 JMP 활용법
데이터 분석 문제 해결을 위한 나의 JMP 활용법데이터 분석 문제 해결을 위한 나의 JMP 활용법
데이터 분석 문제 해결을 위한 나의 JMP 활용법JMP Korea
 
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개JMP Korea
 

Recently uploaded (8)

JMP를 활용한 가속열화 분석 사례
JMP를 활용한 가속열화 분석 사례JMP를 활용한 가속열화 분석 사례
JMP를 활용한 가속열화 분석 사례
 
JMP를 활용한 전자/반도체 산업 Yield Enhancement Methodology
JMP를 활용한 전자/반도체 산업 Yield Enhancement MethodologyJMP를 활용한 전자/반도체 산업 Yield Enhancement Methodology
JMP를 활용한 전자/반도체 산업 Yield Enhancement Methodology
 
공학 관점에서 바라본 JMP 머신러닝 최적화
공학 관점에서 바라본 JMP 머신러닝 최적화공학 관점에서 바라본 JMP 머신러닝 최적화
공학 관점에서 바라본 JMP 머신러닝 최적화
 
JMP가 걸어온 여정, 새로운 도약 JMP 18!
JMP가 걸어온 여정, 새로운 도약 JMP 18!JMP가 걸어온 여정, 새로운 도약 JMP 18!
JMP가 걸어온 여정, 새로운 도약 JMP 18!
 
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석
 
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
 
데이터 분석 문제 해결을 위한 나의 JMP 활용법
데이터 분석 문제 해결을 위한 나의 JMP 활용법데이터 분석 문제 해결을 위한 나의 JMP 활용법
데이터 분석 문제 해결을 위한 나의 JMP 활용법
 
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개
 

Message Queue 가용성, 신뢰성을 위한 RabbitMQ Server, Client 구성

  • 1. 1 Message Queue 가용성, 신뢰성을 위한 RabbitMQ Server, Client 구성 Chloe 2018.01.26 RabbitMQ Concept & How to work High Availability in RabbitMQ Clustering & Mirrored Queue HAProxy Spring Cloud Stream Sample & configuration: Spring Boot App with Rabbit
  • 2. 2 Message Broker:RabbitMQ 1 Message queueing 2 Delivery acknowledgement - Acknowledgements and Confirms - Clustering and High Availability -Mirrored queue 3 Flexible routing to queues 4 Multiple exchange type RabbitMQ – 특징
  • 3. 3 Message Broker:RabbitMQ RabbitMQ 기본 – 메시지 전달 흐름
  • 4. 4 Message Broker:RabbitMQ RabbitMQ 기본 – 성공적인 메시지 전달을 위한 Broker 구성요소 Exchange publish된 메시지를 받는 곳 -> Queue consume가 일어나는 곳 Bindings Exchange와 Queue 매핑정보 Queue 결정방식 exchange type + routing key Queue 동작방식 메시지 도착 → 메시지 전송 → Acknowlegement from Consumer → Queue에서 메시지 삭제
  • 5. 5 Message Broker: RabbitMQ queue name = routing key routing key(*,#,.)로 받을 메시지를 필터링 RabbitMQ 기본 – Exchange Type별 메시지 흐름
  • 6. 6 RabbitMQ High Availability High Availability Mission 1 // Rabbit Node가 죽더라도 정상적인 서비스가 가능하도록 만들기
  • 7. 7 RabbitMQ High Availability High Availability Wiki 고가용성(HA)이란 서버와 네트워크, 프로그램 등의 정보 시스템이 상당히 오랜 기간 동안 지속적으로 정상 운영이 가능한 성질을 말한다. 고(高)가용성이란 "가용성이 높다"는 뜻으로서, "절대 고장 나지 않음"을 의미한다. 만약 클러스터로 묶인 2개의 서버 중 1대의 서버에서 장애가 발생할 경우, 다른 서버가 즉시 그 업무를 대신 수행하므로, 시스템 장애를 불과 몇 초만에 복구할 수 있다.
  • 8. 8 RabbitMQ High Availability 1 Clustering – 의미와 특징 Clustering 설계 목표 1 하나의 Node가 죽더라도 Producer와 Consumer가 계속 메시지를 교환할 수 있도록 한다 2 메시지 처리량이 많아지면 클러스터에 노드를 새로 추가하여 처리 성능을 높일 수 있다 Cluster rabbit3 Node rabbit2 Node rabbit1 Node Producer Consumer
  • 9. 9 RabbitMQ High Availability 1 Clustering – 클러스터링 확인 $ ./sbin/rabbitmqctl –n rabbit2 join_cluster rabbit1@`hostname -s`
  • 10. 10 RabbitMQ High Availability 1 Clustering – 클러스터링 확인 $ ./sbin/rabbitmqctl –n rabbit2 list_queues rabbit1 Node rabbit2 Node
  • 11. 11 RabbitMQ High Availability 1 Clustering – Producer/Consumer App 실행/결과 확인 Cluster Producer Consumer localhost:5673 localhost:5672 Case1 – 큐를 선언하지 않은 노드를 중단 Producer: 5 message publish to 5673 5673 down Consumer: connection consume from 5674 결과: Consumer receives 5 messages Case2 – 큐를 선언한 노드를 중단 Producer: 5 message publish to 5673 5672 down Consumer: connection consume from 5674 결과: Consumer ? 5 messages localhost:5674 rabbit3 Node rabbit2 Node rabbit1 Node
  • 12. 12 RabbitMQ High Availability 1 Clustering – 왜 rabbit1에 선언한 Queue에 접근하지 못할까? Cluster localhost:5673 localhost:5672 localhost:5674 rabbit3 Node rabbit2 Node rabbit1 Node Queue 위치 Queue는 특정 노드에만 위치한다 다른 노드들은 실제 Queue가 아닌 Queue 메타데이터만 복제하고 있다
  • 13. 13 RabbitMQ High Availability 2 Mirrored Queue – 모든 노드에 메시지 동기화 Cluster rabbit3 Node rabbit2 Node rabbit1 Node Master Slave (Mirror) Slave (Mirror) Mirrored Queue 선언 ha-policy 설정 $ sbin/rabbitmqctl -n rabbit1 set_policy ha-all “Queue1” ‘{“ha-mode”:”all”}’ Producer
  • 14. 14 RabbitMQ High Availability 2 Mirrored Queue – ha-all policy 적용 확인
  • 15. 15 RabbitMQ High Availability 2 Mirrored Queue – Master 중단, 새로운 Node 추가 시 동작 Cluster rabbit3 Node rabbit2 Node rabbit1 Node Master Master Slave (Mirror) Master queue가 있는 Node가 중단 되었을 때 가장 오래된 Slave가 Master로 전환 새로운 노드가 Cluster에 추가 되었을 때 추가된 시점부터 들어온 메시지만 Mirroring, 이전 메시지는 복사하지 않는다 과거 데이터를 모두 복사하려면 ha-sync-mode 설정
  • 16. 16 RabbitMQ High Availability 2 Mirrored Queue – ha-all 설정 테스트 실행/결과 확인 Producer Consumer localhost:5673 localhost:5672 Case1 – Mirrored Queue 선언 전 Producer: 5 message publish to 5673 5673 down (Queue 선언 노드) Consumer: connection consume from 5674 결과: Consumer can’t receives 5 messages Case2 – Mirrored Queue 선언 전 Producer: 5 message publish to 5673 5672 down (Master) Consumer: connection consume from 5674 결과: Consumer receives messages localhost:5674 Cluster rabbit3 Node rabbit2 Node rabbit1 Node Master Slave (Mirror) Slave (Mirror)
  • 17. 17 RabbitMQ High Availability HAProxy – Reverse Proxy server Cluster rabbit3 Node rabbit2 Node rabbit1 Node Producer Consumer HAProxy localhost:5670
  • 18. 18 RabbitMQ High Availability HAProxy – 특징 http://seokjun.kr/haproxy-and-nginx-load-balancing/일부 요약 Haproxy 는 L4, L7 과 같은 하드웨어 로드밸런서를 대체하기 위한 오픈소스 소프트에어 Reverse Proxy를 기반으로 로드밸런싱을 하기에 매우 강력하고 가벼움 HA (High Availability) 라는 이름처럼 고가용성을 위하여 설계됨 Nginx 로드밸런싱과 다른 점은 헬스체크라고 볼 수 있는데, 특정 API 에 접근하여 서버 상태를 점검하고, 문제가 있으면 다른 node 로 트래픽을 넘겨줄 수 있는 기능을 함 Nginx 자체의 로드밸런싱도 훌륭하지만, 굳이 웹 서버로서의 역할이 필요가 없다면 HAProxy 로드 밸런싱이 헬스체크가 가능하기도 하고 좀 더 가벼우니 필요에 따라 선택하면 좋을 것이다. Stats 페이지 기본 제공, 어떤 서버에 접속되고 작동하고 있는지 확인하기 편리 간단하게 Nginx 와 HAProxy 의 로드밸런싱에 대해서 알아보았다.
  • 19. 19 RabbitMQ High Availability HAProxy – 테스트 확인 Case1 – Mirrored Queue 선언 전 Consumer: connection consume from 5674 5674 down (Queue 선언 노드) 결과: Connection failed Case2 – Mirrored Queue 선언 전 Consumer: connection consume from 5670 Node which connected with consumer down 결과: Re-connected automatically Producer Consumer localhost:5670 Cluster HAProxy Producer Consumer Cluster localhost:567x localhost:567x
  • 20. 20 RabbitMQ High Availability HAProxy – haproxy.cfg … (중략) listen rabbitmq_local_cluster bind *:5670 mode tcp balance roundrobin server rabbit1 127.0.0.1:5672 check inter 5000 rise 2 fall 3 server rabbit2 127.0.0.1:5673 check inter 5000 rise 2 fall 3 server rabbit3 127.0.0.1:5674 check inter 5000 rise 2 fall 3 listen private_monitoring bind *:8100 mode http option httplog stats enable stats uri /stats stats refresh 5s
  • 21. 21 RabbitMQ High Availability HAProxy – localhost:8100/stats
  • 22. 22 Spring Cloud Stream& Sleuth Message-driven microservices with Rabbit Mission 2 // Message queue를 통해 서비스간 커뮤니케이션 하는 경우에도 Sleuth가 trace Id, span Id를 전달하는지 확인할 것 관련 Spring Cloud Framework Spring cloud Stream Spring cloud stream-binder rabbit Spring Sleuth
  • 23. 23 Message-driven microserviceswith Rabbit Spring Cloud Stream with binder-rabbit
  • 24. 24 Message-driven microserviceswith Rabbit Sample Boot Apps with Stream & Rabbit order-service payment-service product-service shipment-service PUB PUB/SUB SUB PUB/SUB
  • 25. 25 Message-driven microserviceswith Rabbit Spring Cloud Stream 설정과 주의사항 - RabbitMQ의 exchage type를 지정하기 위해서는 stream 1.2 이상, boot 1.5.6 이상 사용해야 함 - destination - group - routingKeyExpression