hbase

Apache Phoenix介绍&安装

混江龙づ霸主 提交于 2020-01-18 08:15:27
概述 Phoenix是构建在HBase上的一个SQL层,能让我们用标准的JDBC APIs而不是HBase客户端APIs来创建表,插入数据和对HBase数据进行查询。Phoenix完全使用Java编写,作为HBase内嵌的JDBC驱动。Phoenix查询引擎会将SQL查询转换为一个或多个HBase扫描,并编排执行以生成标准的JDBC结果集。下载 apache-phoenix-4.10.0-HBase-1.2-bin.tar.gz ,注意下载的Phoenix版本必须和hbase目标版本保持一致。更多版本 http://archive.apache.org/dist/phoenix 安装 安装好HDFS,并且保证HDFS正常运行 必须配置HADOOP_HOME,因为HBase需要通过该变量定位HADOOP服务 安装Zookeeper(存储集群的元数据信息HMaster和HRegionServer) [ root@CentOS ~ ] # tar -zxf zookeeper-3.4.6.tar.gz -C /usr/ [ root@CentOS ~ ] # mkdir zkdata [ root@CentOS ~ ] # touch /usr/zookeeper-3.4.6/conf/zoo.cfg [ root@CentOS ~ ] # vi /usr/zookeeper-3.4.6

Hbase表重命名 表改名

若如初见. 提交于 2020-01-18 07:05:30
本文转载自: https://www.cnblogs.com/tnsay/p/5781064.html 作者:tnsay 转载请注明该声明。 PS:现在我有个表 :test11_new ,我要给他改名 开始: 1、先disable掉表 hbase(main):023:0> disable 'test11_new' 0 row(s) in 1.2290 seconds 2、创建一个快照 hbase(main):024:0> snapshot 'test11_new', 'test11_newSnapshot' 0 row(s) in 0.3500 seconds 3、克隆这个快照 赋给新的表名 hbase(main):025:0> clone_snapshot 'test11_newSnapshot', 'test111' 0 row(s) in 0.7280 seconds 4、删除之前创建的快照 hbase(main):026:0> delete_snapshot 'test11_newSnapshot' 0 row(s) in 0.0290 seconds 5、再删除掉之前的表 hbase(main):027:0> drop 'test11_new' 0 row(s) in 0.3800 seconds 新的表名如上 再scan一下 hbase(main):029:0>

python3访问HBase数据库

风流意气都作罢 提交于 2020-01-17 21:47:17
python3访问HBase数据库 1 介绍 2 启动thrift-server 3 安装thrift-client 3.1 安装依赖 3.2 安装boost 3.3 安装thrift客户端 4 使用python3连接Hbase(hbase-thrift) 5 常用方法介绍 1 介绍 Hbase是用Java写的,它原生地提供了Java接口,对非Java程序人员,它也提供了thrift接口,因此也可以采用其他语言来编写Hbase的客户端,本文即介绍了python通过thrift接口访问HBase数据库的方法。 目前Hbase有两套thrift接口(thrift和thrift2),它们并不兼容。根据官方文档,thrift很可能被抛弃,但网上的文章基本是介绍thrift的,我们这里采用的也是thrift。 software version HBase 1.2.9 Python 3.6.3 Thrift 0.11.0 2 启动thrift-server 要使用Hbase的thrift接口,必须将它的服务启动,启动Hbase的thrift-server进程如下: cd /home/hbase-1.2.9/ ./hbase-daemon.sh start thrift 执行jps命令检查: 34533 ThriftServer thrift默认端口是9090,启动成功后可以查看端口是否起来 3

HBase集群搭建实验(1)_单机模式安装(使用内置ZooKeeper)

吃可爱长大的小学妹 提交于 2020-01-17 21:33:25
HBase单机模式: 1)Hbase不使用HDFS存储数据,仅使用本地Linux文件系统来存储数据 2) 不同的HBase或ZooKeeper守护进程都运行在同一个 JVM (Java Virtual Machine)中 3)HBase单机模式安装是 完全不依赖于Hadoop的,仅 用于在硬件配置(内存)很低的计算机上进行 最简单的 HBase 安装和使用体验 实验前提: 无任何实验前提 ,HBase伪分布式部署完全不依赖于Hadoop,在一台普通的Linux主机上即可进行HBase单机模式安装 实验目标: 在单台Linux虚拟机主机上部署单机模式的HBase ,用于教学演示 集群规划: 无需任何集群规划 实验步骤: 1)启动单台运行Linux的主机,主机名是hadoop,IP地址可自定义,例如192.168.56.20 2)在win7用XSHELL远程登录Linux,注意VirtualBox主机网络管理器的虚拟网卡IP(192.168.56.1)地址和虚拟机Linux处于一个网段 3)上传HBase安装包到Linux的/root目录,解压缩hbase-1.2.0-cdh5.7.0.tar.gz安装包到指定目录/usr/local tar -zxvf /root/hbase-1.2.0-cdh5.7.0.tar.gz -C /usr/local/ 解压缩到/usr/local目录

大数据离线项目处理的总体思路

久未见 提交于 2020-01-17 09:04:19
1 通过mapreduce 计算框架 来对数据进行预处理 2 数据预处理完后 ,把数据上传到linux上 ,通过hive 组件 把预处理的数据加载到 hive的表中 3 如果需要原始表的数据加载到不是textfile 类型的表中时,必须要通过原始表查询出来的结果加载到其他类型的表中,否者数据加载不进去 4 通过数据分析(其实就是写hive的sql 语句查询出来的结果导入到一个文件中 ) 5 建立hive与hbase 的映射表 把分析出来的数据加载到hbase中(为什么:hbase 查询数据的速度比hive 快 ) 注意:在建立hive 与hbase 的映射表的时候,hbase的字段第一个可以不写,默认是第一个,也可以这样写:key 来代替那个默认的rowkey 来源: CSDN 作者: 牛犊6 链接: https://blog.csdn.net/weixin_45793819/article/details/103843238

Hadoop Hive query files from hdfs

拈花ヽ惹草 提交于 2020-01-17 08:10:39
问题 If I build Hive on top of HDFS, do I need to put all the files into hive/warehouse folder before processing them? Can I query any file which is in hdfs by hive? How? 回答1: You don't have to do anything special in order to run Hive on top of your existing HDFS cluster. This happens by virtue of Hive's architecture. Hive by default runs on HDFS. do I need to put all the files into hive/warehouse folder before processing them? You don't have to do this either. When you create a Hive table and

HBase的RowKey与列族设计原则

♀尐吖头ヾ 提交于 2020-01-17 07:34:49
Roekey 设计原则: 1)Rowkey的长度原则: 是一个二进制码流,Rowkey 的长度被很多开发者建议说设计在10~100 个字节,不过建议是越短越好,不要超过16 个字节。 2)Rowkey散列原则:如果Rowkey 是按时间戳的方式递增,不要将时间放在二进制码的前面,建议将Rowkey的高位作为散列字段,由程序循环生成,低位放时间字段,这样将提高数据均衡分布在每个Regionserver 实现负载均衡的几率。如果没有散列字段,首字段直接是时间信息将产生所有新数据都在一个 RegionServer 上堆积的热点现象,这样在做数据检索的时候负载将会集中在个别RegionServer,降低查询效率。 3)Rowkey唯一原则:必须在设计上保证其唯一性。 列族设计原则: (1)一般不建议设计多个列族。具体原因如下 假如HBase表的表设置两个列族,若已一个列族1000万行,另一个列族100行。当一个要求region分裂时候,会导致100行的列会同样分布到多个region中。这样就出现基数问题,会导致扫描列族A的性能低下。某个列族在flush的时候,它邻近的列族也会因关联效应出发flush,最终导致系统产生更多的I/O。 HBase本身的设计目标是支持稀疏表,而稀疏表通常会有很多列,但是每一行有值的列又比较少。在HBase中Column Family的数量通常很小

Hbase监控界面报错:500

帅比萌擦擦* 提交于 2020-01-17 06:38:09
Hbase 16010端口, 监控界面报错:500 错误信息如下: 查看日志 (cat -n hbase-bigdata-master-master.log |grep “ERROR”) 错误提示: master failed to complete initialization after 90000ms 这可能是没有配置时间同步NTP导致的问题 可以配置NTP或选择下面这个简单粗暴的方法: date 查看各个节点的时间 若时间间隔较大,则 把各个节点时间同步到一个节点上(ntpdate -u master) (同步时间需要使用root权限) 然后重启hbase即可 来源: CSDN 作者: 吃冰淇淋 链接: https://blog.csdn.net/weixin_43729499/article/details/103859046

How can I Develop a Hbase Web Application?

本小妞迷上赌 提交于 2020-01-17 06:36:51
问题 Can any one help me in developing a web application that uses the HBase as its backend database, as I'm new to HBase, I'm not having any idea of developing HBase web application. I'm writing the code in JSPs like a JDBC program, but it's not getting. Please help me to find out procedure or any sample examples so that I can try it. Thanks in advance 回答1: You can use HBase as Backend or Database layer to your application, the same way you use any RDBMS. You need to connect to HBase through Java

Hbase number of regions keep growing

☆樱花仙子☆ 提交于 2020-01-17 06:09:36
问题 We are using hbase version 1.1.4. The DB has a around 40 tables, and each table data has a TimeToLive specified. It is deployed on a 5 node cluster, and the following is the hbase-site.xml <property> <name>phoenix.query.threadPoolSize</name> <value>2048</value> </property> <property> <name>hbase.hregion.max.filesize</name> <value>21474836480</value> </property> <property> <name>hbase.hregion.memstore.block.multiplier</name> <value>4</value> </property> <!-- default is 64MB 67108864 -->