Elasticsearch 2.0 warning: JNA is not available

Hi,

I'm evaluating Elasticsearch for a project and since 2.0 was released just now I thought why not upgrade my installation.
I have two questions:

Question 1: In my log file, I see the following on startup:

[2015-10-29 23:50:57,024][WARN ][bootstrap ] cannot check if running as root because JNA is not available
[2015-10-29 23:50:57,024][WARN ][bootstrap ] cannot mlockall because JNA is not available
[2015-10-29 23:50:57,025][WARN ][bootstrap ] cannot register console handler because JNA is not available

This was not the case before and I had mlockall working in 1.7. I'm not really a java guy, what am I doing wrong? java -version outputs the following:

xyz@localhost:/etc/init.d# java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

Question 2: I previously read that the tmpdir has to be executable in order for mlockall to work and this was my experience as well with Elasticsearch 1.7. As far as I know /tmp/ is noexec on Ubuntu by default, or at least in my experience. The solution I found online for this problem was -Djna.tmpdir=/var/elasticsearch_tmp in the init.d script which appeared to fix my problem as mlockall was working properly. However, I'd really like to not have to edit the init.d script so that upgrades work in a clearner way - is there some way to inject another tmpdir in a better way?

I think we should just set java.io.tmpdir explicitly and not use the system temp folder: https://github.com/elastic/elasticsearch/issues/14372

I solved this in my test environment by running:

mount -o remount,exec /tmp

However, my solution for 1.7 which was
-Djna.tmpdir=/var/elasticsearch_tmp

does not seem to work on elasticsearch 2.0, even though it is mentioned here: https://www.elastic.co/guide/en/elasticsearch/reference/2.0/setup-configuration.html

Even though I had it in my init script, it was still complaining about operation not permitted on /tmp/.

Another thing I noticed is that if elasticsearch.yml cannot be parsed then elasticsearch just refuses to start with absolutely nothing in the error log. That's really annoying. Especially since it is not obvious here: https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html that values need to be quoted to work.

I had the same issue and managed to sort that out without remounting /tmp with exec option -- I set

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

in /etc/sysconfig/elasticsearch. It looks like jna.tmpdir is ignored at all; I tried setting it, as well as java.io.tmpdir in elasticsearch.service file (I'm on systemd), but that stopped working in ES 2.0.

The strange thing is that this works only on my master/data nodes -- if I set this option on client node, it doesn't start at all.

It is much safer not to mount /tmp exec.