Change Data Capture (CDC) logging

Change Data Capture (CDC) logging captures and tracks data that has changed. CDC logging is configured per table, with limits on the amount of disk space to consume for storing the CDC logs. CDC logs use the same binary format as the commit log.

Where is the CDC directory?

The location of the CDC directory depends on the type of installation:

Installation Type Location

Package installations

/var/lib/cassandra/cdc_raw

Tarball installations

/var/lib/cassandra/cdc_raw

When all tables having mutations in a completed commitlog segment are flushed, a hard link to that commitlog segment is created in the cdc_raw directory. This action makes the CDC-enabled mutations available.

If the disk space limit is reached, CDC-enabled tables reject writes until space is freed.

Prerequisites

Before enabling CDC logging, define a plan for moving and consuming the CDC log information. DataStax recommends a physical device for the CDC log that is separate from the data directories.

Procedure

Where is the cassandra.yaml file?

The location of the cassandra.yaml file depends on the type of installation:

Installation Type Location

Package installations + Installer-Services installations

/etc/dse/cassandra/cassandra.yaml

Tarball installations + Installer-No Services installations

<installation_location>/resources/cassandra/conf/cassandra.yaml

  1. Enable CDC logging and configure CDC directories and space in cassandra.yaml.

    For example, to enable CDC logging with default values:

    cdc_enabled: true
    cdc_total_space_in_mb: 4096
    cdc_free_space_check_interval_ms: 250
    cdc_raw_directory: /var/lib/cassandra/cdc_raw
  2. To enable CDC logging for a database table, create or alter the table with the table property.

    For example, to enable CDC logging on the cycling table:

    ALTER TABLE cycling WITH cdc=true;

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com