hbase1.2.4 伪分布式安装
注意:在安装hbase或者hadoop的时候,要注意hadoop和hbase的对应关系。如果版本不对应可能造成系统的不稳定和一些其他的问题。在hbase的lib目录下可以看到hadoop对应jar文件,默认情况下hbase下lib的jar文件对应hadoop的相对稳定的版本。如果需要使用其他的hadoop版本,需要将hbase lib下的hadoopjar包,替换掉需要使用的hadoop版本
########hbase####################
export HBASE_HOME=/usr/local/development/hbase-1.2.4 export PATH=$HBASE_HOME/bin:$PATH
export JAVA_HOME=/usr/local/development/jdk1.7.0_15
export HBASE_MANAGES_ZK=false --如果你是使用hbase自带的zk就是true,如果使用自己的zk就是false
<property>
<name>hbase.rootdir</name> --hbase持久保存的目录
<value>hdfs:192.168.8.101:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name> --是否是分布式
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name> --指定要连接zk的端口
<value>2181</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name> --指定要连接zk的节点
<value>192.168.8.101</value>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
regionservers 192.168.8.101
为了防止因为hbase和hadoop版本不一致而出现的问题,可以看下{hbase_home}/lib/下相关hadoop*.jar的jar包,跟你的hadoop是否是同一个版本,如果不是可以从{hadoop_home}/ share/hadoop/ 下复制
/hbase/bin/start-hbase.sh
[root@node4 bin]# ./start-hbase.sh localhost: starting zookeeper, logging to /home/zhangxs/hbase/bin/../logs/hbase-root-zookeeper-node4.out starting master, logging to /usr/local/development/hbase-1.2.4/logs/hbase-node4-master-node4.out starting regionserver, logging to /usr/local/development/hbase-1.2.4/logs/hbase-node4-1-regionserver-node4.out [root@node4 bin]# jps 8057 Jps 3166 NodeManager 7830 HRegionServer 2933 SecondaryNameNode 2561 NameNode 5568 QuorumPeerMain 7706 HMaster 3071 ResourceManager 2650 DataNode 5749 GetConf
![](https://images2017.cnblogs.com/blog/1317456/201801/1317456-20180119210132271-1837721324.png)
如果报这个错误是因为用的jdk是1.8的
需要注释掉以下:
配置文件在:文件在 hbase/conf/hbase-env.sh
# Configure PermSize. Only needed in JDK7. You can safely remove it for JDK8+
export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m"
export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m"
没注释以前start-hbase.sh启动后 HMaster hregionserver会出现一次.....
[root@node4 bin]# hbase shell SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/local/development/hbase-1.2.4/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/local/development/hadoop-2.6.4/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] HBase Shell; enter 'help<RETURN>' for list of supported commands. Type "exit<RETURN>" to leave the HBase Shell Version 1.2.4, r67592f3d062743907f8c5ae00dbbe1ae4f69e5af, Tue Oct 25 18:10:20 CDT 2016 hbase(main):001:0>
![](https://images2015.cnblogs.com/blog/899606/201612/899606-20161227141410945-555098442.png)