This topic describes how to upgrade JindoSDK on x86-based EMR clusters for different scenarios.
Prerequisites
You have created an x86-based EMR cluster. For more information, see Create a cluster.
Scenario 1: Upgrade an existing cluster
If you have an EMR cluster that runs EMR v5.6.0 or later, or EMR v3.40.0 or later, and you need to resolve known JindoData issues or use new JindoSDK features, follow these steps to upgrade JindoSDK.
When you upgrade from JindoSDK 4.6.8 or earlier to 4.6.9 or later, or to a 6.x version, the default temporary path that JindoCommitter uses for jobs changes. To prevent data loss during the upgrade, log on to the Services page of the cluster and add one of the following configuration items before the upgrade:
-
On the Hadoop-Common service's Configure tab, add the
fs.jdo.committer.allow.concurrent=falseconfiguration item to core-site.xml. -
On the Configure service's Configure tab, add the
spark.hadoop.fs.jdo.committer.allow.concurrent=falseconfiguration item to spark-defaults.conf.
After you upgrade JindoSDK on all nodes in your cluster, including Gateway nodes, set the parameter to true.
Step 1: Prepare the package and upgrade scripts
Determine the JindoSDK version that you need for the upgrade:
-
Direct access to OSS/OSS-HDFS:
If you use JindoSDK only to directly access Object Storage Service (OSS) or OSS-HDFS, check whether your local Hadoop dependency is an early version, such as a version earlier than 2.7. If so, additional compatibility adjustments may be required.
-
Use of semi-managed services:
If you use semi-managed services such as JindoCache, JindoAuth, or JindoFSx, contact the Alibaba Cloud EMR technical support team to confirm JindoSDK version compatibility and ensure a smooth upgrade.
-
Log on to the master node of the EMR cluster. For more information, see Log on to a cluster.
-
Download the patch package to the home directory of
emr-userand decompress the package.su - emr-user cd /home/emr-user/ wget https://jindodata-binary.oss-cn-shanghai.aliyuncs.com/resources/emr-taihao/jindosdk-patches.tar.gz tar zxf jindosdk-patches.tar.gz -
Download the JindoSDK package
jindosdk-{VERSION}.tar.gzand place it in the decompressed directory.This example upgrades JindoSDK in the cluster to version 6.8.2.
cd jindosdk-patches wget https://jindodata-binary.oss-cn-shanghai.aliyuncs.com/release/6.8.2/jindosdk-6.8.2-linux.tar.gz ls -lThe
jindosdk-patchesdirectory contains the following files:-rwxrwxr-x 1 emr-user emr-user 2439 May 01 00:00 apply_all.sh -rwxrwxr-x 1 emr-user emr-user 7315 May 01 00:00 apply.sh -rw-rw-r-- 1 emr-user emr-user 40 May 01 00:00 hosts -rw-r----- 1 emr-user emr-user xxxxxxxxx May 01 00:00 jindosdk-6.8.2-linux.tar.gz -rwxrwxr-x 1 emr-user emr-user 1112 May 01 00:00 revert_all.sh -rwxrwxr-x 1 emr-user emr-user 2042 May 01 00:00 revert.sh
Step 2: Configure node information
-
Manually configure node information
-
Edit the
hostsfile in the patch package.vim hosts -
Add the hostnames of all nodes in the cluster, such as
master-1-1orcore-1-1, with one hostname per line.For example, the
hostsfile contains the following content:master-1-1 core-1-1 core-1-2
-
-
Automatically populate node information
You can also run the following command to retrieve all node information. If the command fails to populate the
hostsfile, you must add the node information manually.cat /usr/local/taihao-executor-all/data/cache/.cluster_context | jq --raw-output '.nodes[].hostname.alias[]' > hosts
Step 3: Run the upgrade
Run the apply_all.sh script to upgrade JindoSDK to the specified version.
./apply_all.sh $NEW_JINDOSDK_VERSION # Run the apply_all.sh script with the specified $NEW_JINDOSDK_VERSION to upgrade JindoSDK to that version.
For example, to upgrade JindoSDK in the cluster to version 6.8.2:
./apply_all.sh 6.8.2
The script is finished when the output contains ### DONE.
>>> updating ... master-1-1
>>> updating ... core-1-1
>>> updating ... core-1-2
### DONE
Step 4: Modify cluster configuration (for compatibility with legacy EMR OSS Ranger authentication)
If EMR OSS Ranger authentication is enabled and you are upgrading JindoSDK from EMR v3.51.2/v5.17.2 or earlier to a version between 6.5.0 and 6.7.2, you might encounter compatibility issues. We recommend upgrading JindoSDK to version 6.7.3 or later and modifying the cluster configuration as follows.
-
On the Configure page of the HADOOP-COMMON service, click the core-site.xml tab.
-
On the core-site.xml tab, find and modify the following configuration item.
Parameter
Description
fs.jdo.plugin.dir
Set the plugin loading directory to the plugin path of the new JindoSDK version. Change the value from
/opt/apps/RANGER/jindoauth-current/pluginsto/opt/apps/JINDOSDK/jindosdk-current/plugins.
Step 5: Handle special nodes
-
Upgrade Gateway nodes created using the EMR CLI.
-
If a Gateway node was created in the EMR console, it is already covered by the preceding steps.
-
If you created a Gateway node using the EMR CLI, it exists independently and you must run the upgrade script on it manually. In addition, you must upgrade elastic nodes in advance when you initialize them.
-
-
Replace the JindoSDK for services such as Trino, Presto, and Impala.
For EMR clusters running versions earlier than EMR v3.53.0 or v5.19.0, the JindoSDK for services such as Trino, Presto, and Impala does not upgrade automatically. You must manually replace the JindoSDK JAR file in the
pluginspath of these services with the target version and restart the services to apply the changes.
Step 6: Verify the upgrade
ls -l /opt/apps/JINDOSDK/jindosdk-current/lib
The following example shows the output after upgrading from the default version 6.2.0 to 6.8.2.
lrwxrwxrwx 1 emr-user emr-user 64 Apr 12 11:08 jindo-core-6.2.0.jar -> /opt/apps/JINDOSDK/jindosdk-6.8.2-linux/lib/jindo-core-6.8.2.jar
lrwxrwxrwx 1 emr-user emr-user 82 Apr 12 11:08 jindo-core-linux-el7-aarch64-6.2.0.jar -> /opt/apps/JINDOSDK/jindosdk-6.8.2-linux/lib/jindo-core-linux-el7-aarch64-6.8.2.jar
lrwxrwxrwx 1 emr-user emr-user 63 Apr 12 11:08 jindo-sdk-6.2.0.jar -> /opt/apps/JINDOSDK/jindosdk-6.8.2-linux/lib/jindo-sdk-6.8.2.jar
lrwxrwxrwx 1 emr-user emr-user 50 Apr 12 11:08 native -> /opt/apps/JINDOSDK/jindosdk-6.8.2-linux/lib/native
lrwxrwxrwx 1 emr-user emr-user 57 Apr 12 11:08 site-packages -> /opt/apps/JINDOSDK/jindosdk-6.8.2-linux/lib/site-packages
Step 7: Restart services
Stop any running YARN jobs (applications), such as Spark Streaming or Flink jobs, and then perform a batch rolling restart of the YARN NodeManager service.
To apply the upgrade, restart services such as Hive, Presto, Impala, Flink, Ranger, Spark, and Zeppelin.
For example, to restart the Hive service, go to the Hive service page of your EMR cluster and choose in the upper-right corner.
Scenario 2: Scale out or create a cluster
When you scale out an existing cluster and need to deploy a new JindoSDK version, you can use a bootstrap action in the EMR console to automate the process. This ensures that JindoSDK upgrades successfully when you create a new cluster or add nodes to an existing one. Follow these steps to perform the upgrade.
Step 1: Create a bootstrap upgrade package
-
Run the following commands to download
jindosdk-patches.tar.gz,jindosdk-{VERSION}-{PLATFORM}.tar.gz, andbootstrap_jindosdk.sh.This example upgrades JindoSDK in the cluster to version 6.8.2.
mkdir jindo-patch cd jindo-patch wget https://jindodata-binary.oss-cn-shanghai.aliyuncs.com/resources/emr-taihao/jindosdk-patches.tar.gz wget https://jindodata-binary.oss-cn-shanghai.aliyuncs.com/release/6.8.2/jindosdk-6.8.2-linux.tar.gz wget https://jindodata-binary.oss-cn-shanghai.aliyuncs.com/resources/emr-taihao/bootstrap_jindosdk.sh ls -lThe following output is returned:
-rw-r----- 1 hadoop hadoop xxxx May 01 00:00 bootstrap_jindosdk.sh -rw-r----- 1 hadoop hadoop xxxxxxxxx May 01 00:00 jindosdk-6.8.2-linux.tar.gz -rw-r----- 1 hadoop hadoop xxxx May 01 00:00 jindosdk-patches.tar.gz -
Run the following command to create the upgrade package.
bash bootstrap_jindosdk.sh -gen $NEW_JINDOSDK_VERSION # Run the bootstrap_jindosdk.sh script with the specified $NEW_JINDOSDK_VERSION to upgrade JindoSDK to that version.Note-
To scale out an existing cluster, use the
-genoption to generate a lightweight upgrade package. -
To create a new cluster, use the
-gen-fulloption to generate an upgrade package that contains all the required content.
For example, to upgrade JindoSDK to version 6.8.2:
bash bootstrap_jindosdk.sh -gen 6.8.2After the upgrade package is created, the following message is displayed.
Generated patch at /home/emr-user/jindo-patch/jindosdk-bootstrap-patches.tar.gzWhen the build is complete, the patch package
jindosdk-bootstrap-patches.tar.gzis generated. -
Step 2: Upload the bootstrap package
Upload the patch package and the bootstrap script to OSS. You can use Hadoop commands from within the EMR cluster, or use tools such as the Alibaba Cloud OSS console, ossutil, or OSS Browser.
For example, the OSS paths are oss://<bucket-name>/path/to/bootstrap_jindosdk.sh and oss://<bucket-name>/path/to/jindosdk-bootstrap-patches.tar.gz.
hadoop dfs -mkdir -p oss://<bucket-name>/path/to/patch/
cd /home/hadoop/patch/
hadoop dfs -put jindosdk-bootstrap-patches.tar.gz oss://<bucket-name>/path/to/patch/
hadoop dfs -put bootstrap_jindosdk.sh oss://<bucket-name>/path/to/patch/
hadoop dfs -ls oss://<bucket-name>/path/to/patch/
The following output is returned:
Found 2 items
-rw-rw-rw- 1 2634 2022-05-13 14:07 oss://<bucket-name>/.../bootstrap_jindosdk.sh
-rw-rw-rw- 1 597342992 2022-05-13 13:41 oss://<bucket-name>/.../jindosdk-bootstrap-patches.tar.gz
Step 3: Add a bootstrap action
Add a bootstrap action in the EMR console. For more information, see Manage bootstrap actions.
Configure the bootstrap action with the settings in the following table.
|
Parameter |
Description |
Example |
|
Name |
The name of the bootstrap action. For example, Upgrade JindoSDK. |
update_jindosdk |
|
Script location |
The OSS path where the script is stored. The script path must be in the |
|
|
Arguments |
The arguments for the bootstrap action script. These arguments specify the values of variables that the script references. |
|
|
Execution scope |
Select Cluster. |
Cluster |
|
Execution time |
Select After Component Startup. |
After Component Startup |
|
Failure policy |
Select Proceed. |
Proceed With Execution |
Step 4: Handle special nodes
-
Upgrade Gateway nodes created using the EMR CLI.
-
If a Gateway node was created in the EMR console, it is already covered by the preceding steps.
-
If you created a Gateway node using the EMR CLI, it exists independently and you must run the upgrade script on it manually. In addition, you must upgrade elastic nodes in advance when you initialize them.
-
-
Replace the JindoSDK for services such as Trino, Presto, and Impala.
For EMR clusters running versions earlier than EMR v3.53.0 or v5.19.0, the JindoSDK for services such as Trino, Presto, and Impala does not upgrade automatically. You must manually replace the JindoSDK JAR file in the
pluginspath of these services with the target version and restart the services to apply the changes.
Step 5: Restart services
Restart the relevant services to ensure they load the latest fixes.
-
If you are creating a new cluster, restart services such as Hive, Presto, Impala, Flink, Ranger, Spark, and Zeppelin.
-
If you are scaling out by adding new nodes, restart the services on those nodes.
Scenario 3: Roll back JindoSDK
If your cluster runs EMR v5.6.0 or later, or EMR v3.40.0 or later, and you encounter issues during an upgrade and need to roll back to the default JindoSDK version, follow these steps.
Step 1: Prepare the rollback scripts
-
Log on to the master node of the EMR cluster. For more information, see Log on to a cluster.
-
Download the patch package to the home directory of
emr-userand decompress the package.su - emr-user cd /home/emr-user/ wget https://jindodata-binary.oss-cn-shanghai.aliyuncs.com/resources/emr-taihao/jindosdk-patches.tar.gz tar zxf jindosdk-patches.tar.gz cd jindosdk-patches ls -lThe following output is returned:
-rwxrwxr-x 1 emr-user emr-user 2439 May 01 00:00 apply_all.sh -rwxrwxr-x 1 emr-user emr-user 7315 May 01 00:00 apply.sh -rw-rw-r-- 1 emr-user emr-user 40 May 01 00:00 hosts -rwxrwxr-x 1 emr-user emr-user 1112 May 01 00:00 revert_all.sh -rwxrwxr-x 1 emr-user emr-user 2042 May 01 00:00 revert.sh
Step 2: Configure node information
-
Manually configure node information
-
Edit the
hostsfile in the patch package.vim hosts -
Add the hostnames of all nodes in the cluster, such as
master-1-1orcore-1-1, with one hostname per line.For example, the
hostsfile contains the following content:master-1-1 core-1-1 core-1-2
-
-
Automatically populate node information
You can also run the following command to retrieve all node information. If the command fails to populate the
hostsfile, you must add the node information manually.cat /usr/local/taihao-executor-all/data/cache/.cluster_context | jq --raw-output '.nodes[].hostname.alias[]' > hosts
Step 3: Run the rollback
Run the following command to roll back all changes.
./revert_all.sh
The script is finished when the output contains ### DONE.
>>> updating ... master-1-1
>>> updating ... core-1-1
>>> updating ... core-1-2
### DONE
Step 4: Verify the rollback
ls -l /opt/apps/JINDOSDK/jindosdk-current/lib
The following example shows the output after rolling back to version 6.2.0.
-rw-r--r-- 1 emr-user emr-user 1253740 Apr 24 17:40 jindo-core-6.2.0.jar
-rw-r--r-- 1 emr-user emr-user 13110547 Apr 24 17:40 jindo-core-linux-el7-aarch64-6.2.0.jar
-rw-r--r-- 1 emr-user emr-user 4432227 Apr 24 17:40 jindo-sdk-6.2.0.jar
drwxr-xr-x 2 emr-user emr-user 4096 Apr 24 17:40 native
Step 5: Handle special nodes
-
Upgrade Gateway nodes created using the EMR CLI.
-
If a Gateway node was created in the EMR console, it is already covered by the preceding steps.
-
If you created a Gateway node using the EMR CLI, it exists independently and you must run the upgrade script on it manually. In addition, you must upgrade elastic nodes in advance when you initialize them.
-
-
Replace the JindoSDK for services such as Trino, Presto, and Impala.
For EMR clusters running versions earlier than EMR v3.53.0 or v5.19.0, the JindoSDK for services such as Trino, Presto, and Impala does not roll back automatically. Manually replace the JindoSDK JAR file in the
pluginspath of these services with the default version, and restart the services to apply the changes.
Step 6: Restart services
Stop any running YARN jobs (applications), such as Spark Streaming or Flink jobs, and then perform a batch rolling restart of the YARN NodeManager service.
To apply the rollback, restart services such as Hive, Presto, Impala, Flink, Ranger, Spark, and Zeppelin.
For example, to restart the Hive service, go to the Hive service page of your EMR cluster and choose in the upper-right corner.