Hbase Solr 二级索引,更新数据部分字段丢失问题

 

问题:

第一次往hbase put数据,索引同步三个字段,第二次更新hbase数据,只更新一个字段,其他两个字段会消失。

 

原因:

在创建Hbase Indexer 时我们配置文件指定了  read-row="never" 

 

$ cat morphline-hbase-mapper.xml 
<?xml version="1.0"?>
<!-- table:需要索引的HBase表名称-->
<!-- mapper:用来实现和读取指定的Morphline配置文件类,固定为MorphlineResultToSolrMapper-->
<indexer table="tableName" mapper="com.ngdata.hbaseindexer.morphline.MorphlineResultToSolrMapper" read-row="never" >
<!--param中的name参数用来指定当前配置为morphlineFile文件 -->
<!--value用来指定morphlines.conf文件的路径,绝对或者相对路径用来指定本地路径,如果是使用Cloudera Manager来管理morphlines.conf就直接写入值morphlines.conf"--><param name="morphlineFile" value="morphlines.conf"/>
<!--value="ZDTableMap",这里test3Map是自定义,接下来要使用。其他的mapper,param name等属性默认即可--><param name="morphlineId" value="TableMap"/>
</indexer>

 

修改为 read-row="dynamic"  ,再次测试,发现不会丢失字段

 

read-row 说明:https://github.com/NGDATA/hbase-indexer/wiki/Indexer-configuration#read-row

read-row

The read-row attribute has two possible values: dynamic, or never.

This attribute is only important when using row-based indexing. It specifies whether or not the indexer should re-read data from HBase in order to perform indexing.

When set to "dynamic", the indexer will read the necessary data from a row if a partial update to the row is performed in HBase. In dynamic mode, the row will not be re-read if all data needed to perform indexing is included in the row update.

If this attribute is set to never, a row will never be re-read by the indexer.

The default setting is "dynamic".

 

 

 但可能会遇到以下问题,使用前需要充分的测试

 

HBase Indexer导致Solr与HBase数据不一致问题解决:

https://blog.csdn.net/d6619309/article/details/51579594

 

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/509832.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

c#事件和委托

一、委托(Delegate) 1、定义 delegate是C#中的一种类型&#xff0c;它实际上是一个能够持有对某个方法的引用的类。与其它的类不同&#xff0c;delegate类能够 拥有一个签名&#xff08;signature&#xff09;&#xff0c;并且它"只能持有与它的签名相匹配的方法的引用&qu…

Hbase二级索引 Solr 异常 The most likely cause is another Solr server (or another solr core in this server)

solr查询数据时候报错&#xff0c;去服务器查看该节点日志 {"responseHeader":{"status":503,"QTime":3,"params":{"q":"*:*","_":"1576753724528"}},"error":{"metadata&q…

MonoBehaviour常用方法

1.Start()在Update方法被调用之前开始调用Start方法&#xff0c;而且Start方法在整个MonoBehaviour生命周期内只被调用一次。Awake和Start不同的地方在于Start方法仅仅在脚本初始化后被调用&#xff0c;这样允许你延迟加载任何代码&#xff0c;直到代码真正被使用时。Awake方法…

Hbase RegionServer 启动失败 Time difference of xxx ms max allowed of 30000ms

Hbase RegionServer 启动报错 异常如下&#xff1a; STOPPED: Unhandled: org.apache.hadoop.hbase.ClockOutOfSyncException: Server hostname13,16020,1576647671625 has been rejected; Reported time is too far out of sync with master. Time difference of 32345ms …

unity3d UGUI视频教程

http://forum.china.unity3d.com/home.php?modspace&uid3418&dothread&viewme&typethread&orderdateline&fromspace&page1

CDH6.x Solr7.x 集成 Ik 分词

下载ik相关jar包&#xff1a; 链接&#xff1a;https://pan.baidu.com/s/19fydKWw15g8rPg4LW1cOtw 提取码&#xff1a;f2l8 在CDH安装目录下 查找CDH6 solr 的启动目录 [roothostname1 ~]# find /opt -name WEB-INF |grep solr /opt/cloudera/parcels/CDH-6.0.0-1.cdh6.0.0.p…

java Switch里面的类型问题

switch中可以为以下几种类型&#xff1a; byte、short、int注意没有longchar、string(jdk 1.7版本之后的 )枚举类型 Java 7之前&#xff0c;switch后面的括号里面只能放int类型的值&#xff0c;注意是只能放int类型&#xff0c;但是放byte&#xff0c;short&#xff0c;char类…

