Search code examples
cassandracassandra-3.0

CommitLogSync exception


I've installed cassandra on 3 RHEL servers. I've configured 2 datacentres. The YAML file looks like:

cluster_name: 'Cluster1'

num_tokens: 256

partitioner: org.apache.cassandra.dht.Murmur3Partitioner

data_file_directories:- /home/cass/share/cassandra/data

commitlog_directory: /home/cass/ share/cassandra/commitlog

saved_caches_directory: /home/cass/share/cassandra/saved_caches

seed_provider:    - class_name: org.apache.cassandra.locator.SimpleSeedProvider parameters:          - seeds: "172.16.129.140" listen_address: 'IP address of the node'

endpoint_snitch: GossipingPropertyFileSnitch

I'm getting the below exception: Exception (org.apache.cassandra.exceptions.ConfigurationException) encountered during startup: Missing required directive CommitLogSync

Missing required directive CommitLogSync

ERROR 05:55:21 Exception encountered during startup: Missing required directive CommitLogSync

What exactly is wrong here?


Solution

  • Is your cassandra.yaml a modified version of the shipped one? Even default values need to be in there.

    From a quick look of your snippets - does the commitlog directory really exist?

    commitlog_directory: /home/cass/ share/cassandra/commitlog

    There is a space in there and maybe it is just a simple typo. From the docs:

    commitlog_sync

    (Default: periodic) The method that Cassandra uses to acknowledge writes in milliseconds:

    periodic: (Default: 10000 milliseconds [10 seconds]) With commitlog_sync_period_in_ms, controls how often the commit log is synchronized to disk. Periodic syncs are acknowledged immediately.

    batch: (Default: disabled)note With commitlog_sync_batch_window_in_ms (Default: 2 ms), controls how long Cassandra waits for other writes before performing a sync. When this method is enabled, Cassandra does not acknowledge writes until they are fsynced to disk.

    https://docs.datastax.com/en/cassandra/3.0/cassandra/configuration/configCassandra_yaml.html

    To be safe to have default values and all parameters set I always recommend to use the shipped cassandra.yaml and only modify the settings that need other values. This also makes it easier while upgrading - diff is your friend - not to miss new parameters.