Define Elasticsearch Indices

30 minutes
  • 2 Learning Objectives

About this Hands-on Lab

In Elasticsearch, the data we index (verb) is stored in an index (noun). The word index here is used as both a verb and a noun. Essentially, we perform an index operation in order to store data in an index. Before we can do this however, we need to first understand the structure of indices and how to define them in order to meet specific requirements. In this hands-on lab, you will be creating a few indices with specific shard allocation requirements and custom aliases.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create the logs-01 index.

Use the Kibana console tool to execute the following:

PUT /logs-01
{
  "aliases": {
    "this_week": {}
  },
  "settings": {
    "number_of_shards": 2,
    "number_of_replicas": 1
  }
}
Create the logs-02 index.

Use the Kibana console tool to execute the following:

PUT /logs-02
{
  "aliases": {
    "last_week": {}
  },
  "settings": {
    "number_of_shards": 2,
    "number_of_replicas": 1
  }
}

Additional Resources

You work as a system administrator for a 3-node Elasticsearch cluster. You are being asked to prepare the Elasticsearch cluster to ingest some log data by creating the neccessary indices. We would like to search the data by using aliases such as this_week or last_week. This makes it easy to search the data you care about since you don't have to know the specific index names. Using the console tool in Kibana, create the following indices:

+---------+-----------+----------------+----------------+
| Name    | Alias     | Primary Shards | Replica Shards |
+---------+-----------+----------------+----------------+
| logs-01 | this_week | 2              | 1              |
+---------+-----------+----------------+----------------+
| logs-02 | last_week | 2              | 1              |
+---------+-----------+----------------+----------------+

Your master-1 node has an Kibana instance which can be accessed in your local web browser by navigating to the public IP address of the master-1 node over port 8080 (example: http://public_ip:8080). To log in, use the elastic user with the password elastic_566.

Note: Before logging into Kibaba, please provide it an extra minute to finish setting up.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?