I'm installing on Debian 12 (not supported).
Install dependencies to add the new repo
apt update && \
apt install lsb-release ca-certificates curl gnupg2 -y
Add the repositories public key
curl -o- https://artifacts.opensearch.org/publickeys/opensearch.pgp | sudo gpg --dearmor --batch --yes -o /etc/apt/keyrings/opensearch
Add the repository
echo "deb [signed-by=/etc/apt/keyrings/opensearch] https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/apt stable main" | tee /etc/apt/sources.list.d/opensearch-2.x.list
Install OpenSearch. You must supply an initial admin password.
env OPENSEARCH_INITIAL_ADMIN_PASSWORD=************ \
apt install opensearch
Enable the systemd
service.
systemctl daemon-reload && \
systemctl enable --now opensearch.service && \
systemctl status opensearch.service
OpenSearch is running in, what is considered, “Demo Mode" at this point. Let's prepare OpenSearch for production use.
Enable memory locking in the Opensearch config
sed -i "s/bootstrap.memory_lock: false/bootstrap.memory_lock: true/" /etc/opensearch/opensearch.yml
Debian uses systemd
to handle swap devices and processes - you must add the following to the Opensearch service, as an override.
mkdir /etc/systemd/system/opensearch.service.d && \
bash -c "cat > /etc/systemd/system/opensearch.service.d/override.conf" <<'EOF'
[Service]
LimitMEMLOCK=infinity
EOF
Finally, follow this guide to disable swap for the host system. The latter config will cause Opensearch to fail its startup checks if you do not disable the host system's use of swap.