In order to achieve cross-domain access, we need to modify the elasticsearch configuration file
to add cross-domain access here:
http.cors.enabled: true
http.cors.allow‐origin: "*"
It may be because we are using notepad++, and it is not modified and saved in UTF-8 encoding, which caused the .bat file to crash. I used vscode later. Here, in order to confirm that it is indeed an encoding problem, we can first enter the powershell window
and there will be a problem here, remember to change it to .\elasticsearch.bat
log:
java.lang.IllegalArgumentException: unknown setting [http.cors.allow�\origin] did you mean [http.cors.allow-origin]?
The description is indeed an encoding problem, so no matter how to solve it
Finally successfully connected: