127.1 流程图


127.2 Solr中建立collection

  • Solr collection的schema文件建立
[root@ip-xxx-xx-x-xxx conf]# cat schema.xml
<?xml version="1.0" encoding="UTF-8" ?>
<schema name="example" version="1.5">
<fields>
<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false"/>
<field name="_version_" type="long" indexed="true" stored="true"/>
<field name="content" type="text_ch" indexed="true" stored="true"/>
</fields>
<uniqueKey>id</uniqueKey>
<types><fieldType name="string" class="solr.StrField" sortMissingLast="true"/><fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/><fieldType name="text_ch" class="solr.TextField" positionIncrementGap="100">  <analyzer type="index">  <tokenizer class="solr.SmartChineseSentenceTokenizerFactory"/>  <filter class="solr.SmartChineseWordTokenFilterFactory"/>  </analyzer>  </fieldType>
</types>
</schema>


https://repository.cloudera.com/artifactory/cdh-releases-rcs/org/apache/lucene/lucene-analyzers-smartcn/4.10.3-cdh5.14.2/
  • collection的脚本
ZK="ip-xxx-xx-x-xxx.ap-southeast-1.compute.internal"
COLLECTION="collection1"
BASE=`pwd`
SHARD=3
REPLICA=1
echo "create solr collection"
rm -rf tmp/*
solrctl --zk $ZK:2181/solr instancedir --generate tmp/${COLLECTION}_configs
cp conf/schema.xml tmp/${COLLECTION}_configs/conf/
solrctl --zk $ZK:2181/solr instancedir --create $COLLECTION tmp/${COLLECTION}_configs
solrctl --zk $ZK:2181/solr collection --create $COLLECTION -s $SHARD -r $REPLICA
solrctl --zk $ZK:2181/solr collection --list
# ZK:Zookeeper的某台机器的hostname
# COLLECTION:需要建立的collection名字
# SHARD:需要建立的shard的数量
# REPLICA:副本数
  • 执行
[root@ip-xxx-xx-x-xxx solr-hbase]# sh create.sh
create solr collection
Uploading configs from tmp/collection1_configs/conf to ip-172-31-5-171.ap-southeast-1.compute.internal:2181/solr. This may take up to a minute.
collection1 (2)

127.3 Morphline与Lily Indexer文件

  • Morphline
morphlines : [{id : morphline1 importCommands : ["org.kitesdk.morphline.**", "com.ngdata.**"]commands : [{extractHBaseCells {mappings : [{inputColumn : "textinfo:content"outputField : "content"type : "string"source : value}]}}]}
]
  • Lily Indexer
<?xml version="1.0"?>
<indexer table="TextHbase" mapper="com.ngdata.hbaseindexer.morphline.MorphlineResultToSolrMapper" mapping-type="row" ><!-- The relative or absolute path on the local file system to the morphline configuration file. --><!-- Use relative path "morphlines.conf" for morphlines managed by Cloudera Manager --><param name="morphlineFile" value="/root/solr-hbase/conf/morphlines.conf"/><!-- The optional morphlineId identifies a morphline if there are multiple morphlines in morphlines.conf --><!-- <param name="morphlineId" value="morphline1"/> -->
</indexer>

###127.4 全文索引批量建立

  • 下载中文分词的jar包
https://repository.cloudera.com/artifactory/cdh-releases-rcs/org/apache/lucene/lucene-analyzers-smartcn/4.10.3-cdh5.14.2/
  • 分发到Solr和YARN服务相关的目录
[root@ip-xxx-xx-x-xxx solr-hdfs]# cp lucene-analyzers-smartcn-4.10.3-cdh5.14.2.jar /opt/cloudera/parcels/CDH/lib/hadoop-yarn
[root@ip-xxx-xx-x-xxx solr-hdfs]# cp lucene-analyzers-smartcn-4.10.3-cdh5.14.2.jar /opt/cloudera/parcels/CDH/lib/solr/webapps/solr/WEB-INF/lib
  • 分发到集群
[root@ip-xxx-xx-x-xxx shell]# sh bk_cp.sh node.list  /opt/cloudera/parcels/CDH/lib/hadoop-yarn/lucene-analyzers-smartcn-4.10.3-cdh5.14.2.jar  /opt/cloudera/parcels/CDH/lib/hadoop-yarn
lucene-analyzers-smartcn-4.10.3-cdh5.14.2.jar
[root@ip-xxx-xx-x-xxx shell]# sh bk_cp.sh node.list /opt/cloudera/parcels/CDH/lib/solr/webapps/solr/WEB-INF/lib/lucene-analyzers-smartcn-4.10.3-cdh5.14.2.jar /opt/cloudera/parcels/CDH/lib/solr/webapps/solr/WEB-INF/lib
  • 索引脚本
COLLECTION='collection1'
ZK='ip-172-31-5-38.ap-southeast-1.compute.internal'
echo 'Delete previous docs...'
solrctl collection --deletedocs $COLLECTION
echo 'Lily HBase MapReduce indexing...'
config="/etc/hadoop/conf.cloudera.yarn"
parcel="/opt/cloudera/parcels/CDH"
jar="$parcel/lib/hbase-solr/tools/hbase-indexer-mr-*-job.jar"
hbase_conf="/etc/hbase/conf/hbase-site.xml"
opts="'mapred.child.java.opts=-Xmx1024m'"
log4j="$parcel/share/doc/search*/examples/solr-nrt/log4j.properties"
zk="$ZK:2181/solr"
libjars="lib/lucene-analyzers-smartcn-4.10.3-cdh5.14.2.jar"
export HADOOP_OPTS="-Djava.security.auth.login.config=conf/jaas.conf"
hadoop --config $config jar $jar --conf $hbase_conf --libjars $libjars -D $opts --log4j $log4j --hbase-indexer-file conf/indexer-config.xml --verbose --go-live --zk-host $zk --collection $COLLECTION
  • 运行
