Unable to load JNA native support library Elasticsearch 6.x
- Go to
/etc/sysconfig/elasticsearch
Add
ES_JAVA_OPTS="-Djna.tmpdir=/var/lib/elasticsearch/tmp"
.(For newer Elasticsearch, use
Djava.io.tmpdir
instead ofDjna.tmpdir
)- Start Elasticsearch using
systemctl start elasticsearch
orservice start elasticsearch
. - You can see now
tmp
folder created inside/var/lib/elasticsearch/
. - This folder should have execute permission for
elasticsearch
user - Check the permission with name
i -l /var/lib/elasticsearch
Make sure the permission file have something like below permission
dr-xr-xr-x root root / drwxr-xr-x root root var drwxr-xr-x root root lib drwxr-x--- elasticsearch elasticsearch elasticsearch
I hope your issue will be resolved.
I had the same issue on a CentOS7 cPanel server with ElasticSearch 7.8 installed via YUM. As per the answer, I did the following:
- Set
ES_JAVA_OPTS="-Djna.tmpdir=/var/lib/elasticsearch/tmp"
in/etc/sysconfig/elasticsearch
mkdir -p /var/lib/elasticsearch/tmp
chown -R elasticsearch.elasticsearch /var/lib/elasticsearch/tmp