elasticsearch-keystore 命令解释
命令⽤途
ES的⼤部分配置参数是通过明⽂存储在配置⽂件中,⼀般通过⽂件系统的所属⽤户、所属组和读写权限(rwx机制)提供基本的保护。但是有⼀些⽐较敏感的ES配置参数仅仅通过⽂件系统的权限保护是不够的,ES推出了keystore来做进⼀步的加密保护。
命令⽤法
新建
⾼版本ES可以通过 -p 选项指定keystore存储的加密密码
# keystore的存储⽂件放在elasticsearch.yml的同级⽬录# 如:/elasticsearch-7.2.0/config/elasticsearch.keystore./elasticsearch-keystore create
添加配置参数
./elasticsearch-keystore add s3.client.default.secret_key
删除配置参数
./elasticsearch-keystore remove s3.client.default.secret_key
列出配置参数
./elasticsearch-keystore list
哪些参数可以添加到keystore
Elasticseach官⽅⽂档中,如果某个参数配置说明添加了 字样备注,就可以⽤elasticsearch-keystore add 添加到keystore中,如:
s3.client.default.secret_key(Secure,reloadable)
如何使keystore中的参数⽣效
重启Elasticsearch
对于可以reloadable的参数使⽤reload API: POST _nodes/reload_secure_settings
注意事项
使⽤keystore添加参数时,keystore没对添加的参数做校验,对于不合法的(没有被某个plugin或者es本⾝⽤到的参数)会导致Elasticsearch启动失败。
因篇幅问题不能全部显示,请点此查看更多更全内容