Elasticsearch 7.9.3 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/index.php/s/Jtf9LwMLmFD4tWY
(Tested with Ubuntu 20.10: https://releases.ubuntu.com/20.10/ubuntu-20.10-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/Jtf9LwMLmFD4tWY/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) sudo systemctl daemon-reload
Replace the installed JDK 11 with OpenJDK 11 in the elasticsearch folder
sudo rm -rf /usr/share/elasticsearch/jdk cd Elasticsearch\ 7.9.3 unzip jdk-11.0.10-ojdkbuild-linux-x64.zip sudo mv jdk-11.0.10-ojdkbuild-linux-x64 jdk sudo mv jdk /usr/share/elasticsearch/
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 conf/* /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/elasticsearch793/data sudo mkdir /opt/elasticsearch793/logs sudo chown -R elasticsearch:elasticsearch /opt/elasticsearch793
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/elasticsearch793/logs/es-red.log #once you see "license [<guid>] mode [basic] - valid" 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.)