在elasticsearch.yml文件中加上 http.cors.enabled: true http.cors.allow-origin: "*" 在yml语法中 :后面必须有空格,否则语法失效,会导致启动失败