Repository navigation
Elasticsearch 6+ packages are missing libjnidispatch.so which means only able to bind ES to localhost. #93
Copy link
Copy link
Closed
Description
Activity
- changed the title
[-]Elasticseearch 6+ packages are missing libjnidispatch.so which means only able to bind ES to localhost. [/-][+]Elasticsearch 6+ packages are missing libjnidispatch.so which means only able to bind ES to localhost. [/+]on Apr 2, 2018 Thanks for the report. I'll have the elasticsearch package pull the sources for JNA and build the lib file from source rather than fetch it.
Point to note also if needing to bind to other than localhost is that Elasticsearch requires java options to be the same. This is part of the checks ES does and as such need to adjust the service manifest from :
<propval name='min_heap' type='astring' value='256m' /> <propval name='max_heap' type='astring' value='1g' />to:
<propval name='min_heap' type='astring' value='1g' /> <propval name='max_heap' type='astring' value='1g' />This is naturally a configurable the user can set. Its not a bug but just including it here for reference.
Thanks for the heads up. The docs suggest the heap size should be uniform for best performance too, so I'll set both values to 1g now.
I've backported this feature to 2017Q4.
Reacted by Gavin Will- added a commit that references this issue
on Mar 26, 2019 - added 2 commits that reference this issue
on Dec 12, 2019 - added a commit that references this issue
on Mar 22, 2020 - added a commit that references this issue
on Jun 7, 2020 90 remaining items
- added 8 commits that reference this issue
on May 14, 2026 - added a commit that references this issue
on Jun 2, 2026 - added a commit that references this issue
on Jun 12, 2026 - added a commit that references this issue
on Jul 4, 2026 - added a commit that references this issue
on Aug 3, 2026
Metadata
Metadata
Assignees
Labels
No labels
Hi.
Elasticsearch 6.1 package will by default try to bind to localhost unless the elasticsearch.yml file is modified. For testing and single node "cluster" this is fine. However when using a multi node cluster we naturally need for Elasticsearch to bind to an address other than localhost to allow inter node communication.
When changing the elasticsearch.yml file and restarting the service we see the errors in the logs:
unable to load JNA native support library, native methods will be disabled.Elasticsearch service will not start up unless we change the config back to bind to localhost.
With the Elasticsearch 6.1 package there is a jar supplied jna-4.4.0-1.jar locate at /opt/local/lib/elasticsearch/lib which does not contain the required files for smartos and JNA to function (and as such to enable ES to bind to anything other than localhost).
Looking at the contents of JNA we can see the following:
We can manually update this jna-4.4.0-1.orig.jar file by extracting the contents, obtaining a prebuilt binary of the libjnidispatch.so for sunos and bundling the new jar together.
Extract the jar: jar xf jna-4.4.0-1.jar
Obtain prebuilt binary for sunos / smartos via: https://github.com/java-native-access/jna/blob/master/lib/native/sunos-x86-64.jar
Extract sunos-x86-64.jar jar file to obtain libjnidispatch.so
Move libjnidispatch.so into a new folder under com/sun/jna/ called sunos-x86-64
Bundle the jar up again with jar cf jna-4.4.0-1.jar com/
Sanity check the new jar to see the file is present in the new jar ok:
At this point if we change elasticsearch config to listen to anything other that localhost the service will start up fine and inter node comms between nodes in an Elasticsearch cluster will function fine.
curl 10.24.100.189:9200
We see the same problem in the trunk version of Elasticsearch version 6.2.2 but with a slight variation. We see that sunos is included in the jar file but x86 is not.