Methods of payment Abuse

Installing Elasticsearch in Ubuntu 22.04

16.04.2023, 03:11
Elasticsearch is an open source search engine and analytical engine that allows you to store, search and analyze data in real time. Elasticsearch uses a distributed architecture and is based on Apache Lucene, and is characterized by high performance, scalability and usability. Elasticsearch is widely used in the field of search, analytics and log analysis.

What can Elasticsearch do?

It has the following features:
  1. Data Storage and Retrieval: Elasticsearch allows you to store and index various types of data, including text, numbers, geospatial data, and custom data types.
  2. Full-text Search: Elasticsearch provides full-text search with support for complex queries such as search phrases, wildcard queries, Fuzzy search and more.
  3. Distributed architecture: Elasticsearch uses a distributed architecture, which allows you to scale the system and process large amounts of data.
  4. API: Elasticsearch offers various APIs for data management and indexing, including REST API and Java API.
  5. Data Aggregations: Elasticsearch supports aggregations that allow you to analyze data and extract summary information such as average, sum, minimum and maximum.
  6. Solution for search scenarios: Elasticsearch is used for search scenarios in a large number of applications and systems, including search portals, monitoring systems, version control systems and others.
  7. Scaling Functionality: Elasticsearch offers scaling and multitasking functionality to ensure high availability and performance on large systems.

Installation process

The instructions for installing Elasticsearch will be approximately the same for different versions of Ubuntu.
 
First you need to update the package list:
sudo apt update
Install the OpenJDK 11 package, which is necessary for Elasticsearch to work:
sudo apt installs openjdk-11-jdk
Add the Elasticsearch key and repository to APT:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-adding a key -
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable basic" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list
Note: instead of "7.x" a different version of Elasticsearch may be specified in the URL.
 
Update the package list and install Elastic Search:
sudo apt update
sudo apt install elasticsearch
Configure Elasticsearch by editing the configuration file /etc/elasticsearch/elasticsearch.yml:
sudo nano /etc/elasticsearch/elasticsearch.yml
Let's look at some of the most important settings:
cluster.name : name of the Elasticsearch cluster
node.name : Elasticsearch node name
network.host: IP address or host name on which Elasticsearch
http.port will run: Elasticsearch HTTP API port (default 9200)
memory.blocked: true to allow Elasticsearch to lock memory in the page area, which reduces the chance of context switching and improves performance.
Launch Elasticsearch and configure autorun:
sudo systemctl launch elasticsearch
sudo systemctl enable elasticsearch
Check that Elasticsearch is working by sending a request to its API:
curl http://localhost:9200/
You should see the response with the status and information about the Elasticsearch version, for example:
{
"name": "my-Elasticsearch in-node",
"cluster" : "my-Elasticsearch in cluster",
"cluster_uuid": "xxxxxx-XXXX-XXXX-xxxx-xxxxxx",
"version" : {
"number" : "7.15.1",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "83c34f456ae29d60e94d886e455e6a3409bba9ed",
"build_date" : "2021-10-07T21:56:19.031608185Z",
"build_snapshot" : false,
"lucene_version" : "8.9.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You know, for search"
}
The installation of Elasticsearch on Ubuntu should be completed successfully.