Upgrade to Pro — share decks privately, control downloads, hide ads and more …

etcd @ GoSF

etcd @ GoSF

Talk given at GoSF on Jan 15th 2014.

etcd is here: https://github.com/coreos/etcd

Raft visualization is here: http://thesecretlivesofdata.com/raft/

Raft home here: http://raftconsensus.github.io/

Talk given at this event: http://www.meetup.com/golangsf/events/146084182/

2786cdedd6e0eaa34b64b17e1cea81b9?s=128

Brandon Philips

January 15, 2014
Tweet

Transcript

  1. etcd @BrandonPhilips github.com/philips

  2. A highly-available key value store for shared configuration and service

    discovery.
  3. Apache 2.0 licensed

  4. Written in Go

  5. Highly Available

  6. Available

  7. Available

  8. Available

  9. Unavailable

  10. Key Value Store

  11. • /services • /db0 • /db1 • /messages • /hello

  12. GET /messages/hello “Hello World”

  13. Shared Configuration

  14. { "password": "cleartext", "user": "root" }

  15. Discovery

  16. Discovery & Locking

  17. App etcd DB?

  18. App etcd No DB

  19. App etcd I will watch and wait

  20. App etcd DB Master? watch

  21. App etcd No DB Master You are it now. DB

    master appeared
  22. App etcd Heartbeat SELECT * from Awesome watch

  23. App etcd DB master? Heartbeat watch

  24. App etcd master exists Heartbeat watch

  25. App etcd Heartbeat watch Heartbeat

  26. App etcd watch Heartbeat

  27. App etcd You are master new master DB SELECT *

    from Awesome
  28. App etcd DB master? Heartbeat

  29. App etcd master exists

  30. • Database master election • Elastic IP configurations • Creating

    NNN number of workers
  31. Raft

  32. consensus across machines x = blue x = cow x

    = 1
  33. Cmd + Tab Raft Visualization

  34. etcd cluster

  35. etcd API introduction

  36. go-etcd

  37. github.com/coreos/go-etcd/etcd • NewClient() / SyncCluster() • Consistency • Set/Get/Delete/Create

  38. goraft

  39. raft.Server

  40. raft.Server • server.Do()

  41. raft.CommandApply

  42. raft.Command • Apply()

  43. So why use etcd?

  44. • Cluster configuration • API • Dashboard • Profiling •

    Logging • etc
  45. Shameless CoreOS, Inc Plug

  46. None
  47. 3 full-time developers

  48. We need help.

  49. brandon.philips@coreos.com