DEV Community

Cover image for Beginner's guide to Elasticsearch

Beginner's guide to Elasticsearch

Lisa Jung on September 20, 2020

In life, we are always in search of something. Whether we are in search of the meaning of life or the most delicious tacos in town, we heavily rel...
Collapse
 
aravind profile image
Aravind Putrevu

Lisa, Thanks for writing this. I work at Elastic.co.

Appreciate it if you could add a note about the security as it is free too. Because, starting up clusters like this might create a security issues in the long run. And many devs think that Elasticsearch Security is a paid feature.

Elastic Stack offers Basic Auth, TLS Encryption, and User Management for free.

Link: elastic.co/blog/security-for-elast...

Also, we're running a Contributor Programme for all the contributors who are doing awesome community work. Please join us and share your work. You'll be featured in the community.

Link: elastic.co/community/contributor/

Collapse
 
yellow1912 profile image
yellow1912

Great article. Elastic is easy to setup but difficult to properly secure, and maintain. It is also very resource intensive and thus costly to operate.

Collapse
 
aravind profile image
Aravind Putrevu

Many don't know that Elasticsearch Security is free. Please try out and let me know.

Also, regarding the architecture, there are many myths. There are quite a few companies which use ES. For example: Take dev.to search, it is powered by ES, Github Search and many many more. Not just search but analytics too, you need run a tool called Rally and benchmark for the right numbers that you want your cluster to serve.

Happy to help more!

Collapse
 
lisahjung profile image
Lisa Jung

Hey yellow1912, thank you so much for sharing your valuable insights with me! I am really curious about your experience with Elastic as it seems like you have extensively worked with it. What made it difficult for you to properly secure and maintain it?!

Collapse
 
yellow1912 profile image
yellow1912

Hi Lisa, sure, I will write my complete journey with Elastic some time this week.

Thread Thread
 
lisahjung profile image
Lisa Jung

Thanks so much, @yellow1912 . Looking forward to it! :)

Collapse
 
chyn_km profile image
KM

Maybe you should try Open Distro for Elasticsearch

Collapse
 
het profile image
Het

Hi @lisahjung ,

If I consider an ELK setup with 1 Hot Node And 2 Warm Node Architecture and if somehow due to some issues my Hot Node server is down, then how would the Elasticsearch behave and will there any such partition in the warm node so as to behave as Hot Node temporary and how the sharding will occur.

Could you just brief me regarding cause I am a little confused.

Collapse
 
lisahjung profile image
Lisa Jung

Hi Het! I am sorry for the delayed response. I don't monitor the blog comments often and just realized you reached out.

Thank you so much for your question! Based on the fact that you have only three nodes, multi-tier architecture may not make sense both in terms of high availability and bottlenecks.

Especially with one hot node, which node will you store the replica? Replicas are strongly recommended so there should be at least two nodes in the hot tier.

And to answer rest of your questions, there are currently 2 possible approaches:

1) Data tiers is the new one but before it would be managed through shard allocation. If it's a new set up, data tiers will be the best way to go: elastic.co/guide/en/elasticsearch/...

2) Another option would be to have a single node for cold/frozen tier if you use a searchable snapshot(paid license) as "replica".

Hope this helps!

I want to make sure your questions are answered more promptly. If you have additional questions, could you please post it on our discuss forum(discuss.elastic.co/)?

We have a team of developer advocates and community members that answer questions on this forum. You will be able to get help and advice there quickly compared to posting questions on the blog!

Thanks again! :)

Collapse
 
ascendixtech profile image
AscendixTech

What a nice and detailed article, Lisa! ⭐

We also actively use Elasticsearch to empower software products with instant search capabilities and recently we decided to compare it with other market rivals like Algolia, Azure Cognitive Search, and Swiftype.

Collapse
 
lisahjung profile image
Lisa Jung

Hi @ascendixtech ! Your comment just made my day. Thank you for such a great compliment and for writing about how Ascendix is using Elasticsearch. What a cool use case!

Collapse
 
anand402 profile image
anand402

pls help mam

Collapse
 
lisahjung profile image
Lisa Jung • Edited

Hi @anand402 ! I am so glad you reached out for help. What specifically about Elasticsicsearch Java API do you need help with?

I hear a sense of urgency in your post and it seems like you need immediate assistance. I am familiar with Ruby or Node.js but have yet to explore Java. But I did reach out to two developer advocates at Elastic as I am sure they will be able to direct you to an expert. I will keep you posted!

Collapse
 
lisahjung profile image
Lisa Jung

Hey @anand402 , I got in touch with @aravind Putrevu. He is a rock star developer advocate at Elastic. Could you specify your question regarding Elasticsearch Java API? Aravind will respond directly here!

Thread Thread
 
xeraa profile image
Philipp Krenn

@anand402 if you're looking for a general intro, youtube.com/watch?v=GW7N4LH0e44 is probably a good starting point — it walks you through all the essentials in 45min :)

Thread Thread
 
lisahjung profile image
Lisa Jung

You are the BEST. Thank you Philipp! :)

Collapse
 
lisahjung profile image
Lisa Jung

You are so welcome Tuyen! I am so glad I could help. Thank you for the wonderful comment. :)

Collapse
 
whiteheadbanger profile image
Sebastian

This is awesome! I just needed a way to create a search system for my flask app.

Thanks for the info!

Collapse
 
lisahjung profile image
Lisa Jung

Thanks Sebastian. You put a huge smile on my face. Glad I could help!

Collapse
 
aravind profile image
Aravind Putrevu

I wrote a guide recently for building a search engine on flask app. See if it works for you.

guides.aravind.dev/codelabs/elasti...

Collapse
 
whiteheadbanger profile image
Sebastian

Thanks!

Collapse
 
posgra profile image
posgra

Hi Lisa.
Thanks for this awesome introduction to ElasticSearch. I liked the care about details (summary of blog and video, with time of each content on video). Simply the best!!!

Collapse
 
lisahjung profile image
Lisa Jung

@posgra !! Your kind words just made my day. Thank you so much!!!

Collapse
 
bpkinez profile image
Branislav Petrović

Great article! This is so clear and concise introduction to Elasticsearch.

Thanks Lisa

Collapse
 
lisahjung profile image
Lisa Jung

Your comment just made my day. Thank you so much @Branislav!

Collapse
 
lunaticmonk profile image
Sumedh Nimkarde

Awesome post!

Collapse
 
lisahjung profile image
Lisa Jung

Thank you so much @Sumedh!! Appreciate ya. :)

Collapse
 
kamilliano profile image
kamilliano

Nice one Lisa, thanks for the article.

Collapse
 
lisahjung profile image
Lisa Jung

You are so welcome @kamilliano . Reading your comment this morning was a wonderful way to start the day! Thank you. :)

Collapse
 
gitneo profile image
ogo okafor

This was an awesome ride. I now have a working elasticsearch instance and i understood everything you taught. Thank you Lisa.

Collapse
 
lisahjung profile image
Lisa Jung

That is AWESOME @Ogo! Nice work!! Thank you for the wonderful comment. You really brightened up my day. :)

Collapse
 
anand402 profile image
anand402

pls explain elasticsearch java Api

Collapse
 
saisandeepvaddi profile image
Sai Sandeep Vaddi

Nice article to get started with Elastic stack.

Collapse
 
lisahjung profile image
Lisa Jung • Edited

Thank you so much Sai! I really appreciate your encouragement. It inspires me to keep writing!

Collapse
 
jozadaquebatista profile image
Jozadaque Batista

Great post I've really enjoyed so much

Collapse
 
lisahjung profile image
Lisa Jung

Thank you so much Jozadaque. You made my day!

Collapse
 
18ahmed profile image
18ahmed

Thanks for your effort
I have a question concerning establishing a cluster with two master nodes, is it possible !?

Collapse
 
lisahjung profile image
Lisa Jung • Edited

Hi @18ahmed !

What a great question! You should have only one active master node in a cluster.
This documentation explains why in depth(elastic.co/guide/en/elasticsearch/...).

To summarize the excerpts from this document, the master node is considered as the supreme ruler of the cluster. It decides when new indices can be created, how shards are moved and etc. If you have two master nodes that think they are in charge, data integrity becomes perilous and your cluster is at danger of losing data.

However, you can designate multiple master eligible nodes. So if the master node were to go down, one of the master eligible node can be elected to become the master node.

Hope this helps!

Collapse
 
nileshprasad137 profile image
Nilesh Prasad

This is super helpful !!

Collapse
 
lisahjung profile image
Lisa Jung

So glad you found it helpful @nilesh Prasad!! :)

Collapse
 
zzcpower profile image
zzcpower • Edited

The Beginner’s crash course video is crystal clear and detailed. I think I have a crush on you Lisa!