Elasticsearch 7.16.2 Linux Installation
System Requirements
- Linux operating system with apt package manager
- network connection with static ip address and (temporary) internet access
- user-account with sudo rights
Installation Procedure
Files needed during the installation (plugins.zip, relevant files from the conf-directory, openjdk 11) can be found here: https://files.optimal-systems.org/s/kZDjmEYJrytPiMm
(Tested with Ubuntu 23.04: https://releases.ubuntu.com/23.04/ubuntu-23.04-live-server-amd64.iso)
Download the needed files from the above link to the linux system and unzip.
wget https://files.optimal-systems.org/index.php/s/95iADPBHcQyp68z/download -Ofiles.zip sudo apt install unzip unzip files.zip
Add elasticsearch repository and install elasticsearch,
sudo apt install apt-transport-https wget -qO esrepo https://artifacts.elastic.co/GPG-KEY-elasticsearch sudo apt-key add esrepo sudo add-apt-repository "deb https://artifacts.elastic.co/packages/7.x/apt stable main" sudo apt update sudo apt install elasticsearch=7.9.3
Enable elasticsearch service
sudo systemctl daemon-reload sudo systemctl enable elasticsearch.service
Allow elasticsearch to lock all memory
sudo mkdir -p /etc/systemd/system/elasticsearch.service.d/ sudo nano /etc/systemd/system/elasticsearch.service.d/override.conf --> Enter the following lines: [Service] LimitMEMLOCK=infinity --> Save file (using STRG+X then Y then Enter) sudo systemctl daemon-reload
Unzip and copy the Intrafind plugins to the elasticsearch plugins folder
unzip plugins.zip sudo cp -r plugins/* /usr/share/elasticsearch/plugins/ sudo chmod -R 755 /usr/share/elasticsearch sudo chown -R elasticsearch:elasticsearch /usr/share/elasticsearch
Copy elasticsearch configuration
sudo cp config/* /etc/elasticsearch/
(optional) Change default java heap settings from 8 GB to desired value
sudo nano /etc/elasticsearch/jvm.options
- change values of lines -Xms and -Xmx to your desired value (values must be the same!).
- change values of lines -Xms and -Xmx to your desired value (values must be the same!).
Configure settings in elastisearch.yml
sudo nano /etc/elasticsearch/elasticsearch.yml
- Check and/or change the following settings:
- path.data: data directory
- path.logs: log directory
- cluster-name
- node.name: must be unique over all nodes (if multiple exist)
- cluster.initial_master_nodes: list of nodes for master quorum
- discovery.seed_hosts: list of nodes to check for existing cluster
- Check and/or change the following settings:
Create data and logs directories
sudo mkdir -p /opt/elasticsearch7162/data sudo mkdir /opt/elasticsearch7162/logs sudo chown -R elasticsearch:elasticsearch /opt/elasticsearch7162
Replace the directory names with the paths configured in the previous step
Start elasticsearch and check for errors
sudo systemctl start elasticsearch.service #wait some seconds sudo systemctl status elasticsearch.service #once the "Active" status is "active (running)" sudo tail -f /opt/elasticsearch7162/logs/es-red.log #once you see "Cluster health status changed from [YELLOW] to [GREEN]" you can continue to the next step (use STRG+C to exit tail -f)
If this is the only / first elasticsearch node, setup the built-in users passwords
cd /usr/share/elasticsearch/bin sudo ./elasticsearch-setup-passwords auto -b > ~/built-in.usr less ~/built-in.usr
- Note the password of the elastic user. It is needed for the service-manager setup.
(For security reasons the built-in.usr file should be deleted after elasticsearch and the service-manager are installed and working ok.)