Upgrades for DataStax Enterprise 5.0.x patch releases
Review this information on upgrading DataStax Enterprise (DSE) between patch (point) releases, such as upgrading from DataStax Enterprise 5.0.3 to 5.0.11.
Back up Your Existing Installation
DataStax recommends backing up your data prior to any version upgrade. |
A backup provides the ability to revert and restore all the data used in the previous version if necessary. For manual backup instructions, see Backing up a tarball installation or Backing up a package installation.
OpsCenter provides a Backup Service that manages enterprise-wide backup and restore operations for DataStax Enterprise clusters and is highly recommended over any manual backup procedure. Ensure you use a compatible version of OpsCenter for your DSE version. |
Always Upgrade to the Latest Version
DataStax recommends that you upgrade to the latest available patch release unless you have specific requirements to do otherwise. |
To find your current version:
bin/dse -v
current\_dse\_version
Upgrade SSTables
Be certain to upgrade SSTables on your nodes both before and after upgrading. Failure to upgrade SSTables results in severe performance penalties and possible data loss. |
General Restrictions
-
Do not enable new features.
-
Do not run
nodetool repair
. -
During the upgrade, do not bootstrap new nodes or decommission existing nodes.
-
Do not issue TRUNCATE or DDL related queries during the upgrade process.
-
Do not alter schemas for any workloads.
-
Complete the cluster-wide upgrade before the expiration of
gc_grace_seconds
(default 10 days) to ensure any repairs complete successfully. -
Do not reindex DSE Search nodes.
-
If the DSE Performance Service was disabled before the upgrade, do not enable it during the upgrade.
See DSE Performance Service: 6.7 | 6.0 | 5.1 | 5.0 | OpsCenter 6.8 | OpsCenter 6.7 | OpsCenter 6.5.
Nodes on different versions might show a schema disagreement during an upgrade. |
Restrictions for Nodes Using Security
-
Do not change security credentials or permissions until the upgrade is complete on all nodes.
-
If you are not already using Kerberos, do not set up Kerberos authentication before upgrading. First upgrade the cluster, and then set up Kerberos.
Advanced Preparation for Upgrading DSE Search Nodes
-
Tune the schema before you upgrade. For DSE 5.0.10 and later, all field definitions in the schema are validated and must be DSE Search compatible, even if the fields are not indexed, have docValues applied, or used for copy-field source.
-
The default behavior of automatic resource generation includes all columns. To improve performance, take action to prevent the fields from being loaded from the database to the indexing path. In the schema, remove or comment out unused fields.
-
All unique key elements must be indexed in the Solr schema. To verify unique key elements, review
schema.xml
to ensure that all unique key fields must haveindexed=true
. -
If you changed the schema, do a full reindex:
dsetool reload_core keyspace_name.table_name schema=filepath solrconfig=filepath reindex=true deleteAll=true distributed=false
DataStax Enterprise and Apache Cassandra® Configuration Files
Configuration file | Installer-Services and package installations | Installer-No Services and tarball installations |
---|---|---|
dse |
/etc/default/dse (systemd) or /etc/init.d/ (SystemV) |
N/A Node type is set via command line flags. |
dse-env.sh |
/etc/dse/dse-env.sh |
<installation_location>/bin/dse-env.sh |
byoh-env.sh |
/etc/dse/byoh-env.sh |
<installation_location>/bin/byoh-env.sh |
dse.yaml |
/etc/dse/dse.yaml |
<installation_location>/resources/dse/conf/dse.yaml |
logback.xml |
/etc/dse/cassandra/logback.xml |
<installation_location>/resources/logback.xml |
spark-env.sh |
/etc/dse/spark/spark-env.sh |
<installation_location>/resources/spark/conf/spark-env.sh |
spark-defaults.conf |
/etc/dse/spark/spark-defaults.conf |
<installation_location>/resources/spark/conf/spark-defaults.conf |
Configuration file |
Installer-Services and package installations |
Installer-No Services and tarball installations |
cassandra.yaml |
/etc/dse/cassandra/cassandra.yaml |
<installation_location>/conf/cassandra.yaml |
cassandra.in.sh |
/usr/share/cassandra/cassandra.in.sh |
<installation_location>/bin/cassandra.in.sh |
cassandra-env.sh |
/etc/dse/cassandra/cassandra-env.sh |
<installation_location>/conf/cassandra-env.sh |
cassandra-rackdc.properties |
/etc/dse/cassandra/cassandra-rackdc.properties |
<installation_location>/conf/cassandra-rackdc.properties |
cassandra-topology.properties |
/etc/dse/cassandra/cassandra-topology.properties |
<installation_location>/conf/cassandra-topology.properties |
jmxremote.password |
/etc/cassandra/jmxremote.password |
<installation_location>/conf/jmxremote.password |
Configuration file | Installer-Services and package installations | Installer-No Services and tarball installations |
---|---|---|
server.xml |
/etc/dse/resources/tomcat/conf/server.xml |
<installation_location>/resources/tomcat/conf/server.xml |
Preparing to Upgrade
Follow these steps to prepare each node for the upgrade:
-
Familiarize yourself with the changes and features in the new release:
-
DataStax Enterprise 5.0 release notes.
-
General upgrading advice for any version. Be sure to read NEWS.txt all the way back to your current version.
-
Apache Cassandra changes in CHANGES.txt.
-
DataStax driver changes.
DataStax drivers come in two types:
-
DataStax drivers for DataStax Enterprise (DSE) — for use by DSE 4.8 and later
-
DataStax drivers for Apache Cassandra — for use by Apache Cassandra and DSE 4.7 and earlier
-
While the DataStax drivers for Apache Cassandra drivers can connect to DSE 5.0 and later clusters, DataStax strongly recommends upgrading to the DSE drivers. The DSE drivers provide functionality for all DataStax Enterprise (DSE) features.
-
-
Stop the OpsCenter Repair Service if enabled:
-
Before upgrading, be sure that each node has adequate free disk space.
Determine current DSE data disk space usage:
sudo du -sh /var/lib/cassandra/data/ 3.9G /var/lib/cassandra/data/
Determine available disk space:
sudo df -hT / Filesystem Type Size Used Avail Use% Mounted on /dev/sda1 ext4 59G 16G 41G 28% /
The required space depends on the compaction strategy. See Disk space.
-
Run nodetool repair to ensure that data on each replica is consistent with data on other nodes:
nodetool repair -pr
-
Back up any customized configuration files since they may be overwritten with default values during installation of the new version.
If you backed up your installation using the instructions in Backing up a tarball installation or Backing up a package installation, your original configuration files are included in the archive.
-
Upgrade the SSTables on each node to ensure that all SSTables are on the current version:
nodetool upgradesstables
Failure to upgrade SSTables when required results in a significant performance impact and increased disk usage.
Use the
--jobs
option to set the number of SSTables that upgrade simultaneously. The default setting is2
, which minimizes impact on the cluster. Set to0
to use all available compaction threads. DataStax recommends running theupgradesstables
command on one node at a time or, when using racks, one rack at a time.If the SSTables are already on the current version, the command returns immediately and no action is taken.
-
Upgrades from 5.0.0 to 5.0.8 and from DSE 5.1.0 and 5.1.1 to DSE 5.1.2 and later DSE 5.1.x releases
Restart the node with this start-up parameter:
-Dcassandra.force_3_0_protocol_version=true
For example:
installation\_location/bin/dse cassandra -Dcassandra.force_3_0_protocol_version=true
While mixed versions exist during the upgrade, do not add or remove columns from existing tables.
After the restart is complete, remove the flag.
Upgrade Steps
Follow these steps on each node in the recommended order.
Upgrade nodes in this order:
-
In multiple datacenter clusters, upgrade every node in one datacenter before upgrading another datacenter.
-
Upgrade the seed nodes within a datacenter first.
-
DSE Analytics datacenters
-
For DSE Analytics nodes using DSE Hadoop, upgrade the Job Tracker node first. Then upgrade Hadoop nodes, followed by Spark nodes.
-
-
Transactional/DSE Graph datacenters
-
DSE Search nodes or datacenters
The upgrade process requires upgrading and restarting one node at a time.
The DataStax installer upgrades DataStax Enterprise and automatically performs many upgrade tasks. |
You can use OpsCenter Lifecycle Manager (LCM) to clone a configuration profile (6.8) and run an upgrade job on a datacenter or node. Upgrade jobs (6.8) are supported for upgrades within a DSE release series for DSE 5.0.x and later. |
-
DSE Analytics nodes only:
Kill all Spark worker processes:
for pid in $(jps | grep Worker | awk '{print $1}'); do kill -9 $pid; done
-
Flush the commit log of the current installation:
nodetool drain
-
Stop the node:
-
Package installations:
sudo service dse stop
-
Tarball installations:
installation\_dir/bin/dse cassandra-stop
-
-
Use the appropriate method to install the new product version.
Install the new product version using the same installation type that is on the system, otherwise problems might result.
TTL expiration timestamps are susceptible to the year 2038 problem. If the TTL value is long and an expiration date that is greater than the maximum threshold of
2038-01-19T03:14:06+00:00
, the data is immediately expired and purged on the next compaction. DataStax strongly recommends upgrading to DSE 5.0.15 or later and taking required action to protect against silent data loss. -
Compare changes in the new configuration files with the backup configuration files after the upgrade but before restarting, remove deprecated settings, and update any new settings if required.
Use the DSE yaml_diff tool (6.8) to compare backup YAML files with the upgraded YAML files:
cd /usr/share/dse/tools/yamls
./yaml_diff path/to/yaml-file-old path/to/yaml-file-new ... CHANGES ========= authenticator: - AllowAllAuthenticator + com.datastax.bdp.cassandra.auth.DseAuthenticator authorizer: - AllowAllAuthorizer + com.datastax.bdp.cassandra.auth.DseAuthorizer roles_validity_in_ms: - 2000 + 120000 ...
-
Start the node.
-
Installer-Services and Package and installations:
sudo service dse start
-
Installer-No Services and Tarball installations:
installation\_dir/bin/dse cassandra
-
-
Verify that the upgraded datacenter names match the datacenter names in the keyspace schema definition:
-
Get the node’s datacenter name:
nodetool status | grep "Datacenter" Datacenter: datacenter-name
-
Verify that the node’s datacenter name matches the datacenter name for a keyspace:
cqlsh --execute "DESCRIBE KEYSPACE keyspace-name;" | grep "replication" CREATE KEYSPACE keyspace-name WITH replication = {'class': 'NetworkTopologyStrategy, 'datacenter-name': '3'};
-
-
Review the logs for warnings, errors, and exceptions:
grep -w 'WARNING\|ERROR\|exception' /var/log/cassandra/*.log
Warnings, errors, and exceptions are frequently found in the logs when starting an upgraded node. Some of these log entries are informational to help you execute specific upgrade-related steps. If you find unexpected warnings, errors, or exceptions, contact DataStax Support.
Non-standard log locations are configured in
dse-env.sh
.The default location of this file depends on the type of installation:
Package installations
/etc/dse/dse-env.sh
Tarball installations
<installation_location>/bin/dse-env.sh
-
Repeat the upgrade process on each node in the cluster following the recommended order.
-
If you use the OpsCenter Repair Service restart it:
-
After the entire cluster upgrade is complete: upgrade the SSTables on one node at a time or, when using racks, one rack at a time.
Failure to upgrade SSTables when required results in a significant performance impact and increased disk usage and possible data loss. Upgrading is not complete until the SSTables are upgraded.
nodetool upgradesstables
Use the
--jobs
option to set the number of SSTables that upgrade simultaneously. The default setting is2
, which minimizes impact on the cluster. Set to0
to use all available compaction threads. DataStax recommends running theupgradesstables
command on one node at a time or, when using racks, one rack at a time.You can run the
upgradesstables
command before all the nodes are upgraded as long as you run the command on only one node at a time or when using racks, one rack at a time. Runningupgradesstables
on too many nodes at once degrades performance.