Skip to main content
Version: 6.11.0

Elasticsearch Installation

Installation​

We recommend downloading / installing through the relevant package management tool, example below.

Elasticsearch runs with its own bundled JDK and there is no requirement on the user to install Java specifically to run Elasticsearch.

Further Elasticsearch documentation can be found online at https://www.elastic.co/guide/en/elasticsearch/reference/current/setup.html (be sure to switch to the documentation for the correct version).

RHEL Installation​

  1. Download package

    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.8.2-x86_64.rpm
  2. Verify package signature (optional)

    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.8.2-x86_64.rpm.sha512
    sha512sum -c elasticsearch-8.8.2-x86_64.rpm.sha512
  3. Install package

    sudo rpm --install elasticsearch-8.8.2-x86_64.rpm
  4. Reload systemd daemon

    sudo systemctl daemon-reload
  5. Start service on boot

    sudo systemctl enable elasticsearch.service

Ubuntu Installation​

  1. Download package

    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.8.2-amd64.deb
  2. Verify package signature (optional)

    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.8.2-amd64.deb.sha512
    shasum -a 512 -c elasticsearch-8.8.2-amd64.deb.sha512
  3. Install package

    sudo dpkg -i elasticsearch-8.8.2-amd64.deb
  4. Reload systemd daemon

    sudo systemctl daemon-reload
  5. Start service on boot

    sudo systemctl enable elasticsearch.service

Configuration​

For package distributions the Elasticsearch configuration files can be found in /etc/elasticsearch

Network Settings​

By default, Elasticsearch is only accessible on localhost. To enable connections from any host, edit elasticsearch.yml configuration file, adding:

network.host: 0.0.0.0

Cluster Settings​

For a simple one-node cluster, edit elasticsearch.yml configuration file, adding:

discovery.type: single-node

and commenting out or deleting:

#cluster.initial_master_nodes: ["..."]

Security Settings​

Disable the xpack security, edit elasticsearch.yml configuration file, changing the following property to false:

xpack.security.enabled: false

See the Securing Elasticsearch section for enabling security.

Memory Settings​

By default Elasticsearch will reserve 50% of the system memory. That is the recommended configuration if Elasticsearch is running as a service on a dedicated server.

However if Elasticsearch is running on the same server as the Portal Dedicated, Elasticsearch should be allocated 25% of the system memory.

To do this create a new file to configure the JVM settings:

sudo vi /etc/elasticsearch/jvm.options.d/jvm.options

with content:

-Xms2G
-Xmx2G

Note: This assumes a system with 8GB of memory. Adjust the 2G value to be 25% of the system memory.

Starting/stopping Elasticsearch​

This assumes that Elasticsearch was installed as a systemd service, as described above.

Starting Elasticsearch​

sudo systemctl start elasticsearch

Elasticsearch status​

sudo systemctl status elasticsearch

Stopping Elasticsearch​

sudo systemctl stop elasticsearch

Checking that Elasticsearch is running​

You can verify Elasticsearch is running by sending a HTTP request to port 9200 on localhost. The server should also be accessible from the Portal Dedicated server and every Agent server.

curl http://localhost:9200

Which will produce a response similar to:

{
"name": "osboxes",
"cluster_name": "elasticsearch",
"cluster_uuid": "Xw6o7k7LQdaHhh4T_KIUFg",
"version": {
"number": "8.8.2",
"build_flavor": "default",
"build_type": "deb",
"build_hash": "98e1271edf932a480e4262a471281f1ee295ce6b",
"build_date": "2023-06-26T05:16:16.196344851Z",
"build_snapshot": false,
"lucene_version": "9.6.0",
"minimum_wire_compatibility_version": "7.17.0",
"minimum_index_compatibility_version": "7.0.0"
},
"tagline": "You Know, for Search"
}