我对elasticsearch和couchbase都是新手。我在我的项目中使用这两种方法。我的要求是使用couchbase xdcr将couchbase bucket与elasticsearch索引同步。
在couchbase中,bucket名称“employee”和该文档的结构是
{
"empName":"Stev Jobs",
"dept":"IT",
"company":"xxxx",
"salary":"30000",
"country":"USA"
}
我在elasticsearch中创建了索引employee,还使用elasticsearch cluster在couchbase中创建了集群引用。设置完所有这些之后,我开始在couchbase的employee bucket和elasticsearch的employee index之间进行复制。它在elasticsearch中创建了索引,但是这个索引包含的不仅仅是couchbase bucket文档。我的couchbase bucket雇员有182条记录,但在elasticsearch雇员索引中显示文档1025。在couchbase中同步时会显示一些错误
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中,我的员工索引文档结构如下
{
"_index": "employee",
"_type": "couchbaseCheckpoint",
"_id": "vbucket921UUID",
"_score": 1,
"_source": {
"doc": {
"uuid": "ec88aeb16c00427698f079d8a3fa7097"
}
}
}
我编写搜索查询,比如,我在http://127.0.0.1:9200/\u插件/头/
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条答案
按热度按时间unftdfkk1#
插件使用couchbasecheckpoint文档保存每个vbucket的状态,以便它能够正确地模拟xdcr协议。这就是为什么有1025个——1024个vbuckets加上一个全局状态文件。
事实上,您在elasticsearch中拥有1025个文档,这意味着您只获得了state文档,而没有任何实际文档得到复制。您是否如安装指南中所述在elasticsearch中设置了Map?这看起来像是索引的问题,因此elasticsearch日志实际上会有一些有意义的错误,这些错误会告诉您为什么它不能索引任何文档。couchbase日志只告诉你它不能复制一些东西