Centos6.5下Hbase安装

  1. 下载

http://mirror.bit.edu.cn/apache/hbase/hbase-0.94.26/hbase-0.94.26.tar.gz

2.  解压

tar -zxvf hbase-0.94.26.tar.gz

3. 配置目录

HBASE_HOME/conf/hbase-site.xml

<configuration>
    <property>
    <name>hbase.rootdir</name>
    <value>file:/usr/hbase/hbase-${user.name}</value>
    </property>
</configuration>

4. 配置说明

默认只有<configuration></configuration>配置,没有property配置,需要自己加上
也可以不用配置,直接第四步启动

(hbase默认目录:/tmp/hbase-${user.name},由于很多操作系统会在重启的时候清空/tmp目录,所以这里设置一下比较好)

5. 启动

[[email protected] bin]# ./start-hbase.sh
starting master, logging to /usr/local/hbase-0.94.26/bin/../logs/hbase-root-master-liuchao.out

6. 貌似成功了(试试)

[[email protected] bin]# ./hbase shell
HBase Shell; enter ‘help<RETURN>‘ for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.94.26, ra9114543cd48c7e230dabd31f45a086f7b7a5d6a, Wed Dec 17 20:37:01 UTC 2014

hbase(main):001:0> status
1 servers, 0 dead, 2.0000 average load

hbase(main):002:0>

7. 看到这些,说明已经成功了,可以进行下一步测试了

创建一张表

hbase(main):001:0> create ‘testtable‘,‘colfam1‘
0 row(s) in 3.7160 seconds
1:>查看创建的表(写错了)
hbase(main):002:0> list ‘tae‘
TABLE
0 row(s) in 0.2010 seconds

hbase(main):003:0> list ‘testtable‘
TABLE
testtable
1 row(s) in 0.1050 seconds

插入几条数据

hbase(main):004:0> put ‘testtable‘,‘myrow-1‘,‘colfam1:q1‘,‘value-1‘
0 row(s) in 0.4080 seconds

hbase(main):005:0> put ‘testtable‘,‘myrow-2‘,‘colfam1:q2‘,‘value-2‘
0 row(s) in 0.1320 seconds

hbase(main):006:0> put ‘testtable‘,‘myrow-3‘,‘colfam1:q3‘,‘value-3‘
0 row(s) in 0.1090 seconds

查看表中的数据

hbase(main):007:0> scan ‘testtable‘
ROW COLUMN+CELL
myrow-1 column=colfam1:q1, timestamp=1424834391342, value=value-1
myrow-2 column=colfam1:q2, timestamp=1424834424591, value=value-2
myrow-3 column=colfam1:q3, timestamp=1424834464914, value=value-3
3 row(s) in 0.2360 seconds

获取某一行的数据

hbase(main):002:0> get ‘testtable‘,‘myrow-2‘
COLUMN CELL
colfam1:q2 timestamp=1424834424591, value=value-2
1 row(s) in 0.2090 seconds

删除一行数据

hbase(main):003:0> delete ‘testtable‘,‘myrow-2‘,‘colfam1:q2‘
0 row(s) in 0.1110 seconds

hbase(main):004:0> scan ‘testtable‘
ROW COLUMN+CELL
myrow-1 column=colfam1:q1, timestamp=1424834391342, value=value-1
myrow-3 column=colfam1:q3, timestamp=1424834464914, value=value-3
2 row(s) in 0.1780 seconds

禁用并删除表

hbase(main):004:0> disable ‘testtable‘
0 row(s) in 1.4690 seconds
这时再查看,表已经不能用了
hbase(main):005:0> scan ‘testtable‘
ROW COLUMN+CELL

ERROR: org.apache.hadoop.hbase.DoNotRetryIOException: testtable is disabled.

表启用

hbase(main):002:0> enable ‘testtable‘
0 row(s) in 1.5810 seconds
现在又可以用了
hbase(main):002:0> scan ‘testtable‘
ROW COLUMN+CELL
myrow-1 column=colfam1:q1, timestamp=1424834391342, value=value-1
myrow-3 column=colfam1:q3, timestamp=1424834464914, value=value-3
2 row(s) in 0.3160 seconds

删除表

hbase(main):003:0> drop ‘testtable‘

ERROR: Table testtable is enabled. Disable it first.‘

Here is some help for this command:
Drop the named table. Table must first be disabled: e.g. "hbase> drop ‘t1‘"
必须先禁用表,才能删除表
hbase(main):004:0> disable ‘testtable‘
0 row(s) in 1.4460 seconds

hbase(main):005:0> drop ‘testtable‘
0 row(s) in 1.3030 seconds

hbase(main):006:0> scan ‘testtable‘
ROW COLUMN+CELL

ERROR: Unknown table testtable!

退出

hbase(main):001:0> exit

关闭Hbase

[[email protected] bin]# ./stop-hbase.sh
stopping hbase.....................

8. 启动报错

