0

I downloaded the last version of Elasticsearch and followed the guide provided by them in https://www.elastic.co/guide/en/elasticsearch/reference/current/zip-windows.html

But in the section "Check that Ealsticsearch is running" it says that you can test it typing this command line in the terminal:

curl --cacert %ES_HOME%\config\certs\http_ca.crt -u elastic https://localhost:9200 

When i do this the terminal doesnt recognize the "-u" parameter and it gives me back an error

Everything until this point was working just fine and i cant find out what and why this is happening. I appreciate every kind of help! thanks

  • Have you tried removing -u and replacing the url with `https://elastic:changeme@localhost:9200`? – Smallw00d Jul 20 '23 at 14:54
  • No, the command line will the be same but without the -u? – Diogo Miranda Jul 20 '23 at 14:55
  • Yes, please look into the url that is changed. Basically username and password is embeded into url (example: `curl "http://username:password@elasticsearch:9200/_cluster/health?pretty"`) Otherwise, please check my answer and see if the problem is related or not. – Smallw00d Jul 20 '23 at 15:02
  • First things first, the linked page states, "Unzip it with your favorite unzip tool. This will create a folder called elasticsearch-8.8.2, which we will refer to as %ES_HOME%" It has no idea what your favorite unzip tool is, where it will unzip to, or what the resulting directory name and structure will be. Fortha reason it is using `%ES_HOME%` as a placeholder, it does not say that there will automagically be a permanent environment variable named `ES_HOME` created during the unarchiving process of your favorite tool. – Compo Jul 20 '23 at 17:49
  • So please replace `%ES_HOME%` with your actual location, (or manually define that location as a User Evironment variable named `ES_HOME` in the GUI, if you want to use it as a variable, and before opening a Command Prompt, `cmd.exe` window). When you open that window, do not use `cd`, use `cd /d` instead, and doublequote the path, (or variable name). – Compo Jul 20 '23 at 17:57

1 Answers1

0

I think you can fix it by the following command:

Remove-item alias:curl

Then try curl again. Here is the reference to the answer: Running cURL on 64 bit Windows

Smallw00d
  • 151
  • 1
  • 4
  • Where was PowerShell mentioned in the question or its tags? – Compo Jul 20 '23 at 18:01
  • I assumed it because of `%ES_HOME%` environment variable + getting the similar error on my platform. Was I wrong about it? @Compo – Smallw00d Jul 20 '23 at 18:02
  • I have no idea if your assumption is wrong, just currently an over ambitious guess. The OP used the term "terminal" however but did not explain to us what they meant by that. If the 'terminal' was supposed to be PowerShell I'd have hoped the linked page would have not used the aliases `cd` or `curl` rather than `sl` and `iwr`. I will say however that the designation `%ES_HOME%` would be a Windows environment variable, and has nothing whatsoever to do with PowerShell. – Compo Jul 20 '23 at 18:16
  • Wow, i'm not that pro mate, thanks for the description. But i just tried it on my computer and had the same issue and then wanted to help. I'll delete my answer if it does not bring any help. – Smallw00d Jul 20 '23 at 18:23