hbase

springboot+hbase 集成

天涯浪子 提交于 2020-01-27 09:13:28
项目中使用 phoenix 使用SQL 方式来操作Hbase 数据库,但是遇到一个是,SQL在Dbeaver 中查询速度还可以,但是使用phoenix+ibatis 后返回结果集数据量20w ,速度特别慢,先是考虑用redis方式缓存,但是内存有限,想着是用,hbase直连的方式,测试一下解决一下, 一:简介 hbase-client是HBase提供的一套比较底层的API,在实际使用时需要对其进行封装,提供更好用的api给用户。 操作hbase的客户端有以下几种方式: hbase-client 比较底层,需要自己进一步封装api,而且版本号和安装的hbase也要匹配,否则会报错 spring-data-hadoop 2019年4月5停止维护 Apache Phoenix 使用SQL的方式来操作HBase 下面是springboot+ hbase-client方式 注意!需要去掉slf4j和log4j jar 否则会报相应的错误:pom.xml 引入 <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-client</artifactId> <version>2.1.3</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId>

hbase启动失败,Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m

眉间皱痕 提交于 2020-01-26 02:01:27
启动hbase时出现: Java HotSpot™ 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0 Java HotSpot™ 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0 解决方法: hadoop@ubuntu: /usr/local/hbase/conf$ vim hbase-env.sh 注释掉带128的这几个(两个好像是) #export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m" 来源: CSDN 作者: v9ningmeng 链接: https://blog.csdn.net/weixin_44188196/article/details/103773676

windows10 搭建最新的 hadoop 3.1.3 和 hbase 2.2.2 测试环境

邮差的信 提交于 2020-01-25 20:53:36
一、环境准备 1、JDK 2、Hadoop安装包 官网 : https://archive.apache.org/dist/hadoop/common/ https://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/hadoop-3.1.3/ https://www-eu.apache.org/dist/hadoop/common/hadoop-3.1.3/ 3、hadooponwindows-master 下载地址 : https://github.com/cdarlint/winutils https://github.com/steveloughran/winutils 选择 3.1.3 使用 如果不想配置和下载直接用我的文件覆盖 https://download.csdn.net/download/liutietuo/12113221 4、hbase安装包 官网 : http://archive.apache.org/dist/hbase/ http://archive.apache.org/dist/hbase/2.2.2/ 二 版本对应关系 1 Hadoop与Hbase对应的版本 2 Hbase与Jdk对应的版本 三 开始安装 1 解压各个目录 2 设置环境变量 我的电脑 --> 属性 --> 高级系统设置 -->

HBase

99封情书 提交于 2020-01-25 20:01:56
一、概述 Hbase全称为Hadoop Database(基于HDFS的数据库),设计来源Google 的bigtable,Hbase 仿照 bigtable设计基于HDFS上的一款数据库。 1.1 CAP原则 CAP原则又称之为CAP原理,指的是在分布式系统当中,一致性、可用性、分区容错性,三者不可兼得 HBase 是保证CP 1.2 什么是基于列式存储? HBase 是基于列式存储的NoSql 这个概念和RDBMS作对比,传统的数据库对数据的操作单位是一行(若干字段) select username ,pass from user where id = 1 ; update user set username = "gjf " where id = 1 ; 即使操纵的是某一行记录当中的字段,其实RDBMS是查询了整行的内容加载完后完成对数据的修改 行存储问题 列存储 1.3 HBase https://hbase.apache.org/ Hbase 是基于列式存储的分布式的、面向列、基于HDFS的数据库,在需要实时读写,需要访问超大规模数据时,可以使用HBASE。 1.3.1 特点: 大 : 一个表可以有上亿行,可有上百万列 面向列:可以支持稀疏存储 无模式:表的结构灵活,可以任意增加和减少字段 数据多版本:每个cell中的数据可以用多个版本,在默认情况下,版本号自动分配

hbase shell 操作命令

