1. 确保 http://localhost:9200 打开能看到 ES的版本信息
{ "name" : "ANDEQUAN-PC", "cluster_name" : "elasticsearch", "cluster_uuid" : "ckRycpKjRYm1jftaJUGH0Q", "version" : { "number" : "7.1.0", "build_flavor" : "default", "build_type" : "zip", "build_hash" : "606a173", "build_date" : "2019-05-16T00:43:15.323135Z", "build_snapshot" : false, "lucene_version" : "8.0.0", "minimum_wire_compatibility_version" : "6.8.0", "minimum_index_compatibility_version" : "6.0.0-beta1" }, "tagline" : "You Know, for Search" } 2.elasticsearch的elasticsearch.yml 配置文件中添加: http.cors.enabled: true http.cors.allow-origin: "*" 重新启动elasticsearch