Method 1: Rolling Upgrade
This topic describes the rolling upgrade process, which allows you to update host operating systems in sequential batches. This method maintains cluster availability and prevents downtime during migration.
Step 1: Planning the Host Upgrade Sequence
-
Develop a sequence for taking hosts offline and bringing them back up to maintain sufficient compute capacity and data replicas.
-
Utilize rack awareness to place all hosts within a rack into maintenance mode without losing access to data replicas.
-
Upgrade up to 20 nodes or 10% of the cluster’s capacity in parallel (whichever is smaller), depending on your organization's tolerance for reduced capacity.
-
Manually stop roles for services with single-instance roles that you cannot decommission (for example, Kudu Master in a single-master configuration) prior to the OS upgrade.
Step 2: Image Preparation
Proper image preparation ensures that the new operating system environment is compatible with the Cloudera Manager ecosystem. You must systematically remove legacy packages and parcels that are incompatible with the target OS to prevent startup failures. By pre-configuring the correct repository information and installing matching agent versions, you create a reliable foundation for the re-imaging process, reducing the risk of version mismatches during the host's return to the cluster.
Although it is not necessary to use pre-created images, Cloudera recommends using them to decrease the upgrade time for each host.
- Remove Old Packages and Parcels
-
Packages and parcels for the older operating system will not start on the new operating system. Perform the following steps on every host in the cluster:
- Remove old package repository information from the snapshot. Run the following
command to remove old packages from the host:
-
- RHEL / CentOS
-
sudo yum remove cloudera-manager-server cloudera-manager-daemons cloudera-manager-agent sudo rm /etc/yum.repos.d/cloudera*manager.repo*
-
- SLES
-
sudo zypper remove cloudera-manager-server cloudera-manager-daemons cloudera-manager-agent sudo rm /etc/zypp/repos.d/cloudera*manager.repo*
-
- Ubuntu
-
sudo apt-get remove cloudera-manager-server cloudera-manager-daemons cloudera-manager-agent sudo rm /etc/apt/sources.list.d/cloudera*.list*
-
- Remove old parcels from the image and empty the default parcel storage
directories, or modify these paths if you use a custom
configuration:
sudo rm -rf /opt/cloudera/parcels/* sudo rm -rf /opt/cloudera/parcel-cache/* - Remove the repository file:
sudo rm /etc/yum.repos.d/cloudera*manager.repo*
- Remove old package repository information from the snapshot. Run the following
command to remove old packages from the host:
- Add New Packages and Parcels
-
- Ensure the new packages and parcels match your existing Cloudera Manager version, your existing Cloudera Runtime version, and the new operating system.
- Copy the Repository File: Copy the
cloudera_manager.repofile (orcloudera-manager.listfor Ubuntu) that you created during the OS upgrade preparation phase to the same location on all cluster hosts. - Run the following command to update the Package Index:
sudo apt-get update - Install Cloudera Manager Agent packages for the version of Cloudera Manager
currently in use:
sudo yum clean all sudo yum install cloudera-manager-daemons cloudera-manager-agent - Empty the following directories, as the backup overwrites them after you apply the image.
/etc/cloudera-scm-agent/etc/default/cloudera-scm-agent/var/run/cloudera-scm-agent/var/lib/cloudera-scm-agent
- You can save time by skipping the parcel distribution step. To do this, add the Cloudera Platform version that matches your current cluster to the variant for your new operating system.
Step 3: Upgrade the Cloudera Manager Server
- Stop the Cloudera Manager Server and Agent running on the
server:
sudo systemctl stop cloudera-scm-server sudo systemctl stop cloudera-scm-agent - Back up the following Cloudera Manager directories:
/etc/cloudera-scm-agent/etc/default/cloudera-scm-agent/var/run/cloudera-scm-agent/var/lib/cloudera-scm-agent
-
Re-image the operating system disk with the image prepared in Step 2: Image Preparation.warningWipe only the operating system disk. Do not wipe the data disks.
- Ensure the DNS resolves back to the machine using the original hostname.
- Restore the following Cloudera Manager directories from your backup:
/etc/cloudera-scm-agent/etc/default/cloudera-scm-agent/var/run/cloudera-scm-agent/var/lib/cloudera-scm-agent
- Start the Cloudera Manager Server and Agent on the
server:
sudo systemctl start cloudera-scm-server sudo systemctl start cloudera-scm-agent -
- Verify and Merge Configurations
-
-
Confirm that your backed-up configuration files remain intact. Correct any issues if necessary.
-
If you customized the
/etc/cloudera-scm-agent/config.inifile, the system renames your custom file with a.rpmsaveor.dpkg-oldextension. Merge your customizations back into the newconfig.inifile that the package manager installs.
-
Step 4: Per-Host Upgrade Process
-
Place the host into maintenance mode:
- Go to the page in Cloudera Manager by selecting Begin Maintenance (Suppress Alerts/Decommission) from the Actions for Selected menu.
-
- Option 1: For Data Nodes
-
Ensure you select decommission host(s) and Take DataNode offline.
This action pauses replication for a specified duration (default: 240 minutes). Ensure the chosen value provides enough time to reimage the operating system and bring the host back online with the same hostname.
- Option 2: For Compute Nodes
-
Ensure you select decommission host(s) for the host, but do not select decommission the DataNode. Decommissioning the DataNode triggers data relocation, which increases the total time required to shut down the node.
- Stop the Cloudera Manager
Agent:
sudo systemctl stop cloudera-scm-agent -
Back up the following Cloudera Manager directories:
-
/etc/cloudera-scm-agent -
/etc/default/cloudera-scm-agent -
/var/run/cloudera-scm-agent -
/var/lib/cloudera-scm-agent -
- Example
-
sudo -E tar -cf $CM_BACKUP_DIR/cloudera-scm-agent.tar --exclude=*.sock /etc/cloudera-scm-agent /etc/default/cloudera-scm-agent /var/run/cloudera-scm-agent /var/lib/cloudera-scm-agent
-
-
Re-image the operating system disk with the image prepared in Step 2: Image Preparation.warningOnly wipe the operating system disk; do not touch the data disks.
-
Ensure DNS resolves correctly to the machine using the original hostname.
- Restore the following Cloudera Manager directories from your backup:
/etc/cloudera-scm-agent/etc/default/cloudera-scm-agent/var/run/cloudera-scm-agent/var/lib/cloudera-scm-agent
-
Start the Cloudera Manager Agent:
sudo systemctl start cloudera-scm-agent -
Take the host out of maintenance mode.
-
Confirm the host health by verifying the following conditions:
-
Cloudera Manager displays the host health as Good.
-
All roles start successfully and report a Good status.
-
HDFS completes replication and shows all 3 replicas are available.
-
Refresh the NameNode if the host resides on a NameNode to ensure it is fully operational.
-
-
