Linux下安装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 ...

原 因 :是因为jna版本问题!(也可能jdk版本原因)

解决方法:删除elasticsearch/bin文件下的jna的jar包(我的是4.5.1版本),采用4.4.0版本

mv jna-4.5.1.jar jna-4.5.1.jar.bak 

下载jna4.4.0版本,链接:

 https://www.mvnjar.com/net.java.dev.jna/jna/4.4.0/detail.html

由于我执行下载命令报501错误没有解决(有大佬帮解决一下做好啦),所以采用此种方法!

再次执行就可以成功啦!

参阅文章:https://blog.csdn.net/a_flying_bird/article/details/77657803#comments

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值