Hbase-indexer common commands

1. Start the hbase-indexer service

nohup ./hbase-indexer server -z s1:2181,s2:2181,s3:2181,s4:2181,s5:2181 > /work/hbase-indexer.log &
  • Parameter Description
    1. -z link information of zooKeeper to be used by hbase-indexer
    2. /work/hbase-indexer.log output log file path

2. Add index

./hbase-indexer add-indexer -n indexer_vip -c /opt/lucidworks-hdpsearch/hbase-indexer/demo/vip_indexer_mapper.xml -cp solr.zk=s1:2181,s2:2181,s3:2181,s4:2181,s5:2181/solr -cp solr.collection=collection_vip
  • Parameter Description
    1. -indexer action command
    2. -n index name parameter to create, indexer_vip index name
    3. -c index map file path
    4. solr.zk zooKeeper link information
    5. solr.collection index mapping collection information, collection_vip collection name
    • Mapping file example
    <xml version="1.0" encoding="UTF-8"?>
    <!--
    /*
    * Copyright 2013 NGDATA nv
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    *     http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
    -->
    <indexer table="BizvaneV2.Vip" mapper="com.ngdata.hbaseindexer.morphline.MorphlineResultToSolrMapper">
        <field name="firstname" value="info:firstname"/>
        <field name="age" value="info:age" type="int"/>
    </indexer>

3. Delete the index

./hbase-indexer delete-indexer --name 'indexer_vip'
  • Parameter Description
    1. delete-indexer action command
    2. indexer_vip The name of the index to be dropped

4. View all index lists

./hbase-indexer list-indexers -dump
  • Parameter Description
    1. list-indexers action command
    2. -dump Add this parameter to display the configuration details of the index

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325037790&siteId=291194637