我正在尝试在Centos 7上安装cassandra v3.0.2。我完全按照说明操作,我收到以下错误。只是重申我做了yum install jna,版本是/ usr / share / java中的4.0.0以及cassandra lib目录
下面是Stacktrace
*ERROR [MemtableFlushWriter:9] 2016-01-25 20:40:05,801 CassandraDaemon.java:195 - Exception in thread Thread[MemtableFlushWriter:9,5,main] java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native at org.apache.cassandra.utils.memory.MemoryUtil.allocate(MemoryUtil.java:95) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.io.util.Memory.(Memory.java:74) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.io.util.SafeMemory.(SafeMemory.java:32) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.io.compress.CompressionMetadata$Writer.(CompressionMetadata.java:316) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.io.compress.CompressionMetadata$Writer.open(CompressionMetadata.java:330) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.io.compress.CompressedSequentialWriter.(CompressedSequentialWriter.java:76) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.io.util.SequentialWriter.open(SequentialWriter.java:163) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.io.sstable.format.big.BigTableWriter.(BigTableWriter.java:73) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.io.sstable.format.big.BigFormat$WriterFactory.open(BigFormat.java:93) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.io.sstable.format.SSTableWriter.create(SSTableWriter.java:96) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.io.sstable.SimpleSSTableMultiWriter.create(SimpleSSTableMultiWriter.java:114) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.db.compaction.AbstractCompactionStrategy.createSSTableMultiWriter(AbstractCompactionStrategy.java:514) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.db.compaction.CompactionStrategyManager.createSSTableMultiWriter(CompactionStrategyManager.java:506) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.db.ColumnFamilyStore.createSSTableMultiWriter(ColumnFamilyStore.java:472) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.db.Memtable$FlushRunnable.createFlushWriter(Memtable.java:432) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.db.Memtable$FlushRunnable.writeSortedContents(Memtable.java:366) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.db.Memtable$FlushRunnable.runMayThrow(Memtable.java:352) ~[apache-cassandra-3.0.2.jar:3.0.2] at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28) ~[apache-cassandra-3.0.2.jar:3.0.2] at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:299) ~[guava-18.0.jar:na] at org.apache.cassandra.db.ColumnFamilyStore$Flush.run(ColumnFamilyStore.java:1037) ~[apache-cassandra-3.0.2.jar:3.0.2] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_66] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_66] at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_66]*
答案 0 :(得分:1)
这是/tmp的权限问题。显然/ tmp上的chmod为777不起作用。当我使用jna.jar运行示例程序时,我开始知道这一点,它清楚地打印出错误。显然我们使用centos -7硬化图像,这与正常的centos-7不同,因此也是我的问题。
为了解决这个问题,我移动了cassandra temp / output目录 /家/卡桑德拉。
但如果cassandra日志打印出来是/ tmp
的权限问题,那就太好了答案 1 :(得分:0)
以root用户身份运行Cassandra服务。问题将得到解决