泪湿孤枕 提交于 2020-01-25 15:43:11
运行hbase 在运行hbase之前需要保证hdfs已经成功启动。此时,只需要在namenode(即hbase Master)上运行start-hbase.sh既可。 命令行命令介绍: 1)显示所有的表 :hbase(main):001:0> list 2)创建表 :create 'test-xwh','c1','c2' 3)表中添加数据: put 'test-xwh','r1','c1:1','value1-1/1' 4)查看表中的数据: scan 'test-xwh' 5) 获取表中的指定数据: get 'test-xwh','r1',{COLUMN=>'c2:2'} 6)删除表:drop 'test-xwh' 在删除表的时候如果表是启用的删除不掉,要先禁用这个表 查看表启用的状态:is_enabled 查看表禁用的状态:is_disable 禁用表 :disable 'test-xwh' 来源: CSDN 作者: xiwh 链接: https://blog.csdn.net/xiweihao/article/details/103989399

How to denote the foreign key mapping in hbase

▼魔方 西西 提交于 2020-01-25 12:22:09
问题 Someone please help me understand how the Hbase works internally. Can the value of a column refer to a key of another table? For example: Suppose i have a Student table with subjectId as a foreign key and the Subject table has the id as a primay key, then how would the representation be? How can we map the Student and Subject together? 回答1: Someone please help me understand how the HBase works internally. This is something really big which can't be explained here completely. Please refer this

Hbase client API not connecting to Hbase

泪湿孤枕 提交于 2020-01-24 21:32:30
问题 I am following this link to insert data into my hbase. I followed all the steps and written below code: import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.MasterNotRunningException; import org.apache

HBase dependencies with SBT in Scala

柔情痞子 提交于 2020-01-24 19:57:04
问题 I am new with Scala, SBT and Intellij. Using the following sbt file : name := "mycompany" version := "0.0.1-SNAPSHOT" scalaVersion := "2.11.8" libraryDependencies ++= Seq( "org.apache.spark" %% "spark-core" % "2.0.1", "org.apache.spark" %% "spark-sql" % "2.0.1", "org.apache.spark" %% "spark-mllib" % "2.0.1", "org.apache.hbase" % "hbase-client" % "1.2.0", "com.typesafe.akka" %% "akka-http-experimental" % "2.4.11" ) resolvers ++= Seq( "Apache Repository" at "https://repository.apache.org

hbase 学习 配置文件设置

情到浓时终转凉″ 提交于 2020-01-24 03:24:31
hbase简介 hbase的基本操作 一.hbase简介 HBase是一个开源的,分布式的,多版本的,面向列的存储模型。 HBase存储的数据可以理解为一种key和value的映射关系,但又不是简单的映射关系。存储的数据从逻辑上来看就像一张很大的表,他的数据列可以根据需要动态增加。每个cell(由行和列所确定的位置)中的数据又可以具有多个版本(通过时间戳来区别)。 HBase向下提供了存储,向上提供了 二.hbase的基本操作 1.安装 jdk: 安装hbase之前要安装jdk. hadoop:由于hbase架构基于其他文件存储系统之上,因此在分布式模式下安装Hadoop是必须的。如果运行在单机模式下,可以不用安装hadoop. 分布式安装 hbase 配置文件说明: hbase.client.write.buffer :设置写入缓冲区的数据大小,字节为单位,默认是2MB。服务器通过此缓冲区可以加快处理的速度。但是如果设置的值太大会加重服务器的负担。 <configuration> <property> <!-- 区域服务器使用存储hbase数据库的目录 --> <name>hbase.rootdir</name> <value>hdfs://10.0.12.12:9000/hbase</value> </property> <property> <!--hbase

【大数据】HBase和Hive的集成版本冲突:HTableDescriptor.addFamily(Lorg/apache/hadoop/hbase/HColumnDescriptor;)V

狂风中的少年 提交于 2020-01-24 02:22:25
一、背景 在进行Hive关联HBase的时候,在Hive上查询关联的表hive_hbase_emp_table的时候,出现了错误:【注意:查询hive上的其他表没有问题】 FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. org.apache.hadoop.hbase.HTableDescriptor.addFamily(Lorg/apache/hadoop/hbase/HColumnDescriptor;)V 在 Hive 中创建表同时关联 HBase hive (default)> CREATE TABLE hive_hbase_emp_table( empno int, ename string, job string, mgr int, hiredate string, sal double, comm double, deptno int) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping" = " :key ,info:ename,info:job,info:mgr,info:hiredate