我在翻转特定别名时遇到了一个奇怪的问题。错误:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "index name [twitter] does not match pattern '^.*-\\d+$'"
}
],
"type": "illegal_argument_exception",
"reason": "index name [twitter] does not match pattern '^.*-\\d+$'"
},
"status": 400
}
我有一个模板如下:
{
"template": "twitter-*",
"settings": {
"number_of_shards": 3
},
"mappings" : {
"user" : {
"properties" : {
"name" : { "type" : "text" },
"id" : { "type" : "text" }
}
}
}
}
和别名列表
GET /_aliases
{ "twitter": { "aliases": {} }, ".kibana": { "aliases": {} }, "twitter-2019.06.09-1": { "aliases": { "twitter-alias": {} } }, "twitter123": { "aliases": {} } }
我通过 takng 快照和恢复过程从 twitter 索引创建了 twitter-2019.06.09-1。
每当我尝试手动跟踪翻转(我是由策展人设置的)时,我都会遇到上述错误。
#Running manual rollover
POST /twitter-alias/_rollover/
{
"conditions": {
"max_age": "7d",
"max_docs": 1
}
}
twitter-2019.06.09-1 有以下 3 条记录:
GET twitter-2019.06.09-1/user/_search?size=0
{
"took": 44,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 3,
"max_score": 0,
"hits": [ ]
}
}
我曾尝试删除 twitter 索引,因为它没有用,但翻转 api 发生了同样的错误。
请帮忙。
更新:
阅读以下帖子后: https ://discuss.elastic.co/t/rollover-failing/153676/5
我更新了模板和索引别名列表,如下所示:
#Creating template for new index creation
PUT _template/template_1
{
"template": "twitter-*",
"settings": {
"number_of_shards": 3
},
"mappings" : {
"user" : {
"properties" : {
"name" : { "type" : "text" },
"id" : { "type" : "text" }
}
}
},
"aliases":
{
"search-all":{}
}
}
和索引:
GET twitter-2019.06.09-1
{
"twitter-2019.06.09-1": {
"aliases": {
"search-all": {},
"twitter-alias": {}
},
"mappings": {
"user": {
"properties": {
"id": {
"type": "text"
},
"name": {
"type": "text"
}
}
}
},
"settings": {
"index": {
"creation_date": "1559904447882",
"number_of_shards": "1",
"number_of_replicas": "1",
"uuid": "DnUZcHiyQIi2ab8XVKKVuA",
"version": {
"created": "5060099"
},
"provided_name": "twitter"
}
}
}
}
问题仍然退出。
我注意到
“provided_name”:“推特”
在检查索引信息时。
它与发布的上述错误有关吗?它不应该是推特。它是一个错误吗?
我的重命名索引策略是:
#Taking snapshot
PUT /_snapshot/eaa-backup/twitter_snapshot
{
"indices": "twitter",
"ignore_unavailable": true,
"include_global_state": false
}
并恢复:
#Now restore with new name
POST /_snapshot/eaa-backup/twitter_snapshot/_restore
{
"indices": "twitter",
"ignore_unavailable": "true",
"include_global_state": false,
"rename_pattern": "twitter",
"rename_replacement": "twitter-2019.06.09-1"
}
请帮助找出上述错误的原因。此外,我在弹性讨论中发布了相同的问题,但似乎需要几天时间才能在那里找到帮助。所以,在这里发帖。提前致谢。