使用netstat -lntp来看看有侦听在网络某端口的进程。当然,也可以使用 lsof。

如何显示别名的别名

Elasticsearch | 作者 hnj1575565068 | 发布于2019年05月14日 | 阅读数:2878

真实索引c1, c2, c3....,global pattern建立索引别名c* 到b,然后又给b建立了别名a ,查看a的别名信息,会吧c1,c2等全部带出来,有什么办法只显示b吗?
已邀请:

mushao999 - 微信公众号:Elastic慕容

赞同来自:

我这边分别使用5.6.4和6.5.1的集群使用下面命令进行验证
PUT c1
PUT c2
PUT c3
PUT c4

POST /_aliases
{
"actions": [
{"add": {"index": "c1", "alias": "b" }},
{"add": {"index": "c2", "alias": "b" }},
{"add": {"index": "c3", "alias": "b" }}
]
}

POST /_aliases
{
"actions": [
{"add": {"index": "b", "alias": "a"}}
]
}

GET _alias/a
GET _alias/b

POST /_aliases
{
"actions": [
{"add": {"index": "c4", "alias": "b"}}
]
}

GET _alias/a
GET _alias/b

POST /_aliases
{
"actions": [
{ "remove": {"index": "c1", "alias": "b"}}
]
}

GET _alias/a
GET _alias/b

DELETE c1
DELETE c2
DELETE c3
DELETE c4
在5.6.4中发现别名a不会随着别名b的索引指向改变而改变,说明创建别名a的过程实际是解析别名b并将别名a直接指向了别名b指向的索引,之后别名a和别名b不再有任何关系,因此也就无法通过别名a找到别名b。
 
在6.5.1中发现不能通过创建别名Api通过一个别名创建另一个别名,错误信息如下:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "The provided expression [b] matches an alias, specify the corresponding concrete indices instead."
}
],
"type": "illegal_argument_exception",
"reason": "The provided expression [b] matches an alias, specify the corresponding concrete indices instead."
},
"status": 400
}
说明在高版本的ES中不再支持通过别名创建别名

要回复问题请先登录注册