Apache Cassandra 1.2 Documentation

Upgrading Cassandra

You can upgrade an earlier version of Cassandra or DataStax Community Edition to DataStax Community 1.2.4. Follow instructions in these sections to complete the upgrade:

Best practices for upgrading Cassandra

Follow these best practices before upgrading Cassandra:

Prerequisites

  1. Date strings (and timestamps) are no longer accepted as valid timeuuid values. This change requires modifying queries that use these values. New methods have been added for working with timeuuid values.

  2. Cassandra 1.2.4 is not network-compatible with versions older than 1.0. If you want to perform a rolling restart, first upgrade the cluster to 1.0.x or 1.1.x, and then to 1.2.4, as described in the Cassandra 1.1 documentation.

    Data files from Cassandra 0.6 and later are compatible with Cassandra 1.2 and later. If it's practical to shut down cluster instead of performing a rolling restart, you can skip upgrading to an interim release and upgrade from Cassandra 0.6 or later to 1.2.4.

  3. Do not upgrade if nodes in the cluster are down. The hints schema changed from 1.1 to 1.2.4. Cassandra automatically snapshots and then truncates the hints column family as part of starting up 1.2.4 for the first time. Additionally, upgraded nodes will not store new hints destined for older (pre-1.2) nodes. Use the nodetool removenode command, which was called nodetool removetoken in earlier releases, to remove dead nodes.

To upgrade a binary tarball installation

  1. Save the cassandra.yaml file from the old installation to a safe place.

  2. On each node, download and unpack the binary tarball package from the downloads section of the Cassandra website.

  3. In the new installation, open the cassandra.yaml for writing.

  4. In the old installation, open the cassandra.yaml.

  5. Diff the new and old cassandra.yaml files.

  6. Merge the diffs, including the partitioner setting, by hand from the old file into the new one.

    Note

    Do not use the default partitioner setting in the new cassandra.yaml because it has changed in this release to the Murmur3Partitioner. The Murmur3Partitioner can be used only for new clusters. After data has been added to the cluster, you cannot change the partitioner without reworking tables, which is not practical. Use your old partitioner setting in the new cassandra.yaml file.

  7. Follow steps for completing the upgrade.

To upgrade a RHEL or CentOS installation

  1. On each of your Cassandra nodes, run sudo yum remove apache-cassandra11, then run sudo yum install dsc12. The installer creates the file cassandra.yaml.rpmnew in /etc/cassandra/default.conf/.
  2. Open the old and new cassandra.yaml files and diff them.
  3. Merge the diffs by hand, including the partitioner setting, from the old file into the new one. For details, see the note in step 6 of the tarball upgrade procedure. Save the file as cassandra.yaml.
  4. Follow steps for completing the upgrade.

To upgrade a Debian or Ubuntu installation

  1. Save the cassandra.yaml file from the old installation to a safe place.
  2. On each of your Cassandra nodes, run sudo apt-get install dsc12.
  3. Open the old and new cassandra.yaml files and diff them.
  4. Merge the diffs by hand, including the partitioner setting, from the old file into the new one. For details, see the note in step 6 of the tarball upgrade procedure. Save the file as cassandra.yaml.
  5. Follow steps for completing the upgrade.

Completing the upgrade

To complete the upgrade, perform the following steps:

  1. Account for new parameters in cassandra.yaml.
  2. Make sure any client drivers, such as Hector or Pycassa clients, are compatible with the new version.
  3. Run nodetool drain before shutting down the existing Cassandra service. This prevents overcounts of counter data, and will also speed up restart post-upgrade.
  4. Stop the old Cassandra process, then start the new binary process.
  5. Monitor the log files for any issues.
  6. After upgrading and restarting all Cassandra processes, restart client applications.

Other Cassandra changes that affect upgrades

Noteworthy changes are:

  • The nodetool upgradesstables command now only upgrades/rewrites sstables that are not on the current version, which is usually what you want. Use the -a flag to recover the old behavior of rewriting all sstables.

  • Tables using LeveledCompactionStrategy do not create a row-level bloom filter by default. In versions of Cassandra before 1.2.2 the default value differs from the current value; manually set the false positive rate to 1.0 (to disable) or 0.01 (to enable, if you make many requests for rows that do not exist).

  • The default version of CQL (and cqlsh) is CQL 3.0. CQL 2 is still available but you will have to use the thrift set_cql_version method that is already supported in 1.1 to use CQL 2.

  • In CQL 3, the DROP behavior has been removed temporarily from ALTER TABLE because it was not correctly implemented.

  • In earlier releases, CQL3 property map keys used in ALTER and CREATE statements were case-insensitive. For example, CLASS or class and REPLICATION_FACTOR or replication_factor were permitted. The case-sensitivity of the property map keys was inconsistent with the treatment of other string literals and incompatible with formatting of NetworkTopologyStrategy property maps, which have case-sensitive data center names. In this release property map keys, such as class and replication_factor are case-sensitive. Use lowercase property map keys as shown in this example:

    CREATE KEYSPACE test WITH replication =
      { 'class' : 'SimpleStrategy', 'replication_factor' : '1' };
    
  • You might need to fix queries having loose type validation of CQL 3 constants that now have strong validation. See the changelog section of Apache docs. Using blobs as strings constants is now deprecated in favor of blob constants.