DevOps Classroomnotes 15/Jul/2022

Index and Document

  • Index and Document
    Preview
  • The process of inserting data/documents is called as indexing
  • Lets refer the elastic search rest api’s Refer Here
  • Refer Here for index apis
  • Lets create curl request to create the index
ESPASS='nplUwdODeH4xtPfp=CT2'
SERVER_URL='https://20.198.70.188:9200'
# Checking if the index exists
curl -I -u elastic:$ESPASS "${SERVER_URL}/sample" --insecure
# we got 404 response => index not found

Preview
* Lets create one more index with
* name: sample2
* number of shards 1
* number of replicas 1
Preview

Exercise:

  • Create an index with yourname
  • Check if the index exists or not
  • delete the index
    Preview
  • The commands used are
curl -I -u elastic:$ESPASS "https://20.198.70.188:9200/khajaibrahim?pretty" --insecure
curl -X DELETE -u elastic:$ESPASS "https://20.198.70.188:9200/khajaibrahim?pretty" --insecure
curl -I -u elastic:$ESPASS "https://20.198.70.188:9200/khajaibrahim?pretty" --insecure
  • Now let me insert a document about Devops
{
    "name": "DevOps",
    "tools": ["Git", "Ansible", "Jenkins", "Docker", "K8s", "Terraform", "SRE"]
}
  • The curl request is
curl -X POST -u elastic:$ESPASS "https://20.198.70.188:9200/khajaibrahim/_doc?routing=kimchy&pretty" -H 'Content-Type: application/json' --insecure -d'
{
    "name": "DevOps",
    "tools": ["Git", "Ansible", "Jenkins", "Docker", "K8s", "Terraform", "SRE"]
}
'

Preview

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Wordpress Development Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube