zookeeperOver.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta content="Apache Forrest" name="Generator">
  6. <meta name="Forrest-version" content="0.9">
  7. <meta name="Forrest-skin-name" content="pelt">
  8. <title>ZooKeeper</title>
  9. <link type="text/css" href="skin/basic.css" rel="stylesheet">
  10. <link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
  11. <link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
  12. <link type="text/css" href="skin/profile.css" rel="stylesheet">
  13. <script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
  14. <link rel="shortcut icon" href="images/favicon.ico">
  15. </head>
  16. <body onload="init()">
  17. <script type="text/javascript">ndeSetTextSize();</script>
  18. <div id="top">
  19. <!--+
  20. |breadtrail
  21. +-->
  22. <div class="breadtrail">
  23. <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
  24. </div>
  25. <!--+
  26. |header
  27. +-->
  28. <div class="header">
  29. <!--+
  30. |start group logo
  31. +-->
  32. <div class="grouplogo">
  33. <a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
  34. </div>
  35. <!--+
  36. |end group logo
  37. +-->
  38. <!--+
  39. |start Project Logo
  40. +-->
  41. <div class="projectlogo">
  42. <a href="http://zookeeper.apache.org/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="ZooKeeper: distributed coordination"></a>
  43. </div>
  44. <!--+
  45. |end Project Logo
  46. +-->
  47. <!--+
  48. |start Search
  49. +-->
  50. <div class="searchbox">
  51. <form action="http://www.google.com/search" method="get" class="roundtopsmall">
  52. <input value="zookeeper.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp;
  53. <input name="Search" value="Search" type="submit">
  54. </form>
  55. </div>
  56. <!--+
  57. |end search
  58. +-->
  59. <!--+
  60. |start Tabs
  61. +-->
  62. <ul id="tabs">
  63. <li>
  64. <a class="unselected" href="http://zookeeper.apache.org/">Project</a>
  65. </li>
  66. <li>
  67. <a class="unselected" href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/">Wiki</a>
  68. </li>
  69. <li class="current">
  70. <a class="selected" href="index.html">ZooKeeper 3.4 Documentation</a>
  71. </li>
  72. </ul>
  73. <!--+
  74. |end Tabs
  75. +-->
  76. </div>
  77. </div>
  78. <div id="main">
  79. <div id="publishedStrip">
  80. <!--+
  81. |start Subtabs
  82. +-->
  83. <div id="level2tabs"></div>
  84. <!--+
  85. |end Endtabs
  86. +-->
  87. <script type="text/javascript"><!--
  88. document.write("Last Published: " + document.lastModified);
  89. // --></script>
  90. </div>
  91. <!--+
  92. |breadtrail
  93. +-->
  94. <div class="breadtrail">
  95. &nbsp;
  96. </div>
  97. <!--+
  98. |start Menu, mainarea
  99. +-->
  100. <!--+
  101. |start Menu
  102. +-->
  103. <div id="menu">
  104. <div onclick="SwitchMenu('menu_selected_1.1', 'skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Overview</div>
  105. <div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
  106. <div class="menuitem">
  107. <a href="index.html">Welcome</a>
  108. </div>
  109. <div class="menupage">
  110. <div class="menupagetitle">Overview</div>
  111. </div>
  112. <div class="menuitem">
  113. <a href="zookeeperStarted.html">Getting Started</a>
  114. </div>
  115. <div class="menuitem">
  116. <a href="releasenotes.html">Release Notes</a>
  117. </div>
  118. </div>
  119. <div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Developer</div>
  120. <div id="menu_1.2" class="menuitemgroup">
  121. <div class="menuitem">
  122. <a href="api/index.html">API Docs</a>
  123. </div>
  124. <div class="menuitem">
  125. <a href="zookeeperProgrammers.html">Programmer's Guide</a>
  126. </div>
  127. <div class="menuitem">
  128. <a href="javaExample.html">Java Example</a>
  129. </div>
  130. <div class="menuitem">
  131. <a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
  132. </div>
  133. <div class="menuitem">
  134. <a href="recipes.html">Recipes</a>
  135. </div>
  136. </div>
  137. <div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Admin &amp; Ops</div>
  138. <div id="menu_1.3" class="menuitemgroup">
  139. <div class="menuitem">
  140. <a href="zookeeperAdmin.html">Administrator's Guide</a>
  141. </div>
  142. <div class="menuitem">
  143. <a href="zookeeperQuotas.html">Quota Guide</a>
  144. </div>
  145. <div class="menuitem">
  146. <a href="zookeeperJMX.html">JMX</a>
  147. </div>
  148. <div class="menuitem">
  149. <a href="zookeeperObservers.html">Observers Guide</a>
  150. </div>
  151. <div class="menuitem">
  152. <a href="zookeeperReconfig.html">Dynamic Reconfiguration</a>
  153. </div>
  154. </div>
  155. <div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
  156. <div id="menu_1.4" class="menuitemgroup">
  157. <div class="menuitem">
  158. <a href="zookeeperInternals.html">ZooKeeper Internals</a>
  159. </div>
  160. </div>
  161. <div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Miscellaneous</div>
  162. <div id="menu_1.5" class="menuitemgroup">
  163. <div class="menuitem">
  164. <a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
  165. </div>
  166. <div class="menuitem">
  167. <a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
  168. </div>
  169. <div class="menuitem">
  170. <a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>
  171. </div>
  172. </div>
  173. <div id="credit"></div>
  174. <div id="roundbottom">
  175. <img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
  176. <!--+
  177. |alternative credits
  178. +-->
  179. <div id="credit2"></div>
  180. </div>
  181. <!--+
  182. |end Menu
  183. +-->
  184. <!--+
  185. |start content
  186. +-->
  187. <div id="content">
  188. <div title="Portable Document Format" class="pdflink">
  189. <a class="dida" href="zookeeperOver.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
  190. PDF</a>
  191. </div>
  192. <h1>ZooKeeper</h1>
  193. <div id="front-matter">
  194. <div id="minitoc-area">
  195. <ul class="minitoc">
  196. <li>
  197. <a href="#ch_DesignOverview">ZooKeeper: A Distributed Coordination Service for Distributed
  198. Applications</a>
  199. <ul class="minitoc">
  200. <li>
  201. <a href="#sc_designGoals">Design Goals</a>
  202. </li>
  203. <li>
  204. <a href="#sc_dataModelNameSpace">Data model and the hierarchical namespace</a>
  205. </li>
  206. <li>
  207. <a href="#Nodes+and+ephemeral+nodes">Nodes and ephemeral nodes</a>
  208. </li>
  209. <li>
  210. <a href="#Conditional+updates+and+watches">Conditional updates and watches</a>
  211. </li>
  212. <li>
  213. <a href="#Guarantees">Guarantees</a>
  214. </li>
  215. <li>
  216. <a href="#Simple+API">Simple API</a>
  217. </li>
  218. <li>
  219. <a href="#Implementation">Implementation</a>
  220. </li>
  221. <li>
  222. <a href="#Uses">Uses</a>
  223. </li>
  224. <li>
  225. <a href="#Performance">Performance</a>
  226. </li>
  227. <li>
  228. <a href="#Reliability">Reliability</a>
  229. </li>
  230. <li>
  231. <a href="#The+ZooKeeper+Project">The ZooKeeper Project</a>
  232. </li>
  233. </ul>
  234. </li>
  235. </ul>
  236. </div>
  237. </div>
  238. <a name="ch_DesignOverview"></a>
  239. <h2 class="h3">ZooKeeper: A Distributed Coordination Service for Distributed
  240. Applications</h2>
  241. <div class="section">
  242. <p>ZooKeeper is a distributed, open-source coordination service for
  243. distributed applications. It exposes a simple set of primitives that
  244. distributed applications can build upon to implement higher level services
  245. for synchronization, configuration maintenance, and groups and naming. It
  246. is designed to be easy to program to, and uses a data model styled after
  247. the familiar directory tree structure of file systems. It runs in Java and
  248. has bindings for both Java and C.</p>
  249. <p>Coordination services are notoriously hard to get right. They are
  250. especially prone to errors such as race conditions and deadlock. The
  251. motivation behind ZooKeeper is to relieve distributed applications the
  252. responsibility of implementing coordination services from scratch.</p>
  253. <a name="sc_designGoals"></a>
  254. <h3 class="h4">Design Goals</h3>
  255. <p>
  256. <strong>ZooKeeper is simple.</strong> ZooKeeper
  257. allows distributed processes to coordinate with each other through a
  258. shared hierarchal namespace which is organized similarly to a standard
  259. file system. The name space consists of data registers - called znodes,
  260. in ZooKeeper parlance - and these are similar to files and directories.
  261. Unlike a typical file system, which is designed for storage, ZooKeeper
  262. data is kept in-memory, which means ZooKeeper can achieve high
  263. throughput and low latency numbers.</p>
  264. <p>The ZooKeeper implementation puts a premium on high performance,
  265. highly available, strictly ordered access. The performance aspects of
  266. ZooKeeper means it can be used in large, distributed systems. The
  267. reliability aspects keep it from being a single point of failure. The
  268. strict ordering means that sophisticated synchronization primitives can
  269. be implemented at the client.</p>
  270. <p>
  271. <strong>ZooKeeper is replicated.</strong> Like the
  272. distributed processes it coordinates, ZooKeeper itself is intended to be
  273. replicated over a sets of hosts called an ensemble.</p>
  274. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  275. <tr>
  276. <td>ZooKeeper Service</td>
  277. </tr>
  278. <tr>
  279. <td>
  280. <img alt="" src="images/zkservice.jpg">
  281. </td>
  282. </tr>
  283. </table>
  284. <p>The servers that make up the ZooKeeper service must all know about
  285. each other. They maintain an in-memory image of state, along with a
  286. transaction logs and snapshots in a persistent store. As long as a
  287. majority of the servers are available, the ZooKeeper service will be
  288. available.</p>
  289. <p>Clients connect to a single ZooKeeper server. The client maintains
  290. a TCP connection through which it sends requests, gets responses, gets
  291. watch events, and sends heart beats. If the TCP connection to the server
  292. breaks, the client will connect to a different server.</p>
  293. <p>
  294. <strong>ZooKeeper is ordered.</strong> ZooKeeper
  295. stamps each update with a number that reflects the order of all
  296. ZooKeeper transactions. Subsequent operations can use the order to
  297. implement higher-level abstractions, such as synchronization
  298. primitives.</p>
  299. <p>
  300. <strong>ZooKeeper is fast.</strong> It is
  301. especially fast in "read-dominant" workloads. ZooKeeper applications run
  302. on thousands of machines, and it performs best where reads are more
  303. common than writes, at ratios of around 10:1.</p>
  304. <a name="sc_dataModelNameSpace"></a>
  305. <h3 class="h4">Data model and the hierarchical namespace</h3>
  306. <p>The name space provided by ZooKeeper is much like that of a
  307. standard file system. A name is a sequence of path elements separated by
  308. a slash (/). Every node in ZooKeeper's name space is identified by a
  309. path.</p>
  310. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  311. <tr>
  312. <td>ZooKeeper's Hierarchical Namespace</td>
  313. </tr>
  314. <tr>
  315. <td>
  316. <img alt="" src="images/zknamespace.jpg">
  317. </td>
  318. </tr>
  319. </table>
  320. <a name="Nodes+and+ephemeral+nodes"></a>
  321. <h3 class="h4">Nodes and ephemeral nodes</h3>
  322. <p>Unlike standard file systems, each node in a ZooKeeper
  323. namespace can have data associated with it as well as children. It is
  324. like having a file-system that allows a file to also be a directory.
  325. (ZooKeeper was designed to store coordination data: status information,
  326. configuration, location information, etc., so the data stored at each
  327. node is usually small, in the byte to kilobyte range.) We use the term
  328. <em>znode</em> to make it clear that we are talking about
  329. ZooKeeper data nodes.</p>
  330. <p>Znodes maintain a stat structure that includes version numbers for
  331. data changes, ACL changes, and timestamps, to allow cache validations
  332. and coordinated updates. Each time a znode's data changes, the version
  333. number increases. For instance, whenever a client retrieves data it also
  334. receives the version of the data.</p>
  335. <p>The data stored at each znode in a namespace is read and written
  336. atomically. Reads get all the data bytes associated with a znode and a
  337. write replaces all the data. Each node has an Access Control List (ACL)
  338. that restricts who can do what.</p>
  339. <p>ZooKeeper also has the notion of ephemeral nodes. These znodes
  340. exists as long as the session that created the znode is active. When the
  341. session ends the znode is deleted. Ephemeral nodes are useful when you
  342. want to implement <em>[tbd]</em>.</p>
  343. <a name="Conditional+updates+and+watches"></a>
  344. <h3 class="h4">Conditional updates and watches</h3>
  345. <p>ZooKeeper supports the concept of <em>watches</em>.
  346. Clients can set a watch on a znode. A watch will be triggered and
  347. removed when the znode changes. When a watch is triggered, the client
  348. receives a packet saying that the znode has changed. If the
  349. connection between the client and one of the Zoo Keeper servers is
  350. broken, the client will receive a local notification. These can be used
  351. to <em>[tbd]</em>.</p>
  352. <a name="Guarantees"></a>
  353. <h3 class="h4">Guarantees</h3>
  354. <p>ZooKeeper is very fast and very simple. Since its goal, though, is
  355. to be a basis for the construction of more complicated services, such as
  356. synchronization, it provides a set of guarantees. These are:</p>
  357. <ul>
  358. <li>
  359. <p>Sequential Consistency - Updates from a client will be applied
  360. in the order that they were sent.</p>
  361. </li>
  362. <li>
  363. <p>Atomicity - Updates either succeed or fail. No partial
  364. results.</p>
  365. </li>
  366. <li>
  367. <p>Single System Image - A client will see the same view of the
  368. service regardless of the server that it connects to.</p>
  369. </li>
  370. </ul>
  371. <ul>
  372. <li>
  373. <p>Reliability - Once an update has been applied, it will persist
  374. from that time forward until a client overwrites the update.</p>
  375. </li>
  376. </ul>
  377. <ul>
  378. <li>
  379. <p>Timeliness - The clients view of the system is guaranteed to
  380. be up-to-date within a certain time bound.</p>
  381. </li>
  382. </ul>
  383. <p>For more information on these, and how they can be used, see
  384. <em>[tbd]</em>
  385. </p>
  386. <a name="Simple+API"></a>
  387. <h3 class="h4">Simple API</h3>
  388. <p>One of the design goals of ZooKeeper is provide a very simple
  389. programming interface. As a result, it supports only these
  390. operations:</p>
  391. <dl>
  392. <dt>
  393. <term>create</term>
  394. </dt>
  395. <dd>
  396. <p>creates a node at a location in the tree</p>
  397. </dd>
  398. <dt>
  399. <term>delete</term>
  400. </dt>
  401. <dd>
  402. <p>deletes a node</p>
  403. </dd>
  404. <dt>
  405. <term>exists</term>
  406. </dt>
  407. <dd>
  408. <p>tests if a node exists at a location</p>
  409. </dd>
  410. <dt>
  411. <term>get data</term>
  412. </dt>
  413. <dd>
  414. <p>reads the data from a node</p>
  415. </dd>
  416. <dt>
  417. <term>set data</term>
  418. </dt>
  419. <dd>
  420. <p>writes data to a node</p>
  421. </dd>
  422. <dt>
  423. <term>get children</term>
  424. </dt>
  425. <dd>
  426. <p>retrieves a list of children of a node</p>
  427. </dd>
  428. <dt>
  429. <term>sync</term>
  430. </dt>
  431. <dd>
  432. <p>waits for data to be propagated</p>
  433. </dd>
  434. </dl>
  435. <p>For a more in-depth discussion on these, and how they can be used
  436. to implement higher level operations, please refer to
  437. <em>[tbd]</em>
  438. </p>
  439. <a name="Implementation"></a>
  440. <h3 class="h4">Implementation</h3>
  441. <p>
  442. <a href="#fg_zkComponents">ZooKeeper Components</a> shows the high-level components
  443. of the ZooKeeper service. With the exception of the request processor,
  444. each of
  445. the servers that make up the ZooKeeper service replicates its own copy
  446. of each of the components.</p>
  447. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  448. <tr>
  449. <td>ZooKeeper Components</td>
  450. </tr>
  451. <tr>
  452. <td>
  453. <img alt="" src="images/zkcomponents.jpg">
  454. </td>
  455. </tr>
  456. </table>
  457. <p>The replicated database is an in-memory database containing the
  458. entire data tree. Updates are logged to disk for recoverability, and
  459. writes are serialized to disk before they are applied to the in-memory
  460. database.</p>
  461. <p>Every ZooKeeper server services clients. Clients connect to
  462. exactly one server to submit irequests. Read requests are serviced from
  463. the local replica of each server database. Requests that change the
  464. state of the service, write requests, are processed by an agreement
  465. protocol.</p>
  466. <p>As part of the agreement protocol all write requests from clients
  467. are forwarded to a single server, called the
  468. <em>leader</em>. The rest of the ZooKeeper servers, called
  469. <em>followers</em>, receive message proposals from the
  470. leader and agree upon message delivery. The messaging layer takes care
  471. of replacing leaders on failures and syncing followers with
  472. leaders.</p>
  473. <p>ZooKeeper uses a custom atomic messaging protocol. Since the
  474. messaging layer is atomic, ZooKeeper can guarantee that the local
  475. replicas never diverge. When the leader receives a write request, it
  476. calculates what the state of the system is when the write is to be
  477. applied and transforms this into a transaction that captures this new
  478. state.</p>
  479. <a name="Uses"></a>
  480. <h3 class="h4">Uses</h3>
  481. <p>The programming interface to ZooKeeper is deliberately simple.
  482. With it, however, you can implement higher order operations, such as
  483. synchronizations primitives, group membership, ownership, etc. Some
  484. distributed applications have used it to: <em>[tbd: add uses from
  485. white paper and video presentation.]</em> For more information, see
  486. <em>[tbd]</em>
  487. </p>
  488. <a name="Performance"></a>
  489. <h3 class="h4">Performance</h3>
  490. <p>ZooKeeper is designed to be highly performant. But is it? The
  491. results of the ZooKeeper's development team at Yahoo! Research indicate
  492. that it is. (See <a href="#fg_zkPerfRW">ZooKeeper Throughput as the Read-Write Ratio Varies</a>.) It is especially high
  493. performance in applications where reads outnumber writes, since writes
  494. involve synchronizing the state of all servers. (Reads outnumbering
  495. writes is typically the case for a coordination service.)</p>
  496. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  497. <tr>
  498. <td>ZooKeeper Throughput as the Read-Write Ratio Varies</td>
  499. </tr>
  500. <tr>
  501. <td>
  502. <img alt="" src="images/zkperfRW-3.2.jpg">
  503. </td>
  504. </tr>
  505. </table>
  506. <p>The figure <a href="#fg_zkPerfRW">ZooKeeper Throughput as the Read-Write Ratio Varies</a> is a throughput
  507. graph of ZooKeeper release 3.2 running on servers with dual 2Ghz
  508. Xeon and two SATA 15K RPM drives. One drive was used as a
  509. dedicated ZooKeeper log device. The snapshots were written to
  510. the OS drive. Write requests were 1K writes and the reads were
  511. 1K reads. "Servers" indicate the size of the ZooKeeper
  512. ensemble, the number of servers that make up the
  513. service. Approximately 30 other servers were used to simulate
  514. the clients. The ZooKeeper ensemble was configured such that
  515. leaders do not allow connections from clients.</p>
  516. <div class="note">
  517. <div class="label">Note</div>
  518. <div class="content">
  519. <p>In version 3.2 r/w performance improved by ~2x
  520. compared to the <a href="http://zookeeper.apache.org/docs/r3.1.1/zookeeperOver.html#Performance">previous
  521. 3.1 release</a>.</p>
  522. </div>
  523. </div>
  524. <p>Benchmarks also indicate that it is reliable, too. <a href="#fg_zkPerfReliability">Reliability in the Presence of Errors</a> shows how a deployment responds to
  525. various failures. The events marked in the figure are the
  526. following:</p>
  527. <ol>
  528. <li>
  529. <p>Failure and recovery of a follower</p>
  530. </li>
  531. <li>
  532. <p>Failure and recovery of a different follower</p>
  533. </li>
  534. <li>
  535. <p>Failure of the leader</p>
  536. </li>
  537. <li>
  538. <p>Failure and recovery of two followers</p>
  539. </li>
  540. <li>
  541. <p>Failure of another leader</p>
  542. </li>
  543. </ol>
  544. <a name="Reliability"></a>
  545. <h3 class="h4">Reliability</h3>
  546. <p>To show the behavior of the system over time as
  547. failures are injected we ran a ZooKeeper service made up of
  548. 7 machines. We ran the same saturation benchmark as before,
  549. but this time we kept the write percentage at a constant
  550. 30%, which is a conservative ratio of our expected
  551. workloads.
  552. </p>
  553. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  554. <tr>
  555. <td>Reliability in the Presence of Errors</td>
  556. </tr>
  557. <tr>
  558. <td>
  559. <img alt="" src="images/zkperfreliability.jpg">
  560. </td>
  561. </tr>
  562. </table>
  563. <p>The are a few important observations from this graph. First, if
  564. followers fail and recover quickly, then ZooKeeper is able to sustain a
  565. high throughput despite the failure. But maybe more importantly, the
  566. leader election algorithm allows for the system to recover fast enough
  567. to prevent throughput from dropping substantially. In our observations,
  568. ZooKeeper takes less than 200ms to elect a new leader. Third, as
  569. followers recover, ZooKeeper is able to raise throughput again once they
  570. start processing requests.</p>
  571. <a name="The+ZooKeeper+Project"></a>
  572. <h3 class="h4">The ZooKeeper Project</h3>
  573. <p>ZooKeeper has been
  574. <a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/PoweredBy">
  575. successfully used
  576. </a>
  577. in many industrial applications. It is used at Yahoo! as the
  578. coordination and failure recovery service for Yahoo! Message
  579. Broker, which is a highly scalable publish-subscribe system
  580. managing thousands of topics for replication and data
  581. delivery. It is used by the Fetching Service for Yahoo!
  582. crawler, where it also manages failure recovery. A number of
  583. Yahoo! advertising systems also use ZooKeeper to implement
  584. reliable services.
  585. </p>
  586. <p>All users and developers are encouraged to join the
  587. community and contribute their expertise. See the
  588. <a href="http://zookeeper.apache.org/">
  589. Zookeeper Project on Apache
  590. </a>
  591. for more information.
  592. </p>
  593. </div>
  594. <p align="right">
  595. <font size="-2"></font>
  596. </p>
  597. </div>
  598. <!--+
  599. |end content
  600. +-->
  601. <div class="clearboth">&nbsp;</div>
  602. </div>
  603. <div id="footer">
  604. <!--+
  605. |start bottomstrip
  606. +-->
  607. <div class="lastmodified">
  608. <script type="text/javascript"><!--
  609. document.write("Last Published: " + document.lastModified);
  610. // --></script>
  611. </div>
  612. <div class="copyright">
  613. Copyright &copy;
  614. 2008-2013 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
  615. </div>
  616. <!--+
  617. |end bottomstrip
  618. +-->
  619. </div>
  620. </body>
  621. </html>