Elasticsearch

Centos 上的 Elasticsearch 出現“無法載入 jna”錯誤

  • June 15, 2017

解決方案是什麼?

在 Centos 6.8 上新安裝 elasticsearch 5.4.1

[2017-06-15T13:54:19,140][WARN ][o.e.b.Natives            ] unable to load JNA n
ative support library, native methods will be disabled.
java.lang.UnsatisfiedLinkError: /tmp/jna--1985354563/jna5608110195315969032.tmp:
/tmp/jna--1985354563/jna5608110195315969032.tmp: failed to map segment from sha
red object: Operation not permitted
       at java.lang.ClassLoader$NativeLibrary.load(Native Method) ~[?:1.8.0_131
]
       at java.lang.ClassLoader.loadLibrary0(Unknown Source) ~[?:1.8.0_131]
       at java.lang.ClassLoader.loadLibrary(Unknown Source) ~[?:1.8.0_131]
       at java.lang.Runtime.load0(Unknown Source) ~[?:1.8.0_131]
       at java.lang.System.load(Unknown Source) ~[?:1.8.0_131]
       at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java
:947) ~[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 (b
0)]
       at java.lang.Class.forName0(Native Method) ~[?:1.8.0_131]
       at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_131]
       at org.elasticsearch.bootstrap.Natives.<clinit>(Natives.java:45) [elasti
csearch-5.4.1.jar:5.4.1]
       at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.jav
a:105) [elasticsearch-5.4.1.jar:5.4.1]

解決了這個。

/tmp 已安裝 noexec。

更新 /etc/fstab 以掛載 /tmp w exec,此問題已解決。

部分討論在這裡 https://github.com/elastic/elasticsearch/issues/18406

引用自:https://unix.stackexchange.com/questions/371376