Elasticsearch 7.2.1 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 1.8) can be found here: https://files.optimal-systems.org/index.php/s/Pd66oYD8TcZm6CM
(Tested with Ubuntu 20.10: https://releases.ubuntu.com/20.10/ubuntu-20.10-live-server-amd64.iso)

  1. Download the needed files from the above link to the linux system and unzip.

    wget https://files.optimal-systems.org/index.php/s/Pd66oYD8TcZm6CM/download -Ofiles.zip
    sudo apt install unzip
    unzip files.zip
  2. 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.2.1
  3. Enable elasticsearch service

    sudo systemctl daemon-reload
    sudo systemctl enable elasticsearch.service
  4. 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
  5. Replace the installed JDK 11 with OpenJDK 8 in the elasticsearch folder

    sudo rm -rf /usr/share/elasticsearch/jdk
    cd Elasticsearch\ 7.2.1
    unzip jdk-8u262-ojdkbuild-linux-x64.zip
    sudo mv jdk-8u262-ojdkbuild-linux-x64 jdk
    sudo mv jdk /usr/share/elasticsearch/
  6. 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
  7. Copy elasticsearch configuration 

    sudo cp conf/* /etc/elasticsearch/
  8. (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!).

  9. 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

  10. Create data and logs directories

    sudo mkdir -p /opt/elasticsearch7/data
    sudo mkdir /opt/elasticsearch7/logs
    sudo chown -R elasticsearch:elasticsearch /opt/elasticsearch7
    1.  Replace the directory names with the paths configured in the previous step

  11. 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/elasticsearch7/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)
  12. 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 
  13. 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.)