(1)进入ElasticSearch安装目录,在config/elasticsearch.yml文件添加以下配置开启安全校验:
xpack.security.enabled: true
(2)进入ElasticSearch安装目录,执行以下命令设置elastic用户的密码:
./bin/elasticsearch-setup-passwords interactive ###自己指定密码
或
./bin/elasticsearch-setup-passwords auto ###自动生成密码
(3)其他安全配置可参考https://www.elastic.co/guide/en/elasticsearch/reference/current/secure-cluster.html