如果有Kibana的话,以下所有操作都可以在Kibana的DevTools页面进行调试,可以免去认证操作。

Kibana调试查看索引接口

接口 功能
/_cat/health?v 集群健康状态
/_cat/shards 分片信息
/_cat/nodes 节点信息
/_cat/indices 索引信息

?v 是详细信息输出

删除索引

1
curl -u elastic:xlFnyMMyZiqjkzLIV5Kd -s -XDELETE 192.168.13.127:9200/索引名字

索引名字可以通过查看索引接口查看

修改密码

1
curl -H "Content-Type:application/json" -XPOST -u elastic:xlFnyMMyZiqjkzLIV5Kd 'http://127.0.0.1:9200/_xpack/security/user/elastic/_password' -d '{ "password" : "123456" }'

添加角色

1
2
3
4
5
6
7
8
9
10
curl -XPOST -H 'Content-type: application/json' -u elastic:xlFnyMMyZiqjkzLIV5Kd 'http://10.163.19.231:9600/_xpack/security/role/admin?pretty' -d '{
"run_as":["elastic"],
"cluster":["all"],
"indices":[
{
"names":["*"],
"privileges":["all"]
}
]
}'

查看角色

1
curl -XGET -H 'Content-type: application/json' -u elastic:xlFnyMMyZiqjkzLIV5Kd 'http://10.163.19.231:9600/_xpack/security/role/admin?pretty'

允许自动创建索引

1
curl -XPUT -H "Content-Type:application/json" -u "admin:8zQq0F2ljEFlw2Rt" https://10.184.127.192:9200/_cluster/settings -d '{"persistent":{"action.auto_create_index":"true"}}' -k

查看设置

1
curl -XGET -u "admin:8zQq0F2ljEFlw2Rt" https://10.184.127.192:9200/_cluster/settings -k