由于accessdeniedexception,Cassandra无法启动

时间:2019-09-24 07:36:43

标签: ubuntu cassandra cql cassandra-node-driver

尝试启动Cassandra时,我不断收到以下错误消息:

  

警告[MemtableFlushWriter:1] 2019-09-23 20:52:14,452   LogReplicaSet.java:220-无法将记录添加到副本中:   java.nio.file.AccessDeniedException:   /data/cassandra/data/system/local-7ad54392bcdd35a684174e047860b377/mc_txn_flush_05936940-de44-11e9-9dfb-251fcce05198.log   错误[MemtableFlushWriter:1] 2019-09-23 20:52:14,457   ColumnFamilyStore.java:1183-冲洗   Memtable-local @ 1437882581(0.334KiB序列化字节,2个操作,占0%/ 0%   堆上/堆外限制)失败,错误为java.lang.RuntimeException:   java.nio.file.AccessDeniedException:   /data/cassandra/data/system/local-7ad54392bcdd35a684174e047860b377/mc_txn_flush_05936940-de44-11e9-9dfb-251fcce05198.log

1 个答案:

答案 0 :(得分:0)

放弃实体化视图后,我遇到了同样的情况。查找目录权限。您将看到该目录,并且schema.cql将具有root的所有权。

$ ls -la /data/cassandra/data/<keyspace>/<keyspace>-6d7291801cd811ea84aedd85165df9d2/snapshots/analyse-LFDBFUZCMGCMGKHFYAFW/
drwxr-xr-x 3 root      root             4096 Mar 26 19:58 .
drwxr-xr-x 4 cassandra cassandra      241664 Mar 27 03:11 ..
-rw-r--r-- 2 cassandra cassandra          92 Mar 26 13:46 md-7426-big-TOC.txt
-rw-r--r-- 2 cassandra cassandra        2435 Mar 26 14:29 md-7427-big-CompressionInfo.db
-rw-r--r-- 2 cassandra cassandra    12025128 Mar 26 14:29 md-7427-big-Data.db
-rw-r--r-- 2 cassandra cassandra          10 Mar 26 14:29 md-7427-big-Digest.crc32
-rw-r--r-- 2 cassandra cassandra       66056 Mar 26 14:29 md-7427-big-Filter.db
-rw-r--r-- 2 cassandra cassandra     1573654 Mar 26 14:29 md-7427-big-Index.db
-rw-r--r-- 2 cassandra cassandra       10869 Mar 26 14:29 md-7427-big-Statistics.db
-rw-r--r-- 2 cassandra cassandra       16568 Mar 26 14:29 md-7427-big-Summary.db
-rw-r--r-- 2 cassandra cassandra          92 Mar 26 14:29 md-7427-big-TOC.txt
-rw-r--r-- 1 root      root              962 Mar 26 19:58 schema.cql
...

您可以通过使文件和文件夹所有者为cassandra来解决:

$ chown -R cassandra:cassandra /data/cassandra/data/<keyspace>/<keyspace>-6d7291801cd811ea84aedd85165df9d2/snapshots/analyse-LFDBFUZCMGCMGKHFYAFW/