无法启动cassandra

时间:2017-06-19 13:39:46

标签: java cassandra

我遇到了Cassandra的问题,每当我尝试启动Cassandra时,我都会收到太多文件错误。

我已将文件描述符增加到1000000,仍然是同样的错误。

[增订]

我查看了调试日志,开始时它正在打开许多sstables。这是日志

DEBUG [SSTableBatchOpen:2] 2017-06-20 11:03:40,635 SSTableReader.java:479 - Opening / cassandra / cass / data / system / IndexInfo-9f5c6374d48532299a0a5094af9ad1e3 / mc-159921-big(60 bytes) DEBUG [SSTableBatchOpen:1] 2017-06-20 11:03:40,635 SSTableReader.java:479 - Opening / cassandra / cass / data / system / IndexInfo-9f5c6374d48532299a0a5094af9ad1e3 / mc-166961-big(49 bytes) DEBUG [SSTableBatchOpen:4] 2017-06-20 11:03:40,635 SSTableReader.java:479 - Opening / cassandra / cass / data / system / IndexInfo-9f5c6374d48532299a0a5094af9ad1e3 / mc-181150-big(57 bytes) DEBUG [SSTableBatchOpen:3] 2017-06-20 11:03:40,635 SSTableReader.java:479 - Opening / cassandra / cass / data / system / IndexInfo-9f5c6374d48532299a0a5094af9ad1e3 / mc-188190-big(49 bytes) DEBUG [SSTableBatchOpen:2] 2017-06-20 11:03:40,635 SSTableReader.java:479 - Opening / cassandra / cass / data / system / IndexInfo-9f5c6374d48532299a0a5094af9ad1e3 / mc-173741-big(54 bytes) DEBUG [SSTableBatchOpen:1] 2017-06-20 11:03:40,635 SSTableReader.java:479 - Opening / cassandra / cass / data / system / IndexInfo-9f5c6374d48532299a0a5094af9ad1e3 / mc-159987-big(45 bytes) DEBUG [SSTableBatchOpen:3] 2017-06-20 11:03:40,635 SSTableReader.java:479 - Opening / cassandra / cass / data / system / IndexInfo-9f5c6374d48532299a0a5094af9ad1e3 / mc-167027-big(49 bytes) DEBUG [SSTableBatchOpen:4] 2017-06-20 11:03:40,635 SSTableReader.java:479 - Opening / cassandra / cass / data / system / IndexInfo-9f5c6374d48532299a0a5094af9ad1e3 / mc-198208-big(53 bytes) DEBUG [SSTableBatchOpen:1] 2017-06-20 11:03:40,636 SSTableReader.java:479 - Opening / cassandra / cass / data / system / IndexInfo-9f5c6374d48532299a0a5094af9ad1e3 / mc-177001-big(48 bytes) DEBUG [SSTableBatchOpen:2] 2017-06-20 11:03:40,636 SSTableReader.java:479 - Opening / cassandra / cass / data / system / IndexInfo-9f5c6374d48532299a0a5094af9ad1e3 / mc-184041-big(57 bytes) 以下是系统日志:

ERROR [SSTableBatchOpen:1] 2017-06-19 19:08:40,175 CassandraDaemon.java:205 - Exception in thread Thread[SSTableBatchOpen:1,5,main]
java.lang.RuntimeException: java.io.FileNotFoundException: /cassandra/cass/data/crownit/activitylog-60fcc250bc7211e6995a87b62bcc4eac/.controller_idx/mc-1033-big-CompressionInfo.db (Too many open files)
        at org.apache.cassandra.io.compress.CompressionMetadata.<init>(CompressionMetadata.java:127) ~[apache-cassandra-3.0.9.jar:3.0.9]
        at org.apache.cassandra.io.compress.CompressionMetadata.create(CompressionMetadata.java:91) ~[apache-cassandra-3.0.9.jar:3.0.9]
        at org.apache.cassandra.io.util.CompressedSegmentedFile$Builder.metadata(CompressedSegmentedFile.java:125) ~[apache-cassandra-3.0.9.jar:3.0.9]
        at org.apache.cassandra.io.util.CompressedSegmentedFile$Builder.complete(CompressedSegmentedFile.java:132) ~[apache-cassandra-3.0.9.jar:3.0.9]
        at org.apache.cassandra.io.util.SegmentedFile$Builder.complete(SegmentedFile.java:177) ~[apache-cassandra-3.0.9.jar:3.0.9]
        at org.apache.cassandra.io.util.SegmentedFile$Builder.buildData(SegmentedFile.java:193) ~[apache-cassandra-3.0.9.jar:3.0.9]
        at org.apache.cassandra.io.sstable.format.SSTableReader.load(SSTableReader.java:745) ~[apache-cassandra-3.0.9.jar:3.0.9]
        at org.apache.cassandra.io.sstable.format.SSTableReader.load(SSTableReader.java:706) ~[apache-cassandra-3.0.9.jar:3.0.9]
        at org.apache.cassandra.io.sstable.format.SSTableReader.open(SSTableReader.java:492) ~[apache-cassandra-3.0.9.jar:3.0.9]
        at org.apache.cassandra.io.sstable.format.SSTableReader.open(SSTableReader.java:375) ~[apache-cassandra-3.0.9.jar:3.0.9]
        at org.apache.cassandra.io.sstable.format.SSTableReader$4.run(SSTableReader.java:534) ~[apache-cassandra-3.0.9.jar:3.0.9]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_101]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_101]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_101]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_101]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
Caused by: java.io.FileNotFoundException: /cassandra/cass/data/crownit/activitylog-60fcc250bc7211e6995a87b62bcc4eac/.controller_idx/mc-1033-big-CompressionInfo.db (Too many open files)
        at java.io.FileInputStream.open0(Native Method) ~[na:1.8.0_101]
        at java.io.FileInputStream.open(FileInputStream.java:195) ~[na:1.8.0_101]
        at java.io.FileInputStream.<init>(FileInputStream.java:138) ~[na:1.8.0_101]
        at java.io.FileInputStream.<init>(FileInputStream.java:93) ~[na:1.8.0_101]
        at org.apache.cassandra.io.compress.CompressionMetadata.<init>(CompressionMetadata.java:100) ~[apache-cassandra-3.0.9.jar:3.0.9]
        ... 15 common frames omitted
ERROR [SSTableBatchOpen:1] 2017-06-19 19:08:40,177 JVMStabilityInspector.java:140 - JVM state determined to be unstable.  Exiting forcefully due to:
java.io.FileNotFoundException: /cassandra/cass/data/crownit/activitylog-60fcc250bc7211e6995a87b62bcc4eac/.controller_idx/mc-1033-big-CompressionInfo.db (Too many open files)

1 个答案:

答案 0 :(得分:0)

由于我无法评论上一个答案,这里有一个小提示:

你的cassandra是如何开始的?它是如何安装的?您的ulimit更改可能不会影响用户cassandra运行(在数据目录中使用ls -l进行双重检查以查看文件中的人员)。使用debian包,cassandra以用户cassandra运行,限制设置为

cassandra01:/etc$ cat security/limits.d/cassandra.conf
# Provided by the cassandra package
cassandra  -  memlock  unlimited
cassandra  -  nofile   100000
cassandra  -  as       unlimited
cassandra  -  nproc    8096
cassandra01:/etc$

您的数据目录中有多少个sstables?

尝试通过以下方式找出崩溃的文件数量:

lsof -n | grep java