elasticsearch.bat flashback problem

In order to achieve cross-domain access, we need to modify the elasticsearch configuration file
insert image description here
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 insert image description here
insert image description here
and there will be a problem here, remember to change it to .\elasticsearch.bat
insert image description here
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:
insert image description here

Guess you like

Origin blog.csdn.net/sand_wich/article/details/105972511