开启x-pack验证
vi /opt/elasticsearch-7.6.2/config/elasticsearch.yml
## 底部增加开启认证
xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true
## 重启es
设置用户名和密码
## 创建keystore文件
./bin/elasticsearch-keystore create
## 交互式设置密码,指定Master节点的URL
./bin/elasticsearch-setup-passwords interactive -u 'http://212.64.29.192:9200'
Postman测试
修改认证密码
http://IP:9200/_xpack/security/user/elastic/_password
{
"password": "es123456"
}