Skip to main content

How to Install Elasticsearch on CentOS 8

Ready for faster more powerful WordPress search?

sudo dnf install java-11-openjdk-devel
java -version
openjdk version "11.0.5" 2019-10-15 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.5+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.5+10-LTS, mixed mode, sharing)
sudo rpm --import
sudo nano /etc/yum.repos.d/elasticsearch.repo
name=Elasticsearch repository for 7.x packages

(optional) enable=1

sudo dnf install --enablerepo=elasticsearch elasticsearch
dnf update
systemctl daemon-reload
sudo systemctl start elasticsearch.service

If elasticsearch service does not start, check the logs at /var/log/elasticsearch/elasticsearch.log.
Also see Troubleshooting section below. Otherwise reboot your webserver.

sudo systemctl enable elasticsearch.service

Memory Usage Settings



If elasticsearch service does not start, check the logs at /var/log/elasticsearch/elasticsearch.log.

When using No Exec /tmp dir:

Error like this or access denied:

unable to load JNA native support library, native methods will be disabled
  1. Go to /etc/sysconfig/elasticsearch
  2. Add ES_JAVA_OPTS="-Djna.tmpdir=/var/lib/elasticsearch/tmp".(For newer Elasticsearch, use instead of Djna.tmpdir)
  3. Start Elasticsearch using systemctl start elasticsearch or service start elasticsearch.
  4. You can see now tmp folder created inside /var/lib/elasticsearch/.
  5. This folder should have execute permission for elasticsearch user
  6. Check the permission with name i -l /var/lib/elasticsearch

If you had an old ElasticSearch sitting around:


Failed to obtain node lock, is the following location writable

If you had an old ElasticSearch sitting around like I did, you can start by either trying to delete a specific node.lock file or go nuclear and rm -rf the nodes folder.

ElasticPress plugin for WordPress

Elasticsearch Host URL:

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *