To take Elasticsearch for a test drive, you can create a hosted deployment on the Elasticsearch Service or set up a multi-node Elasticsearch cluster on your own Linux, macOS, or Windows machine.
Run Elasticsearch on Elastic Cloudedit
When you create a deployment on the Elasticsearch Service, the service provisions a three-node Elasticsearch cluster along with Kibana and APM.
To create a deployment:
- Sign up for a free trial and verify your email address.
- Set a password for your account.
- Click Create Deployment.
Once you’ve created a deployment, you’re ready to Index some documents.
Run Elasticsearch locally on Linux, macOS, or Windowsedit
When you create a deployment on the Elasticsearch Service, a master node and two data nodes are provisioned automatically. By installing from the tar or zip archive, you can start multiple instances of Elasticsearch locally to see how a multi-node cluster behaves.
To run a three-node Elasticsearch cluster locally:
Download the Elasticsearch archive for your OS:
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.7.1-linux-x86_64.tar.gz
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.7.1-darwin-x86_64.tar.gz
Extract the archive:
tar -xvf elasticsearch-7.7.1-linux-x86_64.tar.gz
tar -xvf elasticsearch-7.7.1-darwin-x86_64.tar.gz
Start Elasticsearch from the
Linux and macOS:
cd elasticsearch-7.7.1/bin ./elasticsearch
cd elasticsearch-7.7.1\bin .\elasticsearch.bat
You now have a single-node Elasticsearch cluster up and running!
Start two more instances of Elasticsearch so you can see how a typical multi-node cluster behaves. You need to specify unique data and log paths for each node.
Linux and macOS:
./elasticsearch -Epath.data=data2 -Epath.logs=log2 ./elasticsearch -Epath.data=data3 -Epath.logs=log3
.\elasticsearch.bat -E path.data=data2 -E path.logs=log2 .\elasticsearch.bat -E path.data=data3 -E path.logs=log3
The additional nodes are assigned unique IDs. Because you’re running all three nodes locally, they automatically join the cluster with the first node.
Use the cat health API to verify that your three-node cluster is up running. The cat APIs return information about your cluster and indices in a format that’s easier to read than raw JSON.
You can interact directly with your cluster by submitting HTTP requests to the Elasticsearch REST API. If you have Kibana installed and running, you can also open Kibana and submit requests through the Dev Console.
You’ll want to check out the Elasticsearch language clients when you’re ready to start using Elasticsearch in your own applications.
The response should indicate that the status of the
greenand it has three nodes:
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent 1565052807 00:53:27 elasticsearch green 3 3 6 3 0 0 0 0 - 100.0%
The cluster status will remain yellow if you are only running a single instance of Elasticsearch. A single node cluster is fully functional, but data cannot be replicated to another node to provide resiliency. Replica shards must be available for the cluster status to be green. If the cluster status is red, some data is unavailable.
Talking to Elasticsearch with cURL commandsedit
Most of the examples in this guide enable you to copy the appropriate cURL command and submit the request to your local Elasticsearch instance from the command line.
A request to Elasticsearch consists of the same parts as any HTTP request:
curl -X<VERB> '<PROTOCOL>://<HOST>:<PORT>/<PATH>?<QUERY_STRING>' -d '<BODY>'
This example uses the following variables:
The appropriate HTTP method or verb. For example,
https. Use the latter if you have an HTTPS proxy in front of Elasticsearch or you use Elasticsearch security features to encrypt HTTP communications.
The hostname of any node in your Elasticsearch cluster. Alternatively, use
localhostfor a node on your local machine.
The port running the Elasticsearch HTTP service, which defaults to
The API endpoint, which can contain multiple components, such as
Any optional query-string parameters. For example,
?prettywill pretty-print the JSON response to make it easier to read.
- A JSON-encoded request body (if necessary).
If the Elasticsearch security features are enabled, you must also provide a valid user
name (and password) that has authority to run the API. For example, use the
--u cURL command parameter. For details about which security
privileges are required to run each API, see REST APIs.
Elasticsearch responds to each API request with an HTTP status code like
200 OK. With
the exception of
HEAD requests, it also returns a JSON-encoded response body.
Other installation optionsedit
Installing Elasticsearch from an archive file enables you to easily install and run multiple instances locally so you can try things out. To run a single instance, you can run Elasticsearch in a Docker container, install Elasticsearch using the DEB or RPM packages on Linux, install using Homebrew on macOS, or install using the MSI package installer on Windows. See Installing Elasticsearch for more information.