Install Elasticsearch 9¶
This guide shows a simple standard installation of Elasticsearch 9. The intention is to get you up and running quickly. However, in case you need a more advanced configuration or face any issues, have a look at the official Elasticsearch installation documentation. Adapt it wherever needed if your use-case differs.
Installation¶
Download and Add the Public Signing Key¶
$ curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | \
gpg --dearmor | sudo tee /usr/share/keyrings/elasticsearch-keyring.gpg \
&& sudo chmod 644 /usr/share/keyrings/elasticsearch-keyring.gpg
$ sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
$ sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
Add the Repository¶
$ echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/9.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-9.x.list
$ sudo cat << EOF > /etc/zypp/repos.d/elasticsearch.repo
[elasticsearch]
name=Elasticsearch repository for 9.x packages
baseurl=https://artifacts.elastic.co/packages/9.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md
EOF
$ sudo cat << EOF > /etc/yum.repos.d/elasticsearch.repo
[elasticsearch]
name=Elasticsearch repository for 9.x packages
baseurl=https://artifacts.elastic.co/packages/9.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
type=rpm-md
EOF
Install Elasticsearch¶
$ sudo apt update && sudo apt install elasticsearch
$ sudo zypper modifyrepo --enable elasticsearch && sudo zypper install elasticsearch
$ sudo dnf install --enablerepo=elasticsearch elasticsearch
Tip
Make sure to check the output and to copy the password of the
built-in superuser. Otherwise, you have to recreate it by running
/usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic.
Configuration¶
Optionally, check and configure Elasticsearch’s configuration file which you can
find under /etc/elasticsearch/elasticsearch.yml.
We recommend to adjust the maximum context size which should get indexed by Elasticsearch. Adjust it to a reasonable size like in the example:
http.max_content_length: 400mb
Additional configuration is out of scope of this documentation. In case your scenario needs additional configuration, have a look at Elastic’s configuration reference.
Start and Enable Elasticsearch¶
$ sudo systemctl enable elasticsearch.service --now
Next Steps¶
Go on with the installation of Zammad. After the installation of Zammad is completed, you can connect Zammad with Elasticsearch.