从官方下下来hbase-0.98.16.1, 运行start_hbase.sh报错, 首先是找不到JAVA_HOME,
root@debian:/ # start-hbase.sh Error: Could not find or load main class org.apache.hadoop.hbase.util.HBaseConfTool Error: Could not find or load main class org.apache.hadoop.hbase.zookeeper.ZKServerTool starting master, logging to /usr/hbase/hbase-0.98.16.1/logs/hbase-root-master-debian.out Error: Could not find or load main class org.apache.hadoop.hbase.master.HMaster root@localhost's password: localhost: +======================================================================+ localhost: | Error: JAVA_HOME is not set | localhost: +----------------------------------------------------------------------+ localhost: | Please download the latest Sun JDK from the Sun Java web site | localhost: | > http://www.oracle.com/technetwork/java/javase/downloads | localhost: | | localhost: | HBase requires Java 1.6 or later. | localhost: +======================================================================+
要解决找不到JAVA_HOME, 首先要确认你安装了JAVA, 安装请移步这里debian安装java
我把hbase 放在了/usr/hbase下, 所以去下面的目录编辑hbase-env.sh
/usr/hbase/hbase-0.98.16.1/conf大概在27行.
# export JAVA_HOME=/usr/java/jdk1.6.0/取消注释后, 修改JAVA_HOME的地址. 我的java7装在/usr/java/java7/ 里面.
改了半天classpath, 最后发现我下的版本不对, 要去下bin可执行的.
下http://www.apache.org/dyn/closer.cgi/hbase/ 找stable 里面的带bin的.
#cd /tmp && wget http://mirrors.cnnic.cn/apache/hbase/stable/hbase-1.1.2-bin.tar.gz #tar -zxvf hbase-0.98.16.1-src.tar.gz -C /usr/ #cd /usr && mv hbase-0.98.16.1 hbase
#export HBASE_HOME=/usr/hbase #export PATH="$PATH:$HBASE_HOME/bin"直接执行start-hbase.sh就跑起来了.
如果需要开启60010端口的web界面, 需要修改conf下hbase-site.xml
增加以下内容
<configuration> <property> <name>hbase.master.info.port</name> <value>60010</value> </property> </configuration>保存后, 重启hbase即可访问