首页 文章

默认情况下,为elasticsearch与couchbase同步的文档创建了couchbaseCheckPoint类型

提问于
浏览
2

我是elasticsearch和couchbase的新手 . 我在我的项目中使用这两个 . 我的要求是使用couchbase XDCR将couchbase存储桶与elasticsearch索引同步 .

在couchbase中,Bucket名称为“Employee”,该文件的结构为

{
"empName":"Stev Jobs",
"dept":"IT",
"company":"xxxx",
"salary":"30000",
"country":"USA"
}

我在elasticsearch中创建了 employee 的索引,并且还在带有elasticsearch集群的couchbase中创建了集群引用 . 设置完所有这些之后,我开始在 employee bucket of couchbase和 employee elasticsearch的索引之间进行复制 . 它在elasticsearch中创建了索引,但是这个索引包含的不仅仅是couchbase bucket文档 . 我的couchbase bucket员工有182条记录,但在elasticsearch员工索引中显示文档1025.而在couchbase中,同步时显示一些错误s . 这个错误如下所示

2015-05-22 09:07:44 [Vb Rep] Error replicating vbucket 98. Please see logs for details.
2015-05-22 09:07:44 [Vb Rep] Error replicating vbucket 697. Please see logs for details.

在elasticsearch中我的 employee 索引文档结构如

{

    "_index": "employee",
    "_type": "couchbaseCheckpoint",
    "_id": "vbucket921UUID",
    "_score": 1,
    "_source": {
        "doc": {
            "uuid": "ec88aeb16c00427698f079d8a3fa7097"
        }
    }

}

我写搜索查询,我在http://127.0.0.1:9200/_plugin/head/运行此查询

http://127.0.0.1:9200/employee/_search/

    { 
      "query": {
             "match":{
                    "query":"ec88aeb16c00427698f079d8a3fa7097",
                     "fields":["uuid"]
              }
        }
    }

它给出了错误

{

    "error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[J2CjiG2vQqqrG2h5jlsudg][couchrecords][0]: SearchParseException[[couchrecords][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"match":{"query":"ec88aeb16c00427698f079d8a3fa7097","fields":["uuid"]}}}]]]; nested: QueryParsingException[[couchrecords] [match] query parsed in simplified form, with direct field name, but included more options than just the field name, possibly use its 'options' form, with 'query' element?]; }{[J2CjiG2vQqqrG2h5jlsudg][couchrecords][1]: SearchParseException[[couchrecords][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"match":{"query":"ec88aeb16c00427698f079d8a3fa7097","fields":["uuid"]}}}]]]; nested: QueryParsingException[[couchrecords] [match] query parsed in simplified form, with direct field name, but included more options than just the field name, possibly use its 'options' form, with 'query' element?]; }{[J2CjiG2vQqqrG2h5jlsudg][couchrecords][2]: SearchParseException[[couchrecords][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"match":{"query":"ec88aeb16c00427698f079d8a3fa7097","fields":["uuid"]}}}]]]; nested: QueryParsingException[[couchrecords] [match] query parsed in simplified form, with direct field name, but included more options than just the field name, possibly use its 'options' form, with 'query' element?]; }{[J2CjiG2vQqqrG2h5jlsudg][couchrecords][3]: SearchParseException[[couchrecords][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"match":{"query":"ec88aeb16c00427698f079d8a3fa7097","fields":["uuid"]}}}]]]; nested: QueryParsingException[[couchrecords] [match] query parsed in simplified form, with direct field name, but included more options than just the field name, possibly use its 'options' form, with 'query' element?]; }{[J2CjiG2vQqqrG2h5jlsudg][couchrecords][4]: SearchParseException[[couchrecords][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"match":{"query":"ec88aeb16c00427698f079d8a3fa7097","fields":["uuid"]}}}]]]; nested: QueryParsingException[[couchrecords] [match] query parsed in simplified form, with direct field name, but included more options than just the field name, possibly use its 'options' form, with 'query' element?]; }]",
    "status": 400

}

1 回答

  • 2

    插件使用couchbaseCheckpoint文档来保存每个vBucket的状态,以便它可以正确模拟XDCR协议 . 这就是为什么有1025个 - 1024个vBuckets加上一个全局状态文档 .

    您在ElasticSearch中拥有1025个文档这一事实意味着您只获得了州文档,并且没有任何实际文档被复制 . 您是否在ElasticSearch中设置了如安装指南中所述的映射?这看起来像索引的问题,因此ElasticSearch日志实际上会有有意义的错误,它会告诉您为什么它不能索引任何文档 . Couchbase日志只告诉您它无法复制某些内容

相关问题