Unable to load JNA native support library Elasticsearch 6.x

后端 未结 7 1394
不知归路
不知归路 2020-12-16 02:22

I have installed Elasticsearch 6.x in my Debian 7 (wheezy). I tried to start with service elasticsearch start but its give me an error message

相关标签:
7条回答
  • 2020-12-16 03:08

    Check the permissions on your /tmp/ directory. It must have had noexec.

    /tmp needs exec to support JNA. A workaround is to specify a tmp directory in elasticsearch sysconfig file.

    Something like export JAVA_OPTS="-Djava.io.tmpdir=$ES_HOME/tmp"

    Make sure there is a $ES_HOME/tmp directory and elasticsearch user has write permissions to it.

    I had this issue as I was using a hardened OS and also because the default umask is 0027.

    0 讨论(0)
  • 2020-12-16 03:16

    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:

    1. Set ES_JAVA_OPTS="-Djna.tmpdir=/var/lib/elasticsearch/tmp" in /etc/sysconfig/elasticsearch
    2. mkdir -p /var/lib/elasticsearch/tmp
    3. chown -R elasticsearch.elasticsearch /var/lib/elasticsearch/tmp
    0 讨论(0)
  • 2020-12-16 03:18

    On Ubuntu 18.04, the solution was

    sudo systemctl edit --full elasticsearch.service

    adding a line

    Environment=ES_JAVA_OPTS="-Djava.io.tmpdir=/var/lib/elasticsearch/tmp"

    exitting with -x as in vi

    restarting the service

    sudo systemctl restart elasticsearch.service

    0 讨论(0)
  • 2020-12-16 03:20
    1. Go to /etc/sysconfig/elasticsearch
    2. Add ES_JAVA_OPTS="-Djna.tmpdir=/var/lib/elasticsearch/tmp".

      (For newer Elasticsearch, use Djava.io.tmpdir 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
    7. 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.

    0 讨论(0)
  • 2020-12-16 03:20

    For me below worked:

    PUT your_index_name/_settings
        {
        "index": {
        "blocks": {
        "read_only_allow_delete": "false"
        }
        }
        }
    

    I followed below link:

    https://discuss.elastic.co/t/forbidden-12-index-read-only-allow-delete-api/110282/4

    0 讨论(0)
  • 2020-12-16 03:22

    Okay i have find the solution. Apparently my vm memory storage (RAM) was 1 GB - 2 GB, so i increase my VM's RAM capacity to at least 4GB and i reboot the machine. And elastic search started work just fine.

    0 讨论(0)
提交回复
热议问题