Cassandra - 无法启动,错误 "Insufficient disk space to write 572 bytes"

Cassandra - failure to start, with error "Insufficient disk space to write 572 bytes"

我在尝试启动 Cassandra 时遇到此错误。我在 /var/log/cassandra/var/lib/cassandra 上 运行 rm -rf *,并再次尝试 运行 cassandra,但没有成功。任何的想法?我一直在寻找类似的案例,但不是在 Cassandra 发布时,我发现没有任何东西可以帮助我解决这个问题。

root@test # cassandra
(...)
16:38:38.551 [MemtableFlushWriter:1] ERROR o.a.c.service.CassandraDaemon - Exception in thread Thread[MemtableFlushWriter:1,5,main]
java.lang.RuntimeException: Insufficient disk space to write 572 bytes
        at org.apache.cassandra.db.Directories.getWriteableLocation(Directories.java:349) ~[apache-cassandra-2.2.7.jar:2.2.7]
        at org.apache.cassandra.db.Memtable.flush(Memtable.java:324) ~[apache-cassandra-2.2.7.jar:2.2.7]
        at org.apache.cassandra.db.ColumnFamilyStore$Flush.run(ColumnFamilyStore.java:1165) ~[apache-cassandra-2.2.7.jar:2.2.7]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_65]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_65]
        at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_65]
16:38:41.785 [ScheduledTasks:1] INFO  o.a.cassandra.locator.TokenMetadata - Updating topology for all endpoints that have changed

仅供参考,如果我稍后再次尝试 运行 cassandra,我会得到

[main] ERROR o.a.c.service.CassandraDaemon - Port already in use: 7199; nested exception is:
        java.net.BindException: Address already in use

看来"CassandraDaemon"还活着;但是如果我想 运行 cqlsh 我得到这个错误:

root@test # cqlsh
Warning: custom timestamp format specified in cqlshrc, but local timezone could not be detected.
Either install Python 'tzlocal' module for auto-detection or specify client timezone in your cqlshrc.

Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})

最后,free -m命令给了我

              total        used        free      shared  buff/cache   available
Mem:          15758        8308         950        1440        6499        5576
Swap:          4095        2135        1960

感谢您的帮助!

编辑:这是我在 Cassandra 启动期间收到的 WARN 消息:

11:36:14.622 [main] WARN  o.a.c.config.DatabaseDescriptor - Small commitlog volume detected at /var/lib/cassandra/commitlog; setting commitlog_total_space_in_mb to 2487.  You can override this in cassandra.yaml
11:36:14.623 [main] WARN  o.a.c.config.DatabaseDescriptor - Only 17 MB free across all data volumes. Consider adding more capacity to your cluster or removing obsolete snapshots
11:36:14.943 [main] WARN  o.a.cassandra.service.StartupChecks - jemalloc shared library could not be preloaded to speed up memory allocations
11:36:14.943 [main] WARN  o.a.cassandra.service.StartupChecks - JMX is not enabled to receive remote connections. Please see cassandra-env.sh for more info.
11:36:14.943 [main] WARN  o.a.cassandra.service.StartupChecks - OpenJDK is not recommended. Please upgrade to the newest Oracle Java release
11:36:14.954 [main] WARN  o.a.cassandra.utils.SigarLibrary - Cassandra server running in degraded mode. Is swap disabled? : false,  Address space adequate? : true,  nofile limit adequate? : false, nproc limit adequate? : true

正如我在之前的评论中所说,问题似乎是由 /var 文件夹达到其限制大小引发的,因为我用于摄取数据的 Nifi 在我的配置中生成了大日志。因此,删除无用的日志并密切关注 /var 文件夹似乎可以防止错误。