Unity3d常用插件

1,UI插件 - NGUI 3.9.2http://pan.baidu.com/s/1o6kst662,地图编辑器 - Tiled Map Editorhttp://www.mapeditor.org/download.html3,A*寻路插件 - A* Pathfinding Project Pro 3.7 最新版http://pan.baidu.com/s/1nty759n4,可视化脚本工具 - Playmaker 1.7.8 最新版http://pan.…

Solr 基础性能调优讲解

本篇文章我们来了解一下solr的性能方面的调优&#xff0c;分为Schema优化、索引更新与提交调优、索引合并性能调优、Solr缓存、Solr查询性能优化 Schema优化 1、indextrue比indexfalse在索引时占用更多的内存、索引合并和优化时间更长&#xff0c;索引体积也响应变的更大&…

C语言有参函数调用时参数值传递问题

http://blog.csdn.net/hehuimin6/article/details/38800459

Solr router 路由介绍

目录 1、compositeId路由 1.1、compositeId路由原理 1.2、compositeId路由查询 2、implicit路由 2.1、implicit路由原理 2.2、implicit路由查询 3、扩展 3.1、compositeId路由方式扩展 3.2、implicit路由方式扩张 solrcloud的官方文档有对路由的简短介绍&#xff0c;但…

行为树的原理及实现

查阅了一些行为树资料&#xff0c;目前最主要是参考了这篇文章&#xff0c;看完后感觉行为树实乃强大&#xff0c;绝对是替代状态机的不二之选。但从理论看起来很简单的行为树&#xff0c;真正着手起来却发现很多细节无从下手。 总结起来&#xff0c;就是&#xff1a; 1、行为树…

Unity 3D中的射线与碰撞检测

在我们的游戏开发过程中&#xff0c;有一个很重要的工作就是进行碰撞检测。例如在射击游戏中子弹是否击中敌人&#xff0c;在RPG游戏中是否捡到装备等等。在进行碰撞检测时&#xff0c;我们最常用的工具就是射线&#xff0c;Unity 3D的物理引擎也为我们提供了射线类以及相关的函…

图数据库 HugeGraph : IndexLabel

IndexLabel 用来定义索引类型&#xff0c;描述索引的约束信息&#xff0c;主要是为了方便查询。 IndexLabel 允许定义的约束信息包括&#xff1a;name、baseType、baseValue、indexFeilds、indexType&#xff0c;下面逐一介绍。 name: 属性的名字&#xff0c;用来区分不同的 …

boost常用库

1.boost::any boost::any是一种通用的数据类型&#xff0c;可以将各种类型包装后统一放入容器内&#xff0c;最重要的它是类型安全的。有点象COM里面的variant。 使用方法&#xff1a; any::type() 返回包装的类型 any_cast可用于any到其他类型的转化 #include <boost/any.h…

HugeGraphServer 部署安装

官方文档链接&#xff1a;https://hugegraph.github.io/hugegraph-doc HugeGraphServer Quick Start 1 概述 HugeGraph-Server 是 HugeGraph 项目的核心部分&#xff0c;包含Core、Backend、API等子模块。 Core模块是Tinkerpop接口的实现&#xff0c;Backend模块用于管理数…

java中调用System.currentTimeMillis()获取当前时间来求出时间差及程序执行的时间

package com.test;import java.util.Scanner; //String的连接1000次 class StringOperate{private String str;public long doWork(){long beginSystem.currentTimeMillis();//开始时间setStr(null);for(int i0;i<10000;i){setStr(getStr() i);}long endSystem.currentTime…

HugeGraph 多图配置

多图配置 我们的系统是可以存在多个图的&#xff0c;并且各个图的后端可以不一样&#xff0c;比如图 hugegraph 和 hugegraph1&#xff0c;其中 hugegraph 以 cassandra 作为后端&#xff0c;hugegraph1 以 rocksdb作为后端。 配置方法也很简单&#xff1a; 修改 gremlin-se…

JanusGraph: 可视化 Gephi 插件安装

下载地址 https://gephi.org/ 安装 下一步默认安装即可 打开安装插件 打开后发现提示无法连接&#xff0c;并且可用插件显示为0 &#xff08;我更新过所以不为0&#xff09; 点击“代理配置” 设置代理 安装插件 Graph Streaming 继续 重新启动&#xff0c;安装完成 点击概…