user2883028
user2883028

Reputation: 173

Issue with writing to commit log file in cassandra

I m facing issue while starting cassandra . I am using Datastax version. When I start cassandra , it is closing with below issue.

ERROR [main] 2017-08-10 20:42:04,999 CassandraDaemon.java:654 - Exception  encountered during startup
org.apache.cassandra.io.FSWriteError: java.nio.file.AccessDeniedException: C:\Program Files\DataStax Community\data\commitlog\CommitLog-5-1502421528137.log
at org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:131) ~[apache-cassandra-2.2.8.jar:2.2.8]
at org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:148) ~[apache-cassandra-2.2.8.jar:2.2.8]
at org.apache.cassandra.db.commitlog.CommitLogSegmentManager.recycleSegment(CommitLogSegmentManager.java:365) ~[apache-cassandra-2.2.8.jar:2.2.8]
at org.apache.cassandra.db.commitlog.CommitLog.recover(CommitLog.java:165) ~[apache-cassandra-2.2.8.jar:2.2.8]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:284) [apache-cassandra-2.2.8.jar:2.2.8]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:532) [apache-cassandra-2.2.8.jar:2.2.8]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:641) [apache-cassandra-2.2.8.jar:2.2.8]
Caused by: java.nio.file.AccessDeniedException: C:\Program Files\DataStax Community\data\commitlog\CommitLog-5-1502421528137.log
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83) ~[na:1.7.0_40]
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) ~[na:1.7.0_40]
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) ~[na:1.7.0_40]
at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269) ~[na:1.7.0_40]
at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) ~[na:1.7.0_40]
at java.nio.file.Files.delete(Files.java:1077) ~[na:1.7.0_40]
at org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:125) ~[apache-cassandra-2.2.8.jar:2.2.8]
... 6 common frames omitted

I tried to keep all permissions to the below folder and restarted many times .

C:\Program Files\DataStax Community\data

But still getting same error , I am using windows 10 .

Please suggest .

Upvotes: 1

Views: 3509

Answers (2)

Andrey Belonog
Andrey Belonog

Reputation: 113

I got the same issue and in my case, the source was in the incompatible JRE version in the run configuration of executable code.

I've solved a problem with replacing 11.0.2 JRE version to 1.8.0_181

Here is a doc, where you can ensure about Cassandra compatibility.

Upvotes: 4

Chris Lohfink
Chris Lohfink

Reputation: 16400

Some ideas to try or look at:

  • Any anti virus scanning in background in windows needs to setup exclusions to your data directories or it can cause this
  • This may be an intermittent issue that isnt fixed because it hasnt been easy to reproduce. (CASSANDRA-9414) There are not many Cassandra users using Windows so it can have more rough edges. If possible you may want to consider a Linux host which gets more testing/use (not most helpful answer I know)
    • Try upgrading to more recent version or switch to Linux
  • Check the file permissions on C:\Program Files\DataStax Community\data\commitlog\CommitLog-5-1502421528137.log. You can possibly either change the permissions on that file or delete that commitlog and do a repair to make sure you didnt trigger any inconsistencies.
    • Something to look for in particular is the user who owns the file. There are a lot of tools like sstablesplit, sstablelevelreset, sstableexpiredblockers, sstablemetadata, sstable2json which will run cassandra in client mode using your cassandra.yaml. Since it has overlapping data and commitlog locations and it does somethings that trigger internal writes (sstable activity table in particular) it can end up flushing a commitlog or creating new sstables with whatever user ran the tool. If that user is different than the one that is used to run Cassandra it can cause failures like that one. Tools are slowly getting rewritten to make this less of an issue (ie sstabledump, 4.0 sstablemetadata) but if you use these tools issues like this is something to look out for.

Upvotes: 2

Related Questions