gpt4 book ai didi

java - Apache Cassandra 启动失败 : FSWriteError (. ..) 不允许操作

转载 作者:搜寻专家 更新时间:2023-10-30 21:22:52 24 4
gpt4 key购买 nike

出于测试目的,我设置了一个带有两个节点的小型 Cassandra 集群。在第二个节点上启动 Cassandra 时出现此异常:

INFO  [main] 2014-11-05 11:49:10,253 AutoSavingCache.java:123 - reading saved cache /var/lib/cassandra/saved_caches/system-local-7ad54392bcdd35a684174e047860b377-KeyCache-b.db
ERROR [main] 2014-11-05 11:49:10,855 CassandraDaemon.java:460 - Exception encountered during startup
org.apache.cassandra.io.FSWriteError: java.nio.file.FileSystemException: /var/lib/cassandra/data/system/compactions_in_progress-55080ab05d9c388690a4acb25fe1f77b/snapshots/1415184550829-compactions_in_progress/system-compactions_in_progress-ka-2-Summary.db -> /var/lib/cassandra/data/system/compactions_in_progress-55080ab05d9c388690a4acb25fe1f77b/system-compactions_in_progress-ka-2-Summary.db: Die Operation ist nicht erlaubt
at org.apache.cassandra.io.util.FileUtils.createHardLink(FileUtils.java:98) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.io.sstable.SSTableReader.createLinks(SSTableReader.java:1728) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.ColumnFamilyStore.snapshotWithoutFlush(ColumnFamilyStore.java:2158) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.ColumnFamilyStore.snapshot(ColumnFamilyStore.java:2215) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.ColumnFamilyStore.snapshot(ColumnFamilyStore.java:2209) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.ColumnFamilyStore$10.run(ColumnFamilyStore.java:2449) ~[apache-cassandra-2.1.1.jar:2.1.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[na:1.7.0_65]
at org.apache.cassandra.db.ColumnFamilyStore.runWithCompactionsDisabled(ColumnFamilyStore.java:2515) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.ColumnFamilyStore.truncateBlocking(ColumnFamilyStore.java:2462) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.SystemKeyspace.discardCompactionsInProgress(SystemKeyspace.java:267) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:234) [apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:443) [apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:532) [apache-cassandra-2.1.1.jar:2.1.1]
Caused by: java.nio.file.FileSystemException: /var/lib/cassandra/data/system/compactions_in_progress-55080ab05d9c388690a4acb25fe1f77b/snapshots/1415184550829-compactions_in_progress/system-compactions_in_progress-ka-2-Summary.db -> /var/lib/cassandra/data/system/compactions_in_progress-55080ab05d9c388690a4acb25fe1f77b/system-compactions_in_progress-ka-2-Summary.db: Die Operation ist nicht erlaubt
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91) ~[na:1.7.0_65]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.7.0_65]
at sun.nio.fs.UnixFileSystemProvider.createLink(UnixFileSystemProvider.java:475) ~[na:1.7.0_65]
at java.nio.file.Files.createLink(Files.java:1039) ~[na:1.7.0_65]
at org.apache.cassandra.io.util.FileUtils.createHardLink(FileUtils.java:94) ~[apache-cassandra-2.1.1.jar:2.1.1]
... 12 common frames omitted

我知道通过删除/var/lib/cassandra/data/中的键空间,不会再抛出异常,Cassandra 会启动。但必须有一个更清洁的解决方案。

最佳答案

大多数情况下,当您通常使用名为例如 cassandra 的特殊低权限用户启动 cassandra 时,就会发生这种情况。但是上次你以 root 身份启动 cassandra。

现在您有一些文件/文件夹归 root 所有,cassandra 用户无法访问。

要解决这个问题,您只需要以 root 身份运行(如果 cassandra 是那个低权限用户):
chown -R cassandra:cassandra/var/lib/cassandra/data/*

这样做之后,cassandra 应该可以正常启动。

关于java - Apache Cassandra 启动失败 : FSWriteError (. ..) 不允许操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26756471/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com