Elasticsearch - JNA

问题

在Ubuntu下面启动Elasticsearch的时候提示如下错误:

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

详细错误:

flying-bird@flyingbird:~/elk$ ./elasticsearch-5.5.2/bin/elasticsearch -p my_cluster/node1_pid -Epath.conf=./my_cluster/node1/config
[2017-08-28T20:39:04,823][WARN ][o.e.b.Natives            ] 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 (...)
    at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:962) ~[jna-4.4.0.jar:4.4.0 (b0)]
    at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:922) ~[jna-4.4.0.jar:4.4.0 (b0)]
    at com.sun.jna.Native.<clinit>(Native.java:190) ~[jna-4.4.0.jar:4.4.0 (b0)]
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_05]
    at java.lang.Class.forName(Class.java:259) ~[?:1.8.0_05]
    at org.elasticsearch.bootstrap.Natives.<clinit>(Natives.java:45) [elasticsearch-5.5.2.jar:5.5.2]
    ...
[2017-08-28T20:39:04,829][WARN ][o.e.b.Natives            ] cannot check if running as root because JNA is not available
[2017-08-28T20:39:04,829][WARN ][o.e.b.Natives            ] cannot install system call filter because JNA is not available
[2017-08-28T20:39:04,830][WARN ][o.e.b.Natives            ] cannot register console handler because JNA is not available
[2017-08-28T20:39:04,832][WARN ][o.e.b.Natives            ] cannot getrlimit RLIMIT_NPROC because JNA is not available
[2017-08-28T20:39:04,832][WARN ][o.e.b.Natives            ] cannot getrlimit RLIMIT_AS beacuse JNA is not available
[2017-08-28T20:39:04,992][INFO ][o.e.n.Node               ] [node1] initializing ...

Ubuntu环境

flying-bird@flyingbird:~/elk/jna-jna-5.0.0$ uname -a
Linux flyingbird 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:20:08 UTC 2016 i686 i686 i686 GNU/Linux

解决办法

附 其他尝试

https://github.com/java-native-access/jna下载jna-jna-5.0.0.zip,使用jna-jna-5.0.0/dist/linux-x86.jar
和jna-jna-5.0.0/lib/native/linux-x86.jar,均不可用。

最后比较前面wget的文件,和jna-jna-5.0.0中所有的jar,发现这个文件和dist/jna.jar完全一样。

阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页