Amazon ES – setting up the cluster! #1

Reading Time: 4 minutes

Amazon Web Services (AWS) is a cloud services platform, providing compute power, database storage, content delivery, security options and other functionality to allow businesses to build sophisticated applications with increased flexibility, scalability and reliability. Amazon Elasticsearch is one of the services provided by AWS.

Amazon ES

Amazon Elasticsearch Service, also called Amazon ES, is a managed service that makes it easy to create a domain, deploy, operate, and scale Elasticsearch clusters in the AWS Cloud. Elasticsearch is an open-source, highly scalable full-text search and analytics engine. In the previous blog, we have discussed how to access its API specific methods using High-level Rest Client.

With Amazon ES, you get direct access to the Elasticsearch APIs so that existing code and applications work seamlessly with the service.

Amazon ES offers a number of benefits :

  • Cluster scaling options
  • Supports Open-Source APIs and Tools
  • Self-healing clusters
  • Replication for high availability
  • Data durability
  • Enhanced security
  • Node monitoring
  • Tightly Integrated with Other AWS Services

Getting Started with Amazon Elasticsearch Service

Here are the steps to get started with Amazon ES and creating your own Elasticsearch cluster.

Step 1: Sign up for an AWS account.
If you are not an AWS user, your first step is to create an AWS account. If you already have one, you are automatically signed up for Amazon ES.
Your AWS account enables you to access Amazon ES and other AWS services. As with other AWS services, you pay only for the resources that you use.
Look for the Elasticsearch service in the search box.

Amazon ES

Step 2: Accessing Amazon Elasticsearch Service.
You can access Amazon ES through the Amazon ES console, the AWS SDKs, or the AWS CLI. The Amazon ES console lets you create, configure, and monitor your domains. It is the easiest way to get started with Amazon ES.

Step 3: Create an Amazon ES domain.
To get started using the service, you need to create an Amazon ES domain.

Screenshot from 2018-03-31 18-21-08

An Amazon ES domain is an Elasticsearch cluster in the AWS Cloud that has the compute and storage resources that you specify. For example, you can specify the number of instances, instance types, and storage options.

Step 4: Define domain.
A domain is a collection of all the resources needed to run your Elasticsearch cluster.

Amazon ES

Step 5: Configure cluster.
You need to configure the instance and storage settings for your cluster based on the traffic, data, and availability requirements of your application. A cluster is a collection of one or more data nodes, optionally dedicated master nodes, and storage required to run Elasticsearch and operate your domain.

Amazon ES

Screenshot from 2018-03-31 18-34-31

Step 6: Set up access.
Next step is to configure your network and attach policies that let you control access to your domain.

Screenshot from 2018-03-31 18-35-57

Step 7: Done.
Just Review and You are ready to go.

Screenshot from 2018-03-31 18-39-39

Screenshot from 2018-03-31 18-40-28

It takes up to ten minutes to initialize new domains. After your domain is initialized, you can upload data and make changes to the domain.

Because Elasticsearch uses a REST API to perform operations like index, update, search, get, delete, and many more. You can use standard clients like curl or any programming language that can send HTTP requests to your ES cluster.

A simple example to create an Index using Curl command on your Elasticsearch cluster :

curl -XPOST elasticsearch_domain_endpoint/user-index/user -d '{"id" : "1", "name": "user1", "age" : 20}' -H 'Content-Type: application/json'

where, elasticsearch_domain_endpoint is the endpoint of your cluster.

To check whether the document exists or not, you can perform the following curl operation :

curl -XGET elasticsearch_domain_endpoint/user-index/_search?pretty

Also, you can click on the Indices tab, to view all the indices created on your cluster, documents count and its mapping details.

Screenshot from 2018-04-15 16-22-10

Apart from that, you can use the Kibana endpoint. Kibana enables visual exploration and real-time analysis of your data in Elasticsearch. You can learn about it here.

In the next blog, we will look how we can authenticate access to Amazon ES cluster and how we can interact with it programmatically.

For more details on Amazon Elasticsearch Service, check its documentation here.

Happy Blogging.!! 🙂


knoldus-advt-sticker


 

Written by 

I am a Software Consultant, having experience of more than 1 year. I am well versed with Object Oriented Programming Paradigms having good command of programming languages like Scala, Java & C++ and also skilled in building the microservices architecture based application using Lagom, Cassandra, Elasticsearch and many more. My hobbies include reading novels, writing blogs, drawing, listening to music.

3 thoughts on “Amazon ES – setting up the cluster! #13 min read

Comments are closed.

Discover more from Knoldus Blogs

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

Continue reading