博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Hadoop生态圈-phoenix(HBase)的索引配置
阅读量:6677 次
发布时间:2019-06-25

本文共 2563 字,大约阅读时间需要 8 分钟。

                    Hadoop生态圈-phoenix(HBase)的索引配置

                                              作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

 

 

  创建索引是为了优化查询,我们可以在phoenix上配置索引方式。

 

一.修改hbase配置文件,以便支持索引

 1>.xrsync.sh 脚本内容

1 [yinzhengjie@s101 ~]$ more `which xrsync.sh` 2 #!/bin/bash 3 #@author :yinzhengjie 4 #blog:http://www.cnblogs.com/yinzhengjie 5 #EMAIL:y1053419035@qq.com 6  7 #判断用户是否传参 8 if [ $# -lt 1 ];then 9     echo "请输入参数";10     exit11 fi12 13 14 #获取文件路径15 file=$@16 17 #获取子路径18 filename=`basename $file`19 20 #获取父路径21 dirpath=`dirname $file`22 23 #获取完整路径24 cd $dirpath25 fullpath=`pwd -P`26 27 #同步文件到DataNode28 for (( i=102;i<=105;i++ ))29 do30     #使终端变绿色 31     tput setaf 232     echo =========== s$i %file ===========33     #使终端变回原来的颜色,即白灰色34     tput setaf 735     #远程执行命令36     rsync -lr $filename `whoami`@s$i:$fullpath37     #判断命令是否执行成功38     if [ $? == 0 ];then39         echo "命令执行成功"40     fi41 done42 [yinzhengjie@s101 ~]$

2>.修改hbase配置文件,以便支持索引

 3>.重启hbase

[yinzhengjie@s101 ~]$ stop-hbase.sh stopping hbase..................[yinzhengjie@s101 ~]$ start-hbase.sh starting master, logging to /soft/hbase/bin/../logs/hbase-yinzhengjie-master-s101.outJava HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0s102: starting regionserver, logging to /soft/hbase/bin/../logs/hbase-yinzhengjie-regionserver-s102.outs103: starting regionserver, logging to /soft/hbase/bin/../logs/hbase-yinzhengjie-regionserver-s103.outs104: starting regionserver, logging to /soft/hbase/bin/../logs/hbase-yinzhengjie-regionserver-s104.outs102: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0s102: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0s103: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0s103: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0s104: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0s104: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0[yinzhengjie@s101 ~]$

 

二.设置索引方式

   注意:创建表的时候,如果需要创建索引,表必须在hbase默认namespace中。

1>.创建表

 

2>.全局索引(读多写少,局限在于影响写入性能,但是可以搜索全字段)

 

2>.覆盖索引(局限性在于只能搜索到name,即搜索name性能最高)

 

3>.本地索引(写多读少,在于通过本地维护索引,索引在每次搜索,都会用到) 

 

4>.删除索引

 

转载于:https://www.cnblogs.com/yinzhengjie/p/9181888.html

你可能感兴趣的文章
大数记录之,大数乘整型数nyoj832
查看>>
使用Unity3D自带动画系统制作下雨效果
查看>>
02 svn 文件提交与目录结构
查看>>
ConcurrentHashMap vs Collections.synchronizedMap()不同
查看>>
深入Spring Boot--使用Arthas排查应用404/401问题
查看>>
0707 - iTips v0.0.1
查看>>
java基础(三) 加强型for循环与Iterator
查看>>
ReactNaive之CSS和Flex布局
查看>>
自制分布式漏洞扫描
查看>>
waf 绕过的技巧
查看>>
Android鬼点子 如此Q弹!
查看>>
Essay
查看>>
前端面试自查
查看>>
解读 Node 核心模块 Stream 系列一( Readable )
查看>>
webpack入门笔记——热替换
查看>>
Wakatime 不升级会员也能查看历史数据了!
查看>>
优雅的实现CALayer的"AutoLayout"的两种方案
查看>>
从双十一看阿里云安全的“创世纪”——采访阿里云安全掌门人肖力有感
查看>>
基于django的视频点播网站开发-step4-首页功能
查看>>
告别李国庆,19岁当当的思变与求变
查看>>