README.txt 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. This module provides a BookKeeper backend for HFDS Namenode write
  2. ahead logging.
  3. BookKeeper is a highly available distributed write ahead logging
  4. system. For more details, see
  5. http://zookeeper.apache.org/bookkeeper
  6. -------------------------------------------------------------------------------
  7. How do I build?
  8. To generate the distribution packages for BK journal, do the
  9. following.
  10. $ mvn clean package -Pdist
  11. This will generate a jar with all the dependencies needed by the journal
  12. manager,
  13. target/hadoop-hdfs-bkjournal-<VERSION>.jar
  14. Note that the -Pdist part of the build command is important, as otherwise
  15. the dependencies would not be packaged in the jar.
  16. -------------------------------------------------------------------------------
  17. How do I use the BookKeeper Journal?
  18. To run a HDFS namenode using BookKeeper as a backend, copy the bkjournal
  19. jar, generated above, into the lib directory of hdfs. In the standard
  20. distribution of HDFS, this is at $HADOOP_HDFS_HOME/share/hadoop/hdfs/lib/
  21. cp target/hadoop-hdfs-bkjournal-<VERSION>.jar \
  22. $HADOOP_HDFS_HOME/share/hadoop/hdfs/lib/
  23. Then, in hdfs-site.xml, set the following properties.
  24. <property>
  25. <name>dfs.namenode.edits.dir</name>
  26. <value>bookkeeper://localhost:2181/bkjournal,file:///path/for/edits</value>
  27. </property>
  28. <property>
  29. <name>dfs.namenode.edits.journal-plugin.bookkeeper</name>
  30. <value>org.apache.hadoop.contrib.bkjournal.BookKeeperJournalManager</value>
  31. </property>
  32. In this example, the namenode is configured to use 2 write ahead
  33. logging devices. One writes to BookKeeper and the other to a local
  34. file system. At the moment is is not possible to only write to
  35. BookKeeper, as the resource checker explicitly checked for local
  36. disks currently.
  37. The given example, configures the namenode to look for the journal
  38. metadata at the path /bkjournal on the a standalone zookeeper ensemble
  39. at localhost:2181. To configure a multiple host zookeeper ensemble,
  40. separate the hosts with semicolons. For example, if you have 3
  41. zookeeper servers, zk1, zk2 & zk3, each listening on port 2181, you
  42. would specify this with
  43. bookkeeper://zk1:2181;zk2:2181;zk3:2181/bkjournal
  44. The final part /bkjournal specifies the znode in zookeeper where
  45. ledger metadata will be store. Administrators can set this to anything
  46. they wish.