_update API 執行報錯
錯誤信息:
{ "error": { "root_cause": [ { "type": "remote_transport_exception", "reason": "[node-84-106][200.200.84.106:9300][indices:data/write/update[s]]" } ], "type": "illegal_argument_exception", "reason": "failed to execute script", "caused_by": { "type": "script_exception", "reason": "scripts of type [inline], operation [update] and lang [groovy] are disabled" } }, "status": 400 }
解決方法:
//sudo vim /etc/elasticsearch/elasticsearch.yml //添加: script.groovy.sandbox.enabled: true //務必注意配置不要頂格寫,要空一格,否則 ES 無法啟動 script.inline: on //務必注意配置不要頂格寫,要空一格,否則 ES 無法啟動 script.indexed: on //務必注意配置不要頂格寫,要空一格,否則 ES 無法啟動 script.engine.groovy.inline.update: on //務必注意配置不要頂格寫,要空一格,否則 ES 無法啟動