coreoslinux about me brandonphilips cto co founder github
play

@coreoslinux About Me @brandonphilips CTO/CO-FOUNDER - PowerPoint PPT Presentation

@coreoslinux About Me @brandonphilips CTO/CO-FOUNDER github.com/philips systems engineer etcd /etc distributed open source software failure tolerant durable watchable exposed via HTTP runtime reconfigurable Data Store API -X GET Get


  1. @coreoslinux

  2. About Me @brandonphilips CTO/CO-FOUNDER github.com/philips systems engineer

  3. etcd

  4. /etc distributed

  5. open source software failure tolerant durable watchable exposed via HTTP runtime reconfigurable

  6. Data Store API -X GET Get Wait -X PUT Put Create CAS -X DELETE Delete CAD

  7. etcd Cluster Leader Follower

  8. Applications locksmith

  9. Cluster Wide Reboot Lock 1. Need reboot to reboot? Decrement the semaphore key atomically with etcd. 2. manager.Reboot() and wait... 3. After rebooting increment the semaphore key in etcd atomically.

  10. Applications kubernetes and fleet

  11. You Scheduler API Scheduler Machine(s)

  12. Cluster Work Scheduling 1. Cluster API writes desired work into etcd keyspace. 2. Agents running on individual machines pick up work assigned to them. 3. Agents report where work is running and current status.

  13. Applications vulcan, confd, dns and distributed git

  14. Example Leader Election using TTL and atomic operations

  15. PUT /6eadeac2d/f1d2d2f924e98 ‘http://10.1.2.3:7001’

  16. PUT /6eadeac2d/f1d2d2f924e98 ‘http://10.1.2.3:7001’ Entry 1 /6eadeac2d/f1d2df http://10.1.2.3:7001

  17. PUT /6eadeac2d/f1d2d2f924e98 ‘http://10.1.2.3:7001’ 1 Index /6eadeac2d/f1d2df http://10.1.2.3:7001

  18. PUT /6eadeac2d/f1d2d2f924e98 ‘http://10.1.2.3:7001’ 1 /6eadeac2d/f1d2df Key http://10.1.2.3:7001

  19. PUT /6eadeac2d/f1d2d2f924e98 ‘http://10.1.2.3:7001’ 1 /6eadeac2d/f1d2df Value http://10.1.2.3:7001

  20. Idx Key Value Expiration Time 18 sched m3 Sept 18 2:11:30

  21. Idx Key Value Expiration Time 18 sched m3 Sept 18 2:11:30 schedlr m3

  22. Idx Key Value Expiration Time 18 sched m3 Sept 18 2:11:30 ) 3 m , 8 1 , d e h c s ( s a c schedlr c m3 a s ( s c h e d , 1 8 , m 3 )

  23. Idx Key Value Expiration Time 30 sched m3 Sept 18 2:12:50 ) 3 m , 0 3 , d e h c s ( s a c schedlr c m3 a s ( s c h e d , 3 0 , m 3 )

  24. Idx Key Value Expiration Time 45 sched m3 Sept 18 2:13:30 ) 3 m , 5 4 , d e h c s ( s a c schedlr c m3 a s ( s c h e d , 4 5 , m 3 )

  25. Idx Key Value Expiration Time 45 sched m3 Sept 18 2:13:30 ) 0 0 : 3 1 : 2 ( c n y s s y n c ( 2 : 1 3 : 0 0 )

  26. Idx Key Value Expiration Time 45 sched m3 Sept 18 2:13:30 ) 5 1 : 3 1 : 2 ( c n y s s y n c ( 2 : 1 3 : 1 5 )

  27. Idx Key Value Expiration Time 45 sched m3 Sept 18 2:13:30 ) 0 3 : 3 1 : 2 ( c n y s s y n c ( 2 : 1 3 : 3 0 )

  28. Idx Key Value Expiration Time ) 0 3 : 3 1 : 2 ( c n y s s y n c ( 2 : 1 3 : 3 0 )

  29. Idx Key Value Expiration Time 50 sched m5 Sept 18 2:13:35 ) 5 m , d e h c s ( e t a e r c schedlr c m5 r e a t e ( s c h e d , m 5 )

  30. etcd basics clusters and bootstrapping

  31. etcd Cluster Leader Follower

  32. bootstrapping Candidate

  33. GET discovery.etcd.io/new

  34. discovery.etcd.io/6eadeac2 6eadeac2d

  35. 6eadeac2d/state CREATE

  36. Key Value Index state started 5890 n0 10.0.2.1 5891 n1 10.0.2.4 5898 ... 6eadeac2d/state

  37. bootstrapped Leader Follower

  38. 6eadeac2d/state CREATE

  39. 1 2 3 4 { Log

  40. 1 2 3 4 Entries

  41. 1 2 3 4 Indexes

  42. Sequential Consistency Operations* are atomically executed in the same sequential order on all machines.

  43. PUT Pet = cat 1 PUT Pet = dog 2 Pet=dog 1 2 1 Pet=cat 1 Pet=cat

  44. PUT Pet = cat 1 PUT Pet = dog 2 Pet=dog 1 2 1 2 Pet=dog 1 Pet=cat

  45. PUT Pet = cat 1 PUT Pet = dog 2 Pet=dog 1 2 1 2 Pet=dog 1 2 Pet=dog

  46. Sequential Consistency Real-time

  47. GET Pet @ 10:00.0 -> 2[dog] 1 2 GET Pet @ 10:00.0 -> 1[cat]!? 1 1 2

  48. 1 2 GET Pet @ 10:00.1 -> 1[dog] 2 1 1 2

  49. Sequential Consistency Index Time

  50. GET Pet @ 2 -> 2[dog] 1 2 GET Pet @ 2 -> blocking 1 1 2

  51. 1 2 GET Pet @ 2 -> 2[dog] 1 2 1 2

  52. etcd guarantees that a get at index X will always return the same result. Avoid thinking in terms of real time because with network latency the result is always out-of-date.

  53. Quorum GETs GET via Raft

  54. 1 2 1 1 2

  55. 1 2 QGET A 1 1 2

  56. 1 2 QGET A -> 2[dog] 1 2 1 2

  57. 1 2 3 QGET A -> 2[dog] 1 2 1 2 3

  58. Watchable Changes HTTP Long-poll

  59. 1 2 3 > GET asdf?waitIndex=4&wait=true HTTP/1.1 > Accept: */* > < HTTP/1.1 200 OK < Content-Type: application/json < X-Etcd-Index: 3 < X-Raft-Index: 97 < X-Raft-Term: 0 < BLOCK

  60. 1 2 3 4 > GET asdf?waitIndex=4&wait=true HTTP/1.1 > Accept: */* > < HTTP/1.1 200 OK < Content-Type: application/json < X-Etcd-Index: 3 < X-Raft-Index: 97 < X-Raft-Term: 0 < {"action":"set","node":{"key":"/asdf","value":"foobar"," modifiedIndex":4,"createdIndex":4}}

  61. 1 2 3 4 > GET asdf?waitIndex=4&wait=true HTTP/1.1 > Accept: */* > < HTTP/1.1 200 OK < Content-Type: application/json < X-Etcd-Index: 4 < X-Raft-Index: 516 < X-Raft-Term: 0 < {"action":"set","node":{"key":"/asdf","value":"foobar"," modifiedIndex":4,"createdIndex":4}}

  62. Event History History isn’t forever, prepare!

  63. Availability In a 2F+1 cluster tolerate F machine failures

  64. Available

  65. Available

  66. Available

  67. Unavailable

  68. Master Election Fast recovery (5-10*typical RTT) from temporarily unavailable

  69. Available Leader Follower

  70. Available Leader Follower

  71. Temporarily Unavailable Leader Follower

  72. Available Leader Follower

  73. Durable log files, snapshots and backups

  74. Mistakes so far...

  75. Log files Filesystems truncate and corrupt data. Solutions: ● Must use checksumming in the file to ensure sanity ● Throwing out broken log files must be handled by the server

  76. etcd machine naming Trusted users to manage unique names across the cluster. This went poorly. ● Misconfiguration from bugs ● Misconfiguration by users ● Machine cloning on the cloud Solution: etcd data-dir owns a unique uuid.

  77. sync() in the cloud Slow, slow, slow: ● User #1 OpenStack on spinning disk: 6s ● User #2 AWS EBS backed: 1.5s Solution: ● Tune etcd to expect this long latency. ● Write batching and handling of behind machines.

  78. Wednesday 10:40am LCA CoreOS: An Introduction Wednesday 6:00pm AKL Continuous Delivery Meetup. CoreOS: An Introduction Thursday 6:00 PM Go AKL Meetup Something about Go Friday 10:40am LCA CoreOS Tutorial

  79. Thanks we like pull requests github.com/coreos/etcd

Recommend


More recommend