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.
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.
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.
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.
Step 6: Set up access.
Next step is to configure your network and attach policies that let you control access to your domain.
Step 7: Done.
Just Review and You are ready to go.
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,
is the endpoint of your cluster.elasticsearch_domain_endpoint
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.
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.!! 🙂
Reblogged this on Abhishek Giri.
Great insights! Thanks for sharing this.