I am having Cassandra version 3.9 on CentOS 7. While starting Cassandra Server, I'm getting error like this::
TRACE [MemtableFlushWriter:1] 2017-05-15 04:25:49,735 LogTransaction.java:264 - Closing transaction log [mc_txn_flush_3f6a46f0-3961-11e7-87b4-0728ea39fb0d.log in /var/lib/cassandra/data/system/local-7ad54392bcdd35a684174e047860b377]
ERROR [main] 2017-05-15 04:25:49,745 CassandraDaemon.java:747 - Exception encountered during startup java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native at org.apache.cassandra.utils.FBUtilities.waitOnFuture(FBUtilities.java:403) ~[apache-cassandra-3.9.0.jar:3.9.0] at org.apache.cassandra.db.SystemKeyspace.forceBlockingFlush(SystemKeyspace.java:793) ~[apache-cassandra-3.9.0.jar:3.9.0] at org.apache.cassandra.db.SystemKeyspace.removeTruncationRecord(SystemKeyspace.java:639) ~[apache-cassandra-3.9.0.jar:3.9.0] at org.apache.cassandra.db.ColumnFamilyStore.invalidate(ColumnFamilyStore.java:541) ~[apache-cassandra-3.9.0.jar:3.9.0] at org.apache.cassandra.db.ColumnFamilyStore.invalidate(ColumnFamilyStore.java:517) ~[apache-cassandra-3.9.0.jar:3.9.0] at org.apache.cassandra.schema.LegacySchemaMigrator.lambda$unloadLegacySchemaTables$341(LegacySchemaMigrator.java:137) ~[apache-cassandra-3.9.0.jar:3.9.0] at org.apache.cassandra.schema.LegacySchemaMigrator$$Lambda$93/1308179535.accept(Unknown Source) ~[na:na] at java.lang.Iterable.forEach(Iterable.java:75) ~[na:1.8.0_45] at org.apache.cassandra.schema.LegacySchemaMigrator.unloadLegacySchemaTables(LegacySchemaMigrator.java:137) ~[apache-cassandra-3.9.0.jar:3.9.0] at org.apache.cassandra.schema.LegacySchemaMigrator.migrate(LegacySchemaMigrator.java:83) ~[apache-cassandra-3.9.0.jar:3.9.0] at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:254) [apache-cassandra-3.9.0.jar:3.9.0] at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:601) [apache-cassandra-3.9.0.jar:3.9.0] at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:730) [apache-cassandra-3.9.0.jar:3.9.0]
There is a solution to this problem ( Cassandra Startup failure on ARM64 machine (java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native) ), Soultion suggests changes in cassandra-env.sh. I tried it but it is not working for me.
I checked with these options (separately) in cassandra-env.sh
JVM_OPTS="$JVM_OPTS -Djava.io.tmpdir=/home/tech/cassandra/tmp"
JVM_OPTS="$JVM_OPTS -Djava.io.tmpdir=/home/cassandra/tmp"
JVM_OPTS="$JVM_OPTS -Djava.io.tmpdir=/var/lib/cassandra/tmp"
even tried with
JVM_OPTS="$JVM_OPTS -Dcassandra.boot_without_jna=true"
But no change in the problem.
And I changed cassandra logger to TRACE, but it is showing the same error log as before there was no TRACE. The file(jna-4.0.0.jar) is present in lib folder (/usr/share/cassandra/lib). I am unable to find what the actual reason is.
The reasons for not working for me are like:
- cassandra-env.sh is loaded by server. (If it loading how do I check, whether it is loaded or not)
- There might be some other problem.
Someone, Please let me out from this.
4条答案
按热度按时间vc6uscn91#
最后是jna-4.0.0.jar的问题。
lib中的文件jna-4.0.0.jar没有初始化,所以我通过创建到jna.jar的符号链接来更改该文件。
然后,它产生了一些关于tmp的错误,使用之前的解决方案解决。
关于南国防军,那里已经有一些问题,但这些问题并不具体。
2ekbmq322#
我遇到了同样的问题。清理(rm-rf *)/tmp文件夹或'-Djava.io.tmpdir'指向的文件夹
xmq68pz93#
在我升级了Java之后, cassandra 无法启动。我已经修好了。
2.将以下参数添加到文件/cassandra-env.shJVM_OPTS="$JVM_OPTS -Djava.io.tmpdir=/var/lib/cassandra/tmp”的末尾
然后重新启动Cassandra。
8i9zcol24#
对于那些未来的人...
我在system.log文件中看到NoClassDefFound。
我尝试了临时更改,但没有效果。然后我查看了
我看到
以便我能有所帮助。