[[email protected] bin]# ./start-hbase.sh
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/hadoop/hbase/util/HBaseConfTool : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.apache.hadoop.hbase.util.HBaseConfTool. Program will exit.
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/hadoop/hbase/zookeeper/ZKServerTool : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.apache.hadoop.hbase.zookeeper.ZKServerTool. Program will exit.
starting master, logging to /usr/local/hbase-1.0.0/bin/../logs/hbase-root-master-liuchao.out
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/hadoop/hbase/master/HMaster : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
starting regionserver, logging to /usr/local/hbase-1.0.0/bin/../logs/hbase-root-1-regionserver-liuchao.out
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/hadoop/hbase/regionserver/HRegionServer : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

9. 应该是版本不对

之前安装的是hbase-1.0.0-bin.tar.gz 可以版本高了

后来安装的是hbase-0.94.26.tar.gz  没有问题

时间: 2024-11-06 14:33:43

Centos6.5下Hbase安装的相关文章

Centos6.4下Nginx安装

Nginx ("engine x") 是一个高性能的 HTTP 和反向代理服务器,也是一个 IMAP/POP3/SMTP 代理服务器. Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,它已经在该站点运行超过三年了.Igor 将源代码以类BSD许可证的形式发布. Nginx和Apache区别 Nginx 超越 Apache 的高性能和稳定性,使得国内使用 Nginx 作为 Web 服务器的网站也越来越多,其中包括新浪博客.新浪播客.网易新

CentOS6.3下DNS安装与配置

1.下载并安装最新的bind包 yum install –y bind bind-chroot bind-utis 2.配置named.conf acl internals{ 127.0.0.0/8; 192.168.0.0/24; }; view "internal" { match-clients {internals; }; zone "youdomian.com" { type master; file "/etc/named/internals/

CentOS6.5_64bit下编译安装MySQL-5.6.23

转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/44785511 ************************************************************         CentOS6.5_64bit下编译安装MySQL-5.6.23 **************************************************************一.关闭防火墙chkconfig iptable

Linux(CentOS6.5)下编译安装PHP5.6.22时报错&rdquo;configure: error: ZLIB extension requires gzgets in zlib&rdquo;的解决方式(确定已经编译安装Zlib,并已经指定Zlib路径)

本文地址http://comexchan.cnblogs.com/,作者Comex Chan,尊重知识产权,转载请注明出处,谢谢!   今天在CentOS6.5下编译安装PHP时,一直报错 configure: error: ZLIB extension requires gzgets in zlib 而Zlib确定已经安装了. 使用Google根本搜索不到有关的错误. 尝试重新编译了Zlib,还是不行. 后面发现我的PHP编译选项里面有个 --with-libdir=lib64 \ 删除之,再

centos6.7下编译安装lnmp

很多步骤不说明了,请参照本人的centos6.7下编译安装lamp,这次的架构是nginx+php-fpm一台服务器,mysql一台服务器 (1)首先编译安装nginx: 操作命令: yum -y groupinstall "Development Tools" "Server Platform Development" yum -y install pcre-devel  useradd -r nginx  mkdir /var/tmp/nginx   事先得创建

centos6.7下 编译安装MySQL5.7

centos6.7下编译安装MySQL5.7 准备工作 #-----依赖包及MySQL和boost安装包----- #yum包安装: shell> yum -y install gcc-c++ ncurses-devel cmake make perl gcc autoconf automake zlib libxml libgcrypt libtool bison #获取boost类库(5.7编译需要boost类库,编译时指定boost路径): shell> wget http://down

CentOS6.5下Oracle11G-R2安装、卸载

资源下载地址(包括本人所有安装过程中,系统备份文件):http://download.csdn.net/detail/attagain/7700437 一. 硬件要求 本部分内容命令,均以root用户执行. 1. 内存 建议内存应大于2G以上,1G可以运行,但比较吃力. 内存查看命令: [[email protected] /]# cat /proc/meminfo 或 [[email protected] /]# free -m total       used       free    

Linux(CentOS6.5)下编译安装Nginx官方最新稳定版(nginx-1.10.0)

本文地址http://comexchan.cnblogs.com/ ,作者Comex Chan,尊重知识产权,转载请注明出处,谢谢! 下载相关组件源码 组件名 组件官网 直接下载地址 pcre http://www.pcre.org/ http://120.52.73.43/jaist.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.tar.gz openssl https://www.openssl.org/source/ https:/

CentOS6.5下编译安装LAMP环境

LAMP(Linux-Apache-MySQL-PHP)网站架构是目前国际流行的Web框架.该框架能够满足大流量.大并发量的网站需求:当然.也可以直接使用高性能的服务器.高性能的负载均衡硬件以及CDN加速等.若想真正的设计一个非常好的支撑高并发.高吞吐量的架构,除了必要的高性能的硬件之外,还必须要慎重的选择高性能的操作系统.高性能的网页服务器.高性能的数据库.高性能的编程语言等. LAMP框架包括: 1. Linux操作系统 2. Apache网络服务器 3. MySQL数据库 4. Perl.