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
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.
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:
ES_JAVA_OPTS="-Djna.tmpdir=/var/lib/elasticsearch/tmp" in /etc/sysconfig/elasticsearchmkdir -p /var/lib/elasticsearch/tmpchown -R elasticsearch.elasticsearch /var/lib/elasticsearch/tmpOn 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
/etc/sysconfig/elasticsearchAdd ES_JAVA_OPTS="-Djna.tmpdir=/var/lib/elasticsearch/tmp".
(For newer Elasticsearch, use Djava.io.tmpdir instead of Djna.tmpdir)
systemctl start elasticsearch or service start elasticsearch.tmp folder created inside /var/lib/elasticsearch/.elasticsearch useri -l /var/lib/elasticsearchMake 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.
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
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.