我们在数据库中有多个具有相同记录结构的组织。我们正在为每个组织使用具有别名索引和路由功能的ES。现在,当我们清除ES索引并以干净状态开始时,搜索记录正在从ES中正确进行。但是当我们添加多个组织时,ES表现得很奇怪。有时它会发送另一个组织的数据,有时它只会抑制数据。更令人担忧的是,有时它甚至会发送甚至没有搜索过的记录数据! "约翰"它正在重新调整" Ringo",通过" Mick"返回"约翰"。
进一步调查:
图片:
ES服务器的状态:
{
"_shards" : {
"total" : 10,
"successful" : 5,
"failed" : 0
},
"indices" : {
"organizations" : {
"index" : {
"primary_size_in_bytes" : 54928,
"size_in_bytes" : 54928
},
"translog" : {
"operations" : 106
},
"docs" : {
"num_docs" : 50,
"max_doc" : 73,
"deleted_docs" : 23
},
"merges" : {
"current" : 0,
"current_docs" : 0,
"current_size_in_bytes" : 0,
"total" : 0,
"total_time_in_millis" : 0,
"total_docs" : 0,
"total_size_in_bytes" : 0
},
"refresh" : {
"total" : 125,
"total_time_in_millis" : 204
},
"flush" : {
"total" : 0,
"total_time_in_millis" : 0
},
"shards" : {
"0" : [ {
"routing" : {
"state" : "STARTED",
"primary" : true,
"node" : "ficq9zDSRM2HJTGLk2BZ7g",
"relocating_node" : null,
"shard" : 0,
"index" : "organizations"
},
"state" : "STARTED",
"index" : {
"size_in_bytes" : 15923
},
"translog" : {
"id" : 1432033150513,
"operations" : 42
},
"docs" : {
"num_docs" : 21,
"max_doc" : 21,
"deleted_docs" : 0
},
"merges" : {
"current" : 0,
"current_docs" : 0,
"current_size_in_bytes" : 0,
"total" : 0,
"total_time_in_millis" : 0,
"total_docs" : 0,
"total_size_in_bytes" : 0
},
"refresh" : {
"total" : 25,
"total_time_in_millis" : 114
},
"flush" : {
"total" : 0,
"total_time_in_millis" : 0
}
} ],
"1" : [ {
"routing" : {
"state" : "STARTED",
"primary" : true,
"node" : "ficq9zDSRM2HJTGLk2BZ7g",
"relocating_node" : null,
"shard" : 1,
"index" : "organizations"
},
"state" : "STARTED",
"index" : {
"size_in_bytes" : 123
},
"translog" : {
"id" : 1432033150524,
"operations" : 0
},
"docs" : {
"num_docs" : 0,
"max_doc" : 0,
"deleted_docs" : 0
},
"merges" : {
"current" : 0,
"current_docs" : 0,
"current_size_in_bytes" : 0,
"total" : 0,
"total_time_in_millis" : 0,
"total_docs" : 0,
"total_size_in_bytes" : 0
},
"refresh" : {
"total" : 25,
"total_time_in_millis" : 1
},
"flush" : {
"total" : 0,
"total_time_in_millis" : 0
}
} ],
"2" : [ {
"routing" : {
"state" : "STARTED",
"primary" : true,
"node" : "ficq9zDSRM2HJTGLk2BZ7g",
"relocating_node" : null,
"shard" : 2,
"index" : "organizations"
},
"state" : "STARTED",
"index" : {
"size_in_bytes" : 4782
},
"translog" : {
"id" : 1432033150529,
"operations" : 8
},
"docs" : {
"num_docs" : 8,
"max_doc" : 8,
"deleted_docs" : 0
},
"merges" : {
"current" : 0,
"current_docs" : 0,
"current_size_in_bytes" : 0,
"total" : 0,
"total_time_in_millis" : 0,
"total_docs" : 0,
"total_size_in_bytes" : 0
},
"refresh" : {
"total" : 25,
"total_time_in_millis" : 11
},
"flush" : {
"total" : 0,
"total_time_in_millis" : 0
}
} ],
"3" : [ {
"routing" : {
"state" : "STARTED",
"primary" : true,
"node" : "ficq9zDSRM2HJTGLk2BZ7g",
"relocating_node" : null,
"shard" : 3,
"index" : "organizations"
},
"state" : "STARTED",
"index" : {
"size_in_bytes" : 123
},
"translog" : {
"id" : 1432033150518,
"operations" : 0
},
"docs" : {
"num_docs" : 0,
"max_doc" : 0,
"deleted_docs" : 0
},
"merges" : {
"current" : 0,
"current_docs" : 0,
"current_size_in_bytes" : 0,
"total" : 0,
"total_time_in_millis" : 0,
"total_docs" : 0,
"total_size_in_bytes" : 0
},
"refresh" : {
"total" : 25,
"total_time_in_millis" : 0
},
"flush" : {
"total" : 0,
"total_time_in_millis" : 0
}
} ],
"4" : [ {
"routing" : {
"state" : "STARTED",
"primary" : true,
"node" : "ficq9zDSRM2HJTGLk2BZ7g",
"relocating_node" : null,
"shard" : 4,
"index" : "organizations"
},
"state" : "STARTED",
"index" : {
"size_in_bytes" : 33977
},
"translog" : {
"id" : 1432033150546,
"operations" : 56
},
"docs" : {
"num_docs" : 21,
"max_doc" : 44,
"deleted_docs" : 23
},
"merges" : {
"current" : 0,
"current_docs" : 0,
"current_size_in_bytes" : 0,
"total" : 0,
"total_time_in_millis" : 0,
"total_docs" : 0,
"total_size_in_bytes" : 0
},
"refresh" : {
"total" : 25,
"total_time_in_millis" : 78
},
"flush" : {
"total" : 0,
"total_time_in_millis" : 0
}
} ]
}
}
}
}
在另一个组织中,似乎ES正在覆盖现有别名的数据。被索引。但这是违规行为。 请咨询。