1. download the plugin of elasticsearch:
下载 readonlyrest-1.14.0_es5.2.2.zip
2. install readonlyrest plugin:
C:\Users\Administrator\Downloads\elasticsearch-5.2.2\bin\elasticsearch-plugin.bat install file:///d:/readonlyrest-1.14.0_es5.2.2.zip
3. open elasticsearch.yml add blow code:
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 #user: admin, password:123456 type: allow
4. restart elasticsearch service.
5. done;
时间: 2024-10-01 02:11:21