解决ubuntu安装es unable to load JNA native support library, native methods will be disabled.

今天尝试着自己在服务器安装elasticsearch,刚开始根据官网下载压缩包解压,然后执行shell文件,可是出现了如下错误。

注意:这个解决方法只适用于解决ubuntu系统。其他系统,小伙伴再继续查找。

 unable to load JNA native support library, native methods will be disabled.
java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/linux-x86/libjnidispatch.so) not found in resource path ([file:/usr/share/elasticsearch/lib/HdrHistogram-2.1.9.jar, file:/usr/share/elasticsearch/lib/elasticsearch-5.6.3.jar, file:/usr/share/elasticsearch/lib/hppc-0.7.1.jar, file:/usr/share/elasticsearch/lib/jackson-core-2.8.6.jar, file:/usr/share/elasticsearch/lib/jackson-dataformat-cbor-2.8.6.jar, file:/usr/share/elasticsearch/lib/jackson-dataformat-smile-2.8.6.jar, file:/usr/share/elasticsearch/lib/jackson-dataformat-yaml-2.8.6.jar, file:/usr/share/elasticsearch/lib/java-version-checker-5.6.3.jar, file:/usr/share/elasticsearch/lib/jna-4.4.0-1.jar, file:/usr/share/elasticsearch/lib/joda-time-2.9.5.jar, file:/usr/share/elasticsearch/lib/jopt-simple-5.0.2.jar, file:/usr/share/elasticsearch/lib/jts-1.13.jar, file:/usr/share/elasticsearch/lib/log4j-1.2-api-2.9.1.jar, file:/usr/share/elasticsearch/lib/log4j-api-2.9.1.jar, file:/usr/share/elasticsearch/lib/log4j-core-2.9.1.jar, file:/usr/share/elasticsearch/lib/lucene-analyzers-common-6.6.1.jar, file:/usr/share/elasticsearch/lib/lucene-backward-codecs-6.6.1.jar, file:/usr/share/elasticsearch/lib/lucene-core-6.6.1.jar, file:/usr/share/elasticsearch/lib/lucene-grouping-6.6.1.jar, file:/usr/share/elasticsearch/lib/lucene-highlighter-6.6.1.jar, file:/usr/share/elasticsearch/lib/lucene-join-6.6.1.jar, file:/usr/share/elasticsearch/lib/lucene-memory-6.6.1.jar, file:/usr/share/elasticsearch/lib/lucene-misc-6.6.1.jar, file:/usr/share/elasticsearch/lib/lucene-queries-6.6.1.jar, file:/usr/share/elasticsearch/lib/lucene-queryparser-6.6.1.jar, file:/usr/share/elasticsearch/lib/lucene-sandbox-6.6.1.jar, file:/usr/share/elasticsearch/lib/lucene-spatial-6.6.1.jar, file:/usr/share/elasticsearch/lib/lucene-spatial-extras-6.6.1.jar, file:/usr/share/elasticsearch/lib/lucene-spatial3d-6.6.1.jar, file:/usr/share/elasticsearch/lib/lucene-suggest-6.6.1.jar, file:/usr/share/elasticsearch/lib/plugin-cli-5.6.3.jar, file:/usr/share/elasticsearch/lib/securesm-1.1.jar, file:/usr/share/elasticsearch/lib/snakeyaml-1.15.jar, file:/usr/share/elasticsearch/lib/spatial4j-0.6.jar, file:/usr/share/elasticsearch/lib/t-digest-3.0.jar])
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:962) ~[jna-4.4.0-1.jar:4.4.0 (b0)]
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:922) ~[jna-4.4.0-1.jar:4.4.0 (b0)]
at com.sun.jna.Native.(Native.java:190) ~[jna-4.4.0-1.jar:4.4.0 (b0)]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_152]
at java.lang.Class.forName(Class.java:264) ~[?:1.8.0_152]
at org.elasticsearch.bootstrap.Natives.(Natives.java:45) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:105) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:195) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) [elasticsearch-5.6.3.jar:5.6.3]

通过查看官网里给的提示信息 https://discuss.elastic.co/t/new-install-unable-to-load-jna-native-support-library/106738,给出的解释是我的机器是32位,我的安装包是64位,出现异常。

解决ubuntu安装es unable to load JNA native support library, native methods will be disabled._第1张图片

通过sudo uname --m查看,出现i686,果不其然我的机器是32位的。

解决ubuntu安装es unable to load JNA native support library, native methods will be disabled._第2张图片

此时我的解决方法是在ubuntu中,sudo apt-get install elasticsearch,使用系统命令安装es。

 

你可能感兴趣的:(解决ubuntu安装es unable to load JNA native support library, native methods will be disabled.)