一、下载
- 版本需要与ES版本对应,这里以6.2.2版本为例
https://readonlyrest.com/download/
- 按照收到的邮件提示下载
二、安装
/usr/share/elasticsearch/bin/elasticsearch-plugin install file:///root/readonlyrest-1.18.9_es6.2.2.zip
三、配置文件
- auth_key:用户名:密码
cat > /etc/elasticsearch/readonlyrest.yml <<EOF
readonlyrest:
enable: true
response_if_req_forbidden: Sorry, your request is forbidden.
access_control_rules:
- name: Full access with HTTP auth
auth_key: admin:123456
type: allow
EOF
修改完毕需要重启ES使插件生效