DEV Community

Running Elasticsearch and Kibana v7+ (macOS/Linux and Windows)

Lisa Jung on November 23, 2020

Heads up! If you are looking to run Elasticsearch and Kibana v8+ locally, the process will be different from the one shown in this blog. Check out ...
Collapse
 
itshamzaoffical profile image
Hamza Shabbir

For Version 8.5
Run elasticsearch-setup-passwords auto bofre running curl -k -u elastic localhost:9200 to get your passwords.

Collapse
 
hackvan profile image
Diego Camacho

Great post, very useful for the first steps.

BTW I love the "tagline" : "You Know, for Search" from the Elastic properties ;-)

Collapse
 
lisahjung profile image
Lisa Jung

Thank you so much Diego!! I love the tagline as well! :)

Collapse
 
abdovenom profile image
venom • Edited

1-i have this message:
Image description
2-when i write this command :
curl localhost:9200
3-and this when i run the kibana
Image description
@lisahjung

Collapse
 
informramc profile image
informramc

The Kibana download link (Under "For macOS and Linux") is pointing to Elastic Search download page. Please correct it

Collapse
 
lisahjung profile image
Lisa Jung

Hi @informramc! Thank you so much for catching that. Just made the edit. I appreciate ya! :)

Collapse
 
hajara profile image
Hajara Iyal

Hi Lisa, great post breaking everything down.

I'm having trouble after running the 'curl localhost:9200' command.

I get a response saying 'curl: (52) Empty reply from server'. I'm not sure why, I tried googling but didn't have much luck. I already ran CTRL F in my terminal tab to make sure that the 'bin/elasticsearch' command worked, and it did.

Any clue what I could try?

Collapse
 
lisahjung profile image
Lisa Jung

Hey @hajara!

Thank you so much for the wonderful comment and for reaching out.
This blog has some outdated information that I need to update!

This blog was created for version 7 of Elasticsearch.

"curl: (52) Empty reply from server" is a common error message you would encounter when you follow these directions with version 8+ of Elasticsearch.

With version 8, security is on by default. Therefore, the procedure for connecting to Elasticsearch has changed!

Let me walk you through this process.

When you run Elasticsearch by running "elasticsearch.bat", you will find the Elasticsearch log populating in your terminal as shown below.

Image description

When you scroll down or use "ctrl+f" to find the term password, you will see this page here that shows the password for the elastic user.

Copy the generated password and enrollment token and save them in a secure location. These values are shown only when you start Elasticsearch for the first time.

Image description

In a separate tab of your terminal, run curl -k -u elastic localhost:9200

It will prompt you to enter host password.

Image description

Paste the password and press enter.
When you see the following cluster information, it means that you are securely connected to Elasticsearch!

Image description

Then you will enroll Kibana with security enabled with the enrollment token you have saved from the previous step.

The steps on how to do that is shown here:
elastic.co/guide/en/elasticsearch/...

Scroll down to "Start Elasticsearch and enroll Kibana with security enabled" section.

Hope this helps!!

Collapse
 
shopiley profile image
Shopiley

Hello, port localhost:9200 asks for an authentication so when I enter in the new command prompt terminal, I get a security exception error. How do I go about this?

Collapse
 
lisahjung profile image
Lisa Jung • Edited

Hey @shopiley!

The blog that you were using was created for version 7 of Elasticsearch.

With version 8 which I assume you are working with now, security is on by default.

Therefore, the procedure for connecting to Elasticsearch has changed! (Time to update my blog!! )

If you are using Windows, please post this question on the discuss.elastic.co/

If you are a mac user, follow the instructions below. I wish I could add the screenshots in the comments but it's not working. The description should suffice though!

When you run Elasticsearch by running elasticsearch.bat, you will find the elasticsearch log populating in your terminal.

When you scroll down or use ctrl+F to find the term password, you will see the part of the log that shows the password for the elastic user. Copy the generated password and enrollment token and save them in a secure location. These values are shown only when you start Elasticsearch for the first time.

In a separate tab of your terminal, run curl -k -u elastic localhost:9200

It will prompt you to enter the host password.

Paste the password and press enter.
When you see the cluster information, it means that you are securely connected to Elasticsearch!

Then you will enroll Kibana with security enabled with the enrollment token you have saved from the previous step.

The steps on how to do that are shown here.
elastic.co/guide/en/elasticsearch/...

Scroll down to the "Start Elasticsearch and enroll Kibana with security enabled" section.

Hope this helps!!

Collapse
 
deeproy683 profile image
Deep Roy • Edited

please correct the link for kibana download. elastic.co/downloads/kibana

Collapse
 
lisahjung profile image
Lisa Jung

Hey @Deep Roy!
I checked all the links for Kibana download in my blog and it takes you to the right page. Did you have trouble accessing it?