This topic describes how to grant permissions to a RAM user. After the permissions are granted, the Resource Access Management (RAM) user can submit Spark jobs in Data Lake Analytics (DLA).
Prerequisites
- A RAM user is created. For more information, see Create a RAM user.
- A DLA sub-account is created. For more information, see Manage DLA accounts.
Background information
Access permissions of the serverless Spark engine are categorized into the following
types:
- Access permissions on the DLA console and API operations: control whether a RAM user can log on to the DLA console and whether the RAM user can call API operations to manage Spark jobs. For more information, see Step 1.
- Access permissions on DLA tables: control whether a RAM user can access DLA tables. By default, DLA sub-accounts control access permissions on DLA tables, and RAM users control permissions to submit Spark jobs. If you want to access a table as a RAM user, you must bind a DLA sub-account to the RAM user. For more information, see Step 2.
- Access permissions on resources on which Spark jobs depend: control whether a RAM user can access resources, including the JAR packages on which Spark jobs depend and data sources except for DLA tables, such as Object Storage Service (OSS) directories. For more information, see Step 3.
Procedure
Note Make sure that all the preceding steps are performed. If you do not perform all the
steps, a permission error is returned when you submit a job.
Verify the permissions of the RAM user
After you perform all the preceding steps, you can log on to the DLA console as a RAM user. In the left-side navigation pane, choose to submit a job to check whether the permissions of the RAM user are correctly configured.
For more information, see Create and run Spark jobs and Configure a Spark job. Sample job configurations:
{
"name": "SparkPi",
"file": "local:///tmp/spark-examples.jar",
"className": "org.apache.spark.examples.SparkPi",
"args": [
"100"
],
"conf": {
"spark.driver.resourceSpec": "medium",
"spark.executor.instances": 1,
"spark.executor.resourceSpec": "medium"
}
}
Note If you do not specify spark.dla.roleArn in conf, the system automatically uses the Alibaba Cloud Resource Name (ARN) of the AliyunDLASparkProcessingDataRole role. You can also manually specify spark.dla.roleArn. For more information, see Grant permissions to a RAM user (detailed version).