How to set up Zookeeper with Eclipse?

- Checkout zookeeper
$ git clone git@github.com:apache/zookeeper.git  
- Click File .. -> New -> Project ... -> Java Project from an Existing Ant file
- Select zookeeper/build.txt

How to setup HBase with Eclipse?

a) First, follow these instructions:
http://tonylixu.blogspot.com/2013/06/hadoop-how-to-set-up-hbase-in-eclipse_25.html

b) Then, to setup log4j from Eclipse:
  1. Right-click hbase-server -> Run as... -> Run Configurations
  2. Click Classpath tab -> User Entries
  3. Advanced... -> Add Folders -> OK
  4. Select hbase/conf -> OK -> Apply
c) To build, run the following from hbase directory
  • mvn package -DskipTests
d) Save the following hbase-site.xml in hbase/conf
  
  <configuration>
  <property> 
     <name>hbase.rootdir</name>
     <value>file:////tmp/hbase/hbase-\${user.name}/hbase</value>
  </property> 
  <property> 
     <name>hbase.zookeeper.dns.interface</name>
     <value>lo</value> 
  </property>
  <property> 
    <name>hbase.regionserver.dns.interface</name>
    <value>lo</value>
  </property>
  <property>
    <name>hbase.master.dns.interface</name> 
    <value>lo</value>
  </property>
  </configuration> 
 
e) To work around the IPv6 bug in org.apache.hadoop.net.DNS.reverseDns one can disable IPv6 on loopback interface
ifconfig lo inet6 del ::1/128
Otherwise you might see the following in the stack trace:

Caused by: java.lang.ArrayIndexOutOfBoundsException: 3
    at org.apache.hadoop.net.DNS.reverseDns(DNS.java:78)