Upgrading Replicated Clusters
Consider a scenario where CDAP is running on the master cluster with data getting replicated on the slave cluster. To upgrade the replicated clusters, follow these steps:
Update the CDAP repository definition on the slave cluster by running either of these methods:
On RPM using Yum:
$ sudo curl -o /etc/yum.repos.d/cask.repo https://repository.cdap.io/centos/6/x86_64/cdap/6.2/cask.repo
This will create the file /etc/yum.repos.d/cask.repo
with:
[cask]
name=Cask Packages
baseurl=https://repository.cdap.io/centos/6/x86_64/cdap/6.2
enabled=1
gpgcheck=1
Add the Cask Public GPG Key to your repository:
$ sudo rpm --import https://repository.cdap.io/centos/6/x86_64/cdap/6.2/pubkey.gpg
Update your Yum cache:
$ sudo yum makecache
On Debian using APT:
$ sudo curl -o /etc/apt/sources.list.d/cask.list https://repository.cdap.io/ubuntu/precise/amd64/cdap/6.2/cask.list
This will create the file /etc/apt/sources.list.d/cask.list
with:
deb [ arch=amd64 ] https://repository.cdap.io/ubuntu/precise/amd64/cdap/6.2 precise cdap
Add the Cask Public GPG Key to your repository:
$ curl -s https://repository.cdap.io/ubuntu/precise/amd64/cdap/6.2/pubkey.gpg | sudo apt-key add -
Update your APT-cache:
$ sudo apt-get update
Update the CDAP packages on the slave cluster by running either of these methods:
On RPM using Yum:
$ sudo yum upgrade 'cdap*'
On Debian using APT:
$ sudo apt-get install --only-upgrade '^cdap.*'
Generate the coprocessor jar on the slave cluster corresponding to the newly downloaded CDAP version:
$ sudo -u <cdap-user> cdap setup coprocessors
The coprocessor jar will be stored on the HDFS and path to the jar will be printed on console.
Copy the coprocessor jar to the same HDFS location on the master cluster.
Stop all CDAP services on the master cluster.
Make sure that all HBase and HDFS data is replicated on the slave cluster.
Run the upgrade tool on the slave cluster.:
$ sudo -u <cdap-user> /opt/cdap/master/bin/cdap run io.cdap.cdap.data.tools.UpgradeTool upgrade
Since replication is enabled and HBaseDDLExecutor is in place, HBase tables on the master cluster will also get upgraded.
New version of the CDAP can be started on the slave cluster now.
Download and install the new CDAP packages on the master cluster using the steps mentioned above for slave. This is to keep the master ready when there is a failover from slave. Note that there is no need to run the upgrade tool on the master since HBase tables on master were already upgraded when the upgrade tool was executed on the slave.
Related content
Created in 2020 by Google Inc.