Hbase-indexer常用命令

1. 启动hbase-indexer服务

nohup ./hbase-indexer server -z s1:2181,s2:2181,s3:2181,s4:2181,s5:2181 > /work/hbase-indexer.log &
  • 参数说明
    1. -z hbase-indexer要用到的zooKeeper的链接信息
    2. /work/hbase-indexer.log 输出日志文件路径

2. 添加索引

./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
  • 参数说明
    1. -indexer 动作命令
    2. -n 要创建的索引名称参数,indexer_vip 索引名称
    3. -c 索引映射文件路径
    4. solr.zk zooKeeper 链接信息
    5. solr.collection 索引映射的集合信息,collection_vip 集合名称
    • 映射文件示例
    复制代码
    <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. 删除索引

./hbase-indexer delete-indexer --name 'indexer_vip'
  • 参数说明
    1. delete-indexer 动作命令
    2. indexer_vip 要被删除的索引名称

4. 查看所有索引清单

./hbase-indexer list-indexers -dump
  • 参数说明
    1. list-indexers 动作命令
    2. -dump 添加此参数可以显示索引的配置详情
posted @   架构师聊技术  阅读(3315)  评论(0编辑  收藏  举报
编辑推荐:
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
· 使用C#创建一个MCP客户端
点击右上角即可分享
微信分享提示