Lily hbase indexer搭建配置概要文檔


1.solrcloud搭建好
2.hbase-solr-indexer服務開啟
3.確定hbase中的對應的表開啟replication功能

create 'noc', {NAME => 'c', COMPRESSION => 'snappy', REPLICATION_SCOPE => '1', VERSIONS => '1'} // 1表示開啟replication

已經創建的表可以使用一下的命令:

disable 'noc' 
alter 'noc',{NAME => 'c', REPLICATION_SCOPE => 1} 
enable 'noc' 

以下可以參考4.solr相關配置文件模板樣例 中general.sh文件
4. 生成實體配置文件,可以自己設置
 solrctl instancedir --generate $PROJECT_HOME 
5. 修改生成好的scheme.xml文件
 mv $PROJECT_HOME/conf/schema.xml $PROJECT_HOME/conf/schema.old

 cp $PROJECT_SCHEMA $PROJECT_HOME/conf/ 
6.創建collection實例並配置文件上傳到zookeeper,命令
 solrctl instancedir --create $COLLECTION_NAME $PROJECT_HOME 
7.上傳到zookeeper之后,其他節點就可以從zookeeper下載配置文件。接下來創建collection,命令
 solrctl collection --create $COLLECTION_NAME -s n (n小於solrcloud節點數) 
如果需要指定--solr

 solrctl --solr http://x.x.x.x:8983/solr/ collection --create $COLLECTION_NAME -s n 

8.創建Lily HBase Indexer配置文件Morphlines.conf

/etc/hbase-solr/conf下面(所有節點確認一下)
9.注冊Lily HBase Indexer configuration 和 Lily Hbase Indexer Service

hbase-indexer add-indexer \
--name $INDEXER_NAME \
--indexer-conf $INDEXER_CONF \
--connection-param solr.zk=$SOLR_ZK_ENSEMBLE \
--connection-param solr.collection=$COLLECTION_NAME \
--zookeeper $ZOOKEEPER

10.驗證索引器是否成功創建

hbase-indexer list-indexers
nocIndexer
+ Lifecycle state: ACTIVE
+ Incremental indexing state: SUBSCRIBE_AND_CONSUME
+ Batch indexing state: INACTIVE
+ SEP subscription ID: Indexer_nocIndexer
+ SEP subscription timestamp: 2017-03-21T20:04:52.923+08:00
+ Connection type: solr
+ Connection params:
+ solr.zk = n1.cluster:2181,n2.cluster:2181,n3.cluster:2181/solr
+ solr.collection = noc
+ Indexer config:
403 bytes, use -dump to see content
+ Indexer component factory: com.ngdata.hbaseindexer.conf.DefaultIndexerComponentFactory
+ Additional batch index CLI arguments:
(none)
+ Default additional batch index CLI arguments:
(none)
+ Processes
+ 4 running processes
+ 0 failed processes

11.測試put數據查看結果
當寫入數據后,稍過幾秒我們可以在相對於的solr中查詢到該插入的數據,表明配置已經成功。

案列配置文檔地址:

  http://files.cnblogs.com/files/husky/solr_indexer%E9%85%8D%E7%BD%AE%E6%A0%B7%E4%BE%8B.tar.gz


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM