我从其他帖子中了解到,如果JNA配置不正确,Cassandra会在日志文件中写一些警告。我的日志文件(cassandra.log和system.log)不包含单词" jna" (所有案例检查)。我可以假设为我的Cassandra实例正确配置了JNA吗?
有没有办法检查JNA配置是否正确?
答案 0 :(得分:6)
如果JNA配置正确,您应该在日志中看到如下消息:
INFO [main] 2014-06-06 15:55:11,664 CLibrary.java (line 121) JNA mlockall successful
同样在您的日志中,JNA库应该出现在类路径输出中:
INFO [main] 2014-06-06 16:47:13,318 CassandraDaemon.java (line 191) Classpath:...
....:/usr/share/java/jna.jar:
答案 1 :(得分:4)
如果JNA错过,下面是显示错误的代码:
try
{
Native.register("c");
}
catch (NoClassDefFoundError e)
{
logger.warn("JNA not found. Native methods will be disabled.");
jnaAvailable = false;
}
catch (UnsatisfiedLinkError e)
{
logger.warn("JNA link failure, one or more native method will be unavailable.");
logger.debug("JNA link failure details: {}", e.getMessage());
}
catch (NoSuchMethodError e)
{
logger.warn("Obsolete version of JNA present; unable to register C library. Upgrade to JNA 3.2.7 or later");
jnaAvailable = false;
}
所以只需grep你的日志以获取上述其中一项。