Zookeeper 소개
javawork93@gmail.com
임영기
제공하는 기능
• znode 생성 / 삭제
• 데이터(znode)를 트리 구조로 저장
• 데이터가 변경되면 구독자들에게 통보
• Ephemeral node
• Sequence node
API
• zoo_init
• zoo_create
• zoo_delete
• zoo_exist
• zoo_get_children
• zoo_close
• sync / async version
Global Configuration
Cluster 구성
• 서버가 구동되면서 자신을 등록
• Ephemeral node
• 서버가 죽으면 자동으로 노드가 삭제됨
Cluster 구성 #1
Zookeeper
Server
zoo_create( ephemeral | sequence )
Cluster 구성 #2
Zookeeper
Server
server0001
Cluster 구성 #3
Zookeeper
server
server0001
server
Server
server0002
server0003
Cluster 구성 #4
Zookeeper
server
server0001
server
Server
server0002
server0003
zoo_get_children
Client
Cluster 구성 #5
Zookeeper
server
server0001
server
server
server0002
server0003
connect Client
Cluster 구성 #6
Zookeeper
server
server0001
server
server0003
server0002
server0003
Crash!
!
Client
Cluster 구성 #7
Zookeeper
server
server0001
server0002
server0002
Client
분산 Lock #1
Zookeeper
server zoo_create( sequence )
server
Client
분산 Lock #2
Client0001
(working)
Client0002
(wait)
Zookeeper
Client0001
Client0002
Client0003
Client0003
(wait)
분산 Lock #3
Client0001
(working)
Client0002
(waiting)
Zookeeper
Client0001
Client0002
Client0003
Client0003
(waiting)
zoo_d...
분산 Lock #4
Client0002
(waiting)
Zookeeper
Client0002
Client0003
Client0003
(waiting)
Notify
분산 Lock #5
Client0002
(working)
Zookeeper
Client0002
Client0003
Client0003
(wait)
Job Distribution #1
Zookeeper
Producer
zoo_create(sequence)
Job Distribution #2
Zookeeper
Producer Consumer
Job0001
Consumer
Notify
Job Distribution #3
Zookeeper
Producer Consumer
Job0001
Consumer
zoo_delete
Job Distribution #4
Zookeeper
Producer ConsumerConsumer
Success
Fail
Job0001
Job Distribution #5
Zookeeper
Producer Consumer
Consumer
(working)
Job0001
그 밖에
• Barriers
• Queues
• Two-phased Commit
• Leader Election
단점
• Write가 많은 경우 성능 저하
• znode 용량 제한(1MB)
• C Client driver(Windows)
Reference
• http://zookeeper.apache.org/
• http://creatorw.tistory.com/category/분산처
리/주키퍼/
• http://helloworld.naver.com/h...
Upcoming SlideShare
Loading in...5
×

Zookeeper소개

3,431

Published on

0 Comments
11 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,431
On Slideshare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
31
Comments
0
Likes
11
Embeds 0
No embeds

No notes for slide

Zookeeper소개

  1. 1. Zookeeper 소개 javawork93@gmail.com 임영기
  2. 2. 제공하는 기능 • znode 생성 / 삭제 • 데이터(znode)를 트리 구조로 저장 • 데이터가 변경되면 구독자들에게 통보 • Ephemeral node • Sequence node
  3. 3. API • zoo_init • zoo_create • zoo_delete • zoo_exist • zoo_get_children • zoo_close • sync / async version
  4. 4. Global Configuration
  5. 5. Cluster 구성 • 서버가 구동되면서 자신을 등록 • Ephemeral node • 서버가 죽으면 자동으로 노드가 삭제됨
  6. 6. Cluster 구성 #1 Zookeeper Server zoo_create( ephemeral | sequence )
  7. 7. Cluster 구성 #2 Zookeeper Server server0001
  8. 8. Cluster 구성 #3 Zookeeper server server0001 server Server server0002 server0003
  9. 9. Cluster 구성 #4 Zookeeper server server0001 server Server server0002 server0003 zoo_get_children Client
  10. 10. Cluster 구성 #5 Zookeeper server server0001 server server server0002 server0003 connect Client
  11. 11. Cluster 구성 #6 Zookeeper server server0001 server server0003 server0002 server0003 Crash! ! Client
  12. 12. Cluster 구성 #7 Zookeeper server server0001 server0002 server0002 Client
  13. 13. 분산 Lock #1 Zookeeper server zoo_create( sequence ) server Client
  14. 14. 분산 Lock #2 Client0001 (working) Client0002 (wait) Zookeeper Client0001 Client0002 Client0003 Client0003 (wait)
  15. 15. 분산 Lock #3 Client0001 (working) Client0002 (waiting) Zookeeper Client0001 Client0002 Client0003 Client0003 (waiting) zoo_delete
  16. 16. 분산 Lock #4 Client0002 (waiting) Zookeeper Client0002 Client0003 Client0003 (waiting) Notify
  17. 17. 분산 Lock #5 Client0002 (working) Zookeeper Client0002 Client0003 Client0003 (wait)
  18. 18. Job Distribution #1 Zookeeper Producer zoo_create(sequence)
  19. 19. Job Distribution #2 Zookeeper Producer Consumer Job0001 Consumer Notify
  20. 20. Job Distribution #3 Zookeeper Producer Consumer Job0001 Consumer zoo_delete
  21. 21. Job Distribution #4 Zookeeper Producer ConsumerConsumer Success Fail Job0001
  22. 22. Job Distribution #5 Zookeeper Producer Consumer Consumer (working) Job0001
  23. 23. 그 밖에 • Barriers • Queues • Two-phased Commit • Leader Election
  24. 24. 단점 • Write가 많은 경우 성능 저하 • znode 용량 제한(1MB) • C Client driver(Windows)
  25. 25. Reference • http://zookeeper.apache.org/ • http://creatorw.tistory.com/category/분산처 리/주키퍼/ • http://helloworld.naver.com/helloworld/text yle/294797
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×