Apache Spark™ version upgrade
You can change the Apache Spark™ version to any of the versions supported by Managed Service for Apache Spark™. You can only upgrade the version.
Updates and fixes within a version are installed automatically during maintenance.
Get a list of available versions
-
Open the folder dashboard
. -
Go to Managed Service for Apache Spark™.
-
Select a cluster and click Edit on the top panel. This will open the cluster editing page.
You can see the list of available versions in the Version field.
Before a version upgrade
Make sure the upgrade will not disrupt your applications:
- Check the Apache Spark™ release notes
to learn how upgrades may affect your applications. - Try upgrading the Apache Spark™ version on a test cluster.
Upgrading the version
- Open the folder dashboard
. - Go to Managed Service for Apache Spark™.
- Select a cluster and click Edit on the top panel.
- Under Basic parameters, select Apache Spark™.
- Click Save changes.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
To change the Apache Spark™ version:
-
View the description of the CLI command for updating a cluster:
yc managed-spark cluster update --help -
Change the version by running this command:
yc managed-spark cluster update <cluster_name_or_ID> \ --spark-version <Apache_Spark_version>You can get the cluster name and ID with the list of clusters in the folder.
-
Open the current Apache Spark™ configuration file that defines your infrastructure.
For more information about creating this file, see Creating clusters.
-
Edit the
spark_versionparameter in the cluster's description:resource "yandex_spark_cluster" "<cluster_name>" { ... config = { ... spark_version = "<Apache_Spark_version>" ... } ... } -
Make sure the settings are correct.
-
In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
-
Run this command:
terraform validateTerraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform planIf you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply -
Confirm updating the resources.
-
Wait for the operation to complete.
-
-
-
Get an IAM token for API authentication and put it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, we assume that the repository contents reside in the
~/cloudapi/directory. -
Create a file named
body.jsonand paste the following code into it:{ "cluster_id": "<cluster_ID>", "update_mask": { "paths": [ "config_spec.spark_version" ] }, "config_spec": { "spark_version": "<Apache_Spark_version>" } }Where:
-
cluster_id: Cluster ID.You can get the cluster ID with the list of clusters in the folder.
-
update_mask: List of parameters to update as an array of strings (paths[]).Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }Warning
When you update a cluster, all parameters of the object you are modifying will take their defaults unless explicitly provided in the request. To avoid this, list the settings you want to change in the
update_maskparameter. -
spark_version: Apache Spark™ version.
-
-
Call the ClusterService.Update method, e.g., via the following gRPCurl
request:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/spark/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d @ \ spark.api.cloud.yandex.net:443 \ yandex.cloud.spark.v1.ClusterService.Update \ < body.json -
Check the server response to make sure your request was successful.