Installig Elasticsearch on Ubuntu 20.04 on the Raspberry Pi.

Installig Elasticsearch on Ubuntu 20.04 on the Raspberry Pi.

In this article, I'm installing Elasticsearch on Ubuntu for the Raspberry Pi 8GB,

Elasticsearch is a distributed, RESTful search and analytics engine capable of addressing a growing number of use cases.

because it's a requirement for Graylog, which I'll install in a next post.

Graylog is a leading centralized log management solution for capturing, storing, and enabling real-time analysis of terabytes of machine data.

Elasticsearch 6.8, and version 7 up to 7.10

Follow these instructions to install Elasticsearch.

wget -q -O myKey

ubuntu@ubuntu:~$ wget -q -O myKey

sudo apt-key add myKey

ubuntu@ubuntu:~$ sudo apt-key add myKey

echo "deb stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list

ubuntu@ubuntu:~$ echo "deb stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
deb stable main

sudo apt-get update && sudo apt-get install elasticsearch-oss

ubuntu@ubuntu:~$ sudo apt-get update && sudo apt-get install elasticsearch-oss
Hit:1 focal InRelease
Ign:2 focal/mongodb-org/4.4 InRelease
Hit:3 focal/mongodb-org/4.4 Release
Hit:4 focal-updates InRelease
Get:5 stable InRelease [10.4 kB]
Hit:6 focal-backports InRelease
Hit:7 focal-security InRelease
Get:9 stable/main arm64 Packages [32.9 kB]
Fetched 43.3 kB in 3s (17.1 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 228 MB of archives.
After this operation, 419 MB of additional disk space will be used.
Get:1 stable/main arm64 elasticsearch-oss arm64 7.10.2 [228 MB]
Fetched 228 MB in 3min 35s (1062 kB/s)
Selecting previously unselected package elasticsearch-oss.
(Reading database ... 67050 files and directories currently installed.)
Preparing to unpack .../elasticsearch-oss_7.10.2_arm64.deb ...
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Unpacking elasticsearch-oss (7.10.2) ...
Setting up elasticsearch-oss (7.10.2) ...
Created elasticsearch keystore in /etc/elasticsearch/elasticsearch.keystore
Processing triggers for systemd (245.4-4ubuntu3.11) ...

Modify the Elasticsearch configuration file  (/etc/elasticsearch/elasticsearch.yml) and set the cluster name to graylog and uncomment action.auto_create_index: false to enable the action:

sudo tee -a /etc/elasticsearch/elasticsearch.yml > /dev/null << graylogaction.auto_create_index: falseEOT

ubuntu@ubuntu:~$ sudo tee -a /etc/elasticsearch/elasticsearch.yml > /dev/null <<EOT
> graylog
> action.auto_create_index: false

Start Elasticsearch and verify it is running.

sudo systemctl daemon-reload

ubuntu@ubuntu:~$ sudo systemctl daemon-reload

sudo systemctl enable elasticsearch.service

ubuntu@ubuntu:~$ sudo systemctl enable elasticsearch.service
Synchronizing state of elasticsearch.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable elasticsearch
Created symlink /etc/systemd/system/ → /lib/systemd/system/elasticsearch.service.

sudo systemctl restart elasticsearch.service

ubuntu@ubuntu:~$ sudo systemctl restart elasticsearch.service

sudo systemctl --type=service --state=active | grep elasticsearch

ubuntu@ubuntu:~$ sudo systemctl --type=service --state=active | grep elasticsearch
  elasticsearch.service                                    loaded active running Elasticsearch

Next, as mentioned, I will install Graylog.

Want to thank me?

Buy Me A Coffee