错误信息
Failed to load native Mesos library from /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
[2018-12-29 10:37:29,358] ERROR Terminating 8080 due to uncaught exception in thread JMX exporting thread:1 (mesosphere.marathon.MarathonApp:JMX exporting thread)
java.lang.UnsatisfiedLinkError: no mesos in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at org.apache.mesos.MesosNativeLibrary.load(MesosNativeLibrary.java:163)
at org.apache.mesos.MesosNativeLibrary.load(MesosNativeLibrary.java:188)
at mesosphere.mesos.LibMesos$.version$lzycompute(LibMesos.scala:25)
at mesosphere.mesos.LibMesos$.version(LibMesos.scala:23)
at mesosphere.mesos.LibMesos$.isCompatible(LibMesos.scala:41)
at mesosphere.marathon.MarathonApp.start(Main.scala:107)
at mesosphere.marathon.Main$.main(Main.scala:206)
at mesosphere.marathon.Main.main(Main.scala)
原因是找不到libmesos.so库
解决方案
修改/etc/profile文件
1.修改/etc/profile
sudo vi /etc/profile
export MESOS_NATIVE_JAVA_LIBRARY=/usr/local/lib/libmesos.so
2.使修改生效
source /etc/profile
拷贝libmesos.so
拷贝libmesos.so到下面任一目录:
- /usr/java/packages/lib/amd64
- /usr/lib64
- /lib64
- /lib
- /usr/lib
参考资料:https://stackoverflow.com/questions/43492687/java-lang-unsatisfiedlinkerror-no-mesos-in-java-library-path