Upgrading DataStax Enterprise 5.1 to 6.0
Instructions for upgrading from DSE 5.1 to 6.0.
jvm.options
The location of the jvm.options file depends on the type of installation:Package installations | /etc/dse/cassandra/jvm.options |
Tarball installations | installation_location/resources/cassandra/conf/jvm.options |
dse-env.sh
The default location of the dse-env.sh file depends on the type of installation:Package installations | /etc/dse/dse-env.sh |
Tarball installations | installation_location/bin/dse-env.sh |
OpsCenter version | DSE version |
---|---|
6.8 | 6.8, 6.7, 6.0, 5.1 |
6.7 | 6.7, 6.0, 5.1 |
6.5 | 6.0, 5.1, 5.0 (EOL) |
6.1 | 5.1, 5.0 (EOL), 4.8 (EOSL) |
6.0 | 5.0 (EOL), 4.8 (EOSL), 4.7 (EOSL) |
Upgrade 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.
- Upgrade nodes in this order:
- DSE Analytics datacenters
- Transactional/DSE Graph datacenters
- DSE Search datacenters
logback.xml
The location of the logback.xml file depends on the type of installation:Package installations | /etc/dse/cassandra/logback.xml |
Tarball installations | installation_location/resources/cassandra/conf/logback.xml |
DataStax driver changes
DataStax drivers come in two types:
- DataStax drivers for DataStax Enterprise — for use by DSE 4.8 and later
- DataStax drivers for Apache Cassandra™ — for use by Apache Cassandra™ and DSE 4.7 and earlier
DataStax Enterprise and Apache Cassandra™ configuration files
Configuration file | Installer-Services and package installations | Installer-No Services and tarball installations |
---|---|---|
DataStax Enterprise configuration files | ||
dse | /etc/default/dse (systemd) or /etc/init.d/ (SystemV) | N/A. Node type is set via command line flags. |
byoh-env.sh | /etc/dse/byoh-env.sh | install_location/bin/byoh-env.sh |
dse.yaml | /etc/dse/dse.yaml | install_location/resources/dse/conf/dse.yaml |
logback.xml | /etc/dse/cassandra/logback.xml | install_location/resources/logback.xml |
spark-env.sh | /etc/dse/spark/spark-env.sh | install_location/resources/spark/conf/spark-env.sh |
spark-defaults.conf | /etc/dse/spark/spark-defaults.conf | install_location/resources/spark/conf/spark-defaults.conf |
Cassandra configuration files | ||
cassandra.yaml | /etc/dse/cassandra/cassandra.yaml | install_location/conf/cassandra.yaml |
cassandra.in.sh | /usr/share/cassandra/cassandra.in.sh | install_location/bin/cassandra.in.sh |
cassandra-env.sh | /etc/dse/cassandra/cassandra-env.sh | install_location/conf/cassandra-env.sh |
cassandra-rackdc.properties | /etc/dse/cassandra/cassandra-rackdc.properties | install_location/conf/cassandra-rackdc.properties |
cassandra-topology.properties | /etc/dse/cassandra/cassandra-topology.properties | install_location/conf/cassandra-topology.properties |
jmxremote.password | /etc/cassandra/jmxremote.password | install_location/conf/jmxremote.password |
Tomcat server configuration file | ||
server.xml | /etc/dse/resources/tomcat/conf/server.xml | install_location/resources/tomcat/conf/server.xml |
dse.yaml
The location of the dse.yaml file depends on the type of installation:Package installations | /etc/dse/dse.yaml |
Tarball installations | installation_location/resources/dse/conf/dse.yaml |
The upgrade process for DataStax Enterprise provides minimal downtime (ideally zero). During this process, upgrade and restart one node at a time while other nodes continue to operate online. With a few exceptions, the cluster continues to work as though it were on the earlier version of DataStax Enterprise until all of the nodes in the cluster are upgraded.
DSE 5.1 Search Customers |
---|
Because of differences in the process scheduler, memory models, and tuning capabilities between version 5.1 and 6.X, DataStax recommends that customers using DSE 5.1 Search remain on version 5.1. |
Back up your existing installation
Upgrade SSTables
Version specific notes
facet.limit=-1
. The maximum facet limit value is 20,000 as
set by solr.max.facet.limit.size
. While the facet limit size can be
overriden using -Dsolr.max.facet.limit.size
in
jvm.options, it is not recommended.timeAllowed
parameter is enabled by default to prevent long running
shard queries, such as complex facets and Boolean queries, from using system resources
after they have timed out from the DSE Search coordinator. For details, see Limiting queries by timeUpgrade restrictions and limitations
Restrictions and limitations apply while a cluster is in a partially upgraded state. The cluster continues to work as though it were on the earlier version of DataStax Enterprise until all of the nodes in the cluster are upgraded.
General restrictions
- Do not enable new features.
- Ensure OpsCenter compatibility. See the compatibility table.
- Do not run nodetool repair.
- Stop the OpsCenter Repair Service if enabled: 6.5 | 6.7 | 6.8.
- 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
(approximately 13 days) to ensure any repairs complete successfully. - 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.
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.
Restrictions for DSE Analytics nodes
DSE 6.7 uses a different version of Spark (2.2) as does DSE 6.8 (2.4). Do not run Spark analytics jobs on a datacenter until all nodes are upgraded and applications have been recompiled for Spark 2.2 or 2.4 depending upon your upgrade version.
Restrictions for DSE Advanced Replication nodes
Upgrades are supported only for DSE Advanced Replication V2.
Driver version impacts
Be sure to check driver compatibility. Depending on the driver version, you might need to recompile your client application code. See DataStax driver changes.
- Protocol version: Set the protocol version explicitly in your application at start up. Switch to the Java driver to the new protocol version only after the upgrade is complete on all nodes in the cluster.
- Initial contact points: Ensure that the list of initial contact points contains only hosts with the oldest DSE version or protocol version. For example, the initial contact points contain only protocol version 2.
DSEFS nodes
During upgrade, DSEFS will not start on upgraded nodes. After all nodes are upgraded to 6.0.0, the DSEFS keyspace is adjusted and then DSEFS starts.
Advanced preparation for upgrading DSE Search nodes
Before continuing, complete all the advanced preparation steps on DSE Search nodes while DSE 5.1 is still running.
DSE 5.1 Search Customers |
---|
Because of differences in the process scheduler, memory models, and tuning capabilities between version 5.1 and 6.X, DataStax recommends that customers using DSE 5.1 Search remain on version 5.1. |
- Ensure all use of HTTP API writes are changed to use CQL commands for updates and inserts.
- Edit the search index config and make these changes, as needed. See Search index config for valid options to
change query behavior for search indexes.
- Remove the unsupported dataDir option. You can still set the location of search indexes.
- Remove mergePolicy, maxMergeDocs, and mergeFactor. For
example:
<mergeFactor>25</mergeFactor> <maxMergeDocs>... <mergePolicy>...
Use mergePolicyFactory instead, and add mergeScheduler:<mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"> <int name="maxThreadCount">16</int> <int name="maxMergeCount">32</int> </mergeScheduler> ... <mergePolicyFactory class="org.apache.solr.index.TieredMergePolicyFactory"> <int name="maxMergeAtOnce">10</int> <int name="segmentsPerTier">10</int> </mergePolicyFactory>
- Remove any instance of ExtractingRequestHandler.
- Remove DSENRTCachingDirectoryFactory.
Change:
<directoryFactory name="DirectoryFactory" class="com.datastax.bdp.search.solr.DSENRTCachingDirectoryFactory"/>
to:<directoryFactory name="DirectoryFactory" class="solr.StandardDirectoryFactory"/>
- Ensure that the catalina.properties and
context.xml files are present in the Tomcat
conf dir.Warning: DSE will not start after the upgrade if those files are missing.The default location of the Tomcat conf directory depends on the type of installation:
- Package installations: /etc/dse/tomcat/conf
- Tarball installations: installation_location/resources/tomcat/conf
- If earlier DSE versions use a custom configuration for the Solr UI web.xml,
change:
<filter-class>com.datastax.bdp.search.solr.auth.DseAuthenticationFilter</filter-class>
to<filter-class>com.datastax.bdp.cassandra.auth.http.DseAuthenticationFilter</filter-class>
Advanced preparation for upgrading DSE Graph nodes
- schema.describe() displays the entire schema, even if it contains illegal names.
- In-place upgrades allow existing schemas with invalid edge label names and property key names.
- Schema elements with illegal names cannot be updated or added.
Advanced preparation for upgrading DSE Analytics nodes
Before upgrading DSE Analytics nodes:
- If you programmatically set the shuffle parameter, you must change the code for
applications that use
conf.set("spark.shuffle.service.port", port)
. Instead, use dse spark-submit which automatically sets the correct service port based on the authentication state. See Configuring Spark for more information. - If DSEFS is enabled, copy CFS hivemetastore
directory to dse:
DSE_HOME/bin/dse hadoop fs -cp cfs://node_ip_address/user/spark/warehouse/ dsefs://node_ip_address/user/spark/warehouse/
- Cassandra File System (CFS) is removed. Remove the
cfs
andcfs_archive
keyspaces before upgrading. See the From CFS to DSEFS blog post and the Copying data from CFS to DSEFS documentation for more information.DROP KEYSPACE cfs
DROP KEYSPACE cfs_archive
- Make sure any use of the
SPARK_LOCAL_DIRS
andSPARK_EXECUTOR_DIRS
environment variables match their use as described in Setting environment variables. - For applications to use the compatible Spark
Jobserver API in DataStax repository, migrate jobs that extend from
SparkHiveJob and SparkSqlJob to SparkSessionJob. See example in the DemoSparkSessionJob
in the demos directory.
The default location of the demos directory depends on the type of installation:
- Package installations: /usr/share/dse/demos
- Tarball installations: installation_location/demos
Preparing to upgrade
Follow these steps to prepare each node for the upgrade:
- Upgrade to the latest patch release on your current version. Fixes included in
the latest patch release can simplify the upgrade process.Get the current DSE version:
bin/dse -v current_dse_version
- Familiarize yourself with the changes and features in the
new release:
- DataStax Enterprise 6.0 release notes.
- General upgrading advice for any version. Be sure to read NEWS.txt all the way back to your current version.
- DataStax Enterprise changes in CHANGES.txt.
- DataStax driver changes.
- 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% /
Important: The required space depends on the compaction strategy. See Disk space - Replace ITriggers and custom interfaces.
All custom implementations, including the following interfaces, must be replaced with supported implementations when upgrading to DSE 6.x:
- The
org.apache.cassandra.triggers.ITrigger
interface was modified fromaugment
toaugmentNonBlocking
for non-blocking internal architecture. Updated trigger implementations must be provided on upgraded nodes. If unsure, drop all existing triggers before upgrading. To check for existing triggers:SELECT * FROM system_schema.triggers;
DROP TRIGGER trigger_name ON keyspace_name.table_name;
- The
org.apache.cassandra.index.Index
interface was modified to comply with the core storage engine changes. Updated implementations are required. If unsure, drop all existing custom secondary indexes before upgrading, except DSE Search indexes, which do not need to be replaced. To check for existing indexes:SELECT * FROM system_schema.indexes;
DROP INDEX index_name;
- The
org.apache.cassandra.cql3.QueryHandler
,org.apache.cassandra.db.commitlog.CommitLogReadHandler
, and other extension points have been changed. See QueryHandlers.
Tip: For help contact the DataStax Services team. - The
- Support for Thrift-compatible tables (COMPACT STORAGE) is
dropped. Before upgrading, migrate all non-system tables that have COMPACT STORAGE
to CQL table
format:
cqlsh -e 'DESCRIBE FULL SCHEMA;' > schema_file
cat schema_file | while read -d $';\n' line ; do if echo "$line"|grep 'COMPACT STORAGE' 2>&1 > /dev/null ; then TBL="`echo $line|sed -e 's|^CREATE TABLE \([^ ]*\) .*$|\1|'`" if echo "$TBL"|egrep -v '^system' 2>&1 > /dev/null; then echo "ALTER TABLE $TBL DROP COMPACT STORAGE;" >> schema-drop-list fi fi done
cqlsh -f schema-drop-list
Note: The script above dumps the complete DSE schema to schema_file, uses grep to find lines containing COMPACT STORAGE, and then writes only those table names to schema-drop-list along with the required ALTER TABLE commands. The schema-drop-list file is then read by cqlsh which runs the ALTER TABLE commands contained therein.Warning: DSE will not start if tables using COMPACT STORAGE are present. - Ensure that keyspace replication factors are correct
for your environment:
cqlsh --execute "DESCRIBE KEYSPACE keyspace-name;" | grep "replication" CREATE KEYSPACE keyspace-name WITH replication = {'class': 'NetworkTopologyStrategy, 'replication_factor': '3'} AND durable_writes = true;
- Check the keyspace replication factor for analytics keyspaces.
- Check the keyspace replication factor for system_auth and dse_security keyspaces.
- Upgrade the SSTables on each node to ensure that all
SSTables are on the current version:
nodetool upgradesstables
Warning: Failure to upgrade SSTables when required results in a significant performance impact and increased disk usage.Tip: Use the--jobs
option to set the number of SSTables that upgrade simultaneously. The default setting is 2, which minimizes impact on the cluster. Set to 0 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.
- Verify the Java runtime version and upgrade to the recommended version.
java -version openjdk version "1.8.0_222" OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10) OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
- Recommended: OpenJDK 8 (1.8.0_151 minimum)
Note: Recommendation changed due to the end of public updates for Oracle JRE/JDK 8. See Oracle Java SE Support Roadmap.
- Supported: Oracle Java SE 8 (JRE or JDK) (1.8.0_151 minimum)
Important: Although Oracle JRE/JDK 8 is supported, DataStax does more extensive testing on OpenJDK 8. - Recommended: OpenJDK 8 (1.8.0_151 minimum)
- Run nodetool repair to ensure that data on each
replica is consistent with data on other
nodes:
nodetool repair -pr
- Install the libaio package for optimal performance. RHEL platforms:
sudo yum install libaio
Debian:sudo apt-get install libaio1
- Back up any customized
configuration files since they may be overwritten with
default values during installation of the new version. Tip: If you backed up your installation using instructions in Backing up and restoring DSE, your original configuration files are included in the archive.
Upgrade steps
- 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
- Package
installations:
- Use the appropriate method to install the new product version on a
supported platform:Warning: Install the new product version using the same installation type that is on the system, otherwise problems might result.
-
To configure the new product version:
-
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.Warning: Do not simply replace new configuration files with old. Rather compare your old files to the new files and make any required changes.Tip: Use the DSE yaml_diff tool 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 ...
cassandra.yaml changes
Table 1. General deprecated settings Deprecated cassandra.yaml settings: Remove these options: concurrent_counter_writes concurrent_materialized_view_writes concurrent_reads concurrent_writes max_client_wait_time_ms max_threads request_scheduler request_scheduler_options rpc_port rpc_server_type start_rpc thrift_framed_transport_size_in_mb
Table 2. RPC settings Deprecated cassandra.yaml settings: rpc_address rpc_broadcast_address
Replacement settings: native_transport_address native_transport_broadcast_address
Table 3. Credential cache settings Deprecated cassandra.yaml settings: Remove these options: credentials_validity_in_ms credentials_update_interval_in_ms
Caches are optimized without those settings.
dse.yaml changes
Table 4. DSE Search node changes Deprecated dse.yaml settings: Remove these options: cql_solr_query_executor_threads enable_back_pressure_adaptive_nrt_commit max_solr_concurrency_per_core solr_indexing_error_log_options
Warning: DSE 6.x will not start with those options present.
-
- When upgrading DSE to versions earlier than 5.1.16, 6.0.8, or
6.7.4 inclusive, if any tables are using DSE Tiered Storage, remove all
txn_compaction
log files from second-level tiers and lower. For example, given the following dse.yaml configuration, removetxn_compaction
log files from/mnt2
and/mnt3
directories:tiered_storage_options: strategy1: tiers: - paths: - /mnt1 - paths: - /mnt2 - paths: - /mnt3
The following example removes the files using the find command:
find /mnt2 -name "*_txn_compaction_*.log" -type f -delete && find /mnt3 -name "*_txn_compaction_*.log" -type f -delete
Warning: Failure to complete this step may result in data loss. - Start the node.
- Package
installations:
sudo service dse start
- Tarball
installations:
installation_dir/bin/dse cassandra
- Package
installations:
- 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'};
- Get the node's datacenter
name:
- 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.Tip: Non standard log locations are configured in dse-env.sh. - Repeat the upgrade process on each node in the cluster following the recommended order.
- 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.Warning: 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
Tip: Use the--jobs
option to set the number of SSTables that upgrade simultaneously. The default setting is 2, which minimizes impact on the cluster. Set to 0 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.Important: You can run theupgradesstables
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 will degrade performance.
General post upgrade steps
After all nodes are upgraded, start the OpsCenter Repair Service if required: 6.5 | 6.7 | 6.8.
Post upgrade steps for DSE Search nodes
For DSE Search nodes:
- The appender SolrValidationErrorAppender and the logger SolrValidationErrorLogger are no longer used and may safely be removed from logback.xml.
- In contrast to earlier versions, DataStax recommends accepting the new default value of 1024 for back_pressure_threshold_per_core in dse.yaml. See Configuring and tuning indexing performance.
- Do a full reindex of all encrypted search indexes on
each node in your
cluster:
dsetool reload_core keyspace_name.table_name distributed=false reindex=true deleteAll=true
Important: Plan sufficient time after the upgrade is complete to reindex withdeleteAll=true
on all nodes.
Post upgrade steps for DSE Analytics nodes
For DSE Analytics nodes:
- Check the replication factor for the
dse_analytics
keyspace, a new keyspace stores all DSE Analytics internal system data. DataStax recommends setting the replication strategy toNetworkTopologyStrategy
(NTS) with a replication factor of at least 3 in each of DSE Analytics datacenters. If a datacenter has more nodes, a larger replication factor should be considered.To check the replication strategy and factor:
cqlsh --execute "DESCRIBE KEYSPACE dse_analytics;" | grep "replication" CREATE KEYSPACE keyspace-name WITH replication = {'class': 'replication-strategy, 'datacenter-name': 'replication-factor'};
- If you are using Spark SQL tables, migrate them to the new Hive metastore
format:
dse client-tool spark metastore migrate --from 5.1.0 --to 6.0.0
- Spark Jobserver uses DSE custom version 8.0.4.45. Ensure that applications use the compatible Spark Jobserver API from the DataStax repository.
Warning messages during and after upgrade
You can ignore some log messages that occur during and after an upgrade:
- Some gremlin_server properties in earlier versions of DSE are no longer required. If
properties exist in the dse.yaml file after upgrading,
logs display warnings similar
to:
WARN [main] 2017-08-31 12:25:30,523 GREMLIN DseWebSocketChannelizer.java:149 - Configuration for the org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0 serializer in dse.yaml overrides the DSE default - typically it is best to allow DSE to configure these.
You can ignore these warnings or modify dse.yaml so that only the required gremlin server properties are present.
Locking DSE package versions
If you have upgraded a DSE package installation, you can prevent future unintended upgrades.
RHEL yum installations
- Install
yum-versionlock
(one-time operation):sudo yum install yum-versionlock
- Lock the current DSE
version:
sudo yum versionlock dse-*
sudo yum versionlock clear
For details on the versionlock
command, see http://man7.org/linux/man-pages/man1/yum-versionlock.1.html.
Debian apt-get installations
sudo apt-mark hold dse-*
sudo apt-mark unhold dse-*
For details on the apt-mark command, see http://manpages.ubuntu.com/manpages/bionic/man8/apt-mark.8.html.