[root@ip-xxx-xx-x-xxx solr-hbase]# sh batch.sh
Delete previous docs...
Lily HBase MapReduce indexing...
0    [main] INFO  org.apache.solr.common.cloud.SolrZkClient  - Using default ZkCredentialsProvider
21   [main] INFO  org.apache.solr.common.cloud.ConnectionManager  - Waiting for client to connect to ZooKeeper
25   [main-SendThread(ip-172-31-5-38.ap-southeast-1.compute.internal:2181)] WARN  org.apache.zookeeper.ClientCnxn  - SASL configuration failed: javax.security.auth.login.LoginException: Zookeeper client cannot authenticate using the 'Client' section of the supplied JAAS configuration: 'conf/jaas.conf' because of a RuntimeException: java.lang.SecurityException: java.io.IOException: conf/jaas.conf (No such file or directory) Will continue connection to Zookeeper server without SASL authentication, if Zookeeper server allows it.

  • 在Solr和Hue界面中查询




大数据视频推荐:
CSDN
人工智能算法竞赛实战
AIops智能运维机器学习算法实战
ELK7 stack开发运维实战
PySpark机器学习从入门到精通
AIOps智能运维实战
大数据语音推荐:
ELK7 stack开发运维
企业级大数据技术应用
大数据机器学习案例之推荐系统
自然语言处理
大数据基础
人工智能:深度学习入门到精通

127.Lily HBase Indexer的使用相关推荐

  1. Key-Value Store Indexer(Lily HBase Indexer) 小型采坑

    环境: Cloudera Express 5.12.1 JDK 1.8.0_92 CentOS 7 步骤1:数据导入到Hbase中(非正题,跳过) hbase中表为allDoc,两个Family:fu ...

  2. 用Lily Hbase indexer 工具包同步Hbase的索引到solr出错

    用Lily Hbase indexer 工具包同步Hbase的索引到solr出错 错误堆栈 2019-05-21 06:52:07,181 ERROR [IPC Server handler 8 on ...

  3. Lily HBase Indexer使用整理

    关于Key-Value Indexer组件 CDH5.3.2中的Key-Value Indexer使用的是Lily HBase NRT Indexer服务,Lily HBase Indexer是一款灵 ...

  4. Lily HBase Indexer在CDH中的基本使用

    1. 简介 CDH上的Key-Value Store Indexer服务使用的是Lily HBase Indexer.Lily HBase Indexer是一款灵活的.可扩展的.高容错的,并且近实时的 ...

  5. 使用Lily HBase Indexer

    第一步,打开solr的cloud mode. cd $SOLR_HOME/example java -Dbootstrap_confdir=./solr/collection1/conf -Dcoll ...

  6. 【Solr - HBase二级索引 —— Lily HBase Indexer】

    开门见山,直接上图,这图瞧着熟悉吧~哈哈哈 Reference https://blog.csdn.net/cafebar123/article/details/79405029

  7. CDH 6 安装 Hbase 二级索引 Solr + Key-Value Store Indexer

    目录 一.集群安装Solr +  Key-Value Store Indexer 二.创建Hbase二级索引 1.更改表结构,允许复制 2.创建相应的SolrCloud集合 3.创建 collecti ...

  8. Hbase二级索引+CDH+Lily

    1.更改表结构,允许复制 已存在的表 disable 'tableName' alter 'tableName',{NAME =>'fn', REPLICATION_SCOPE =>1} ...

  9. 阿里云HBase增强版全文索引功能技术解析

    新用户9.9元即可使用6个月云数据库HBase,更有低至1元包年的入门规格供广大HBase爱好者学习研究,更多内容请参考链接 阿里云HBase增强版(Lindorm)简介 阿里云数据库HBase增强版 ...

最新文章

  1. WEB SSH Ajaxterm客户端配置(1)
  2. exchange之2003迁移至2007
  3. LSTM入门学习——结合《LSTM模型》文章看
  4. GET和POST两种基本请求方法的区别(截取自https://www.cnblogs.com/logsharing/p/8448446.html)
  5. 笔试算法复习——数组去重
  6. Android 自定义带图标Toast,工具方法,Toast自定义显示时间
  7. python所有软件-这些Python开源软件解决了程序员几乎所有的问题
  8. java applet运行jmx,通过tomcat设置jvm及添加jmx远程访问、gc输出日志
  9. Google账号找回通用方法(尤其是知道账号密码仍无法登录和找回的)
  10. linux V4L2子系统——v4l2架构(5)之v4l2_device与v4l2_subdev异步机制
  11. 如何利用java打开本地exe文件
  12. HDR:Recovering High Dynamic Range Radiance Maps from Photographs
  13. 组建Ad Hoc模式无线局域网
  14. Soul聊天记录备份和恢复(旧机迁移至新机)
  15. 一般网站需要多少流量多大空间才够用
  16. 系统光驱盘符不见的解决方法
  17. 47 WebGL雾化(大气效果)
  18. 从事Web前端要学什么 常用前端开发技术有哪些
  19. 【数据治理】电力行业数据治理解决方案
  20. 运用广告监测系统,上海发布十二起违法广告典型案例-十目监测

热门文章

  1. 商场里的导购图怎么制作?在商场内怎么导航?
  2. @Pointcut 的常用方式:execution,within,this,target,args,@within,@target,@args,@annotation等介绍
  3. 求比正整数N大的最小正整数M,且M与N的二进制表示中有相同数目的1
  4. sql2008数据库恢复到2000
  5. Android11 状态栏icon图标的显示流程
  6. “中国脑计划”:向最后的前沿进发 | 央视对话
  7. c++中extern用法-个人理解
  8. python输入逗号分隔值文件_Python-从文本文件中读取逗号分隔的值,然后将结果输出到文本fi...
  9. python 如何利用字典中的一个键(key)存储多个值(列表)
  10. EventHandler委托