部署elasticsearch7.9
由于Elasticsearch是java写的所以需要先安装jdk;
解压安装包启动bin下的elasticsearch.bat,访问http://localhost:9200/,显示如下界面说明已经安装成功
若不使用localhost,在elasticsearch\config\elasticsearch.yml文件末尾添加如下代码:
node.name: node-1
network.host: 192.168.10.77
cluster.initial_master_nodes: ["node-1"]
解决跨域访问问题,添加如下代码
xpack.ml.enabled: false
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-methods: OPTIONS, HEAD, GET, PUT, DELETE
http.cors.allow-headers: "X-Requested-With, Content-Type, Content-Length, X-User"
indices.fielddata.cache.size: 40%