One, the ZK alone to build
1. Modify the configuration file: Conf/zoo.cfg
Java code
- Ticktime=
- Datadir=/home/hadoop/data/zookeeper
- clientport=2181
- initlimit=5
- synclimit=2
- Server. 1=slave-:2888:3888
- Server. 2=slave-:2888:3888
- Server. 3=slave-:2888:3888
2. Generate the myID file
Java code
- In the slave-01
- echo "1" >/home/hadoop/data/zookeeper/myid
- In the slave-02
- echo "2" >/home/hadoop/data/zookeeper/myid
- In the slave-03
- echo "3" >/home/hadoop/data/zookeeper/myid
3. Need to start ZK on each machine
Java code
- zkserver.sh start
4. Test ZK
Java code
- zkserver.sh status
Second, HBase
1. Modify the Hbase-site.xml configuration file
Java code
- <configuration>
- <property>
- <name>hbase.rootdir</name>
- <value>hdfs://slave-1:9000/hbase</value>
- </property>
- <property>
- <name>hbase.cluster.distributed</name>
- <value>true</value>
- </property>
- <property>
- <name>hbase.zookeeper.property.clientPort</name>
- <value>2181</value>
- </property>
- <property>
- <name>hbase.zookeeper.quorum</name>
- <value>slave-01,slave-02,slave-03</value>
- </property>
- <property>
- <name>hbase.zookeeper.property.dataDir</name>
- <value>/home/hadoop/temp/zookeeper</value>
- </property>
- <property>
- <name>dfs.support.append</name>
- <value>true</value>
- </property>
- </configuration>
2.hbase-env.sh
Java code
- Export JAVA_HOME=/USR/LIB/JAVA/JDK1. installation directory for 6.0_25//JDK
- Export hbase_classpath=/home/hadoop/hadoop-1.0. installation directory for 3/conf//hadoop
- Export hbase_manages_zk=false
3.regionservers
Java code
- slave-
- slave-
- slave-
HBase Zookeeper Standalone Construction