闲话不多讲,主要为了方便手中没有多余机器的朋友
注意:要将hbase中的bin目录和lib目录添加到环境变量中, sudo vim /etc/profile
(1)hbase.env.sh
# The java implementation to use. Java 1.6 required.
export JAVA_HOME=/home/hadoop/jdk
# Extra Java CLASSPATH elements. Optional.
export HBASE_CLASSPATH=/home/hadoop/hadoop/etc/hadoop
# Tell HBase whether it should manage it's own instance of Zookeeper or not.
export HBASE_MANAGES_ZK=true ----------------这个的意思是:使用hbase自带的zookeeper
(2)hbase-site.xml
<configuration>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost:9000/hbase</value>
</property>
<property>
<name>hbase.master</name>
<value>localhost:54311</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>localhost</value>
</property>
<property>
<name>hbase.tmp.dir</name>
<value>/home/hadoop/hbasetmp</value>
</property>
</configuration>