After registering a CDH or CDP cluster in DataWorks, you can configure mappings between the Alibaba Cloud accounts of workspace members and specified cluster identities. This allows workspace members to access the cluster by using their mapped identities. The configuration process is similar for CDH and CDP clusters. This topic uses a CDH cluster as an example.
Mapping types
When you register a CDH cluster in DataWorks, you can use the Default Access Identity parameter to specify the account used to run task code in the CDH cluster. For more information, see Configure the default access identity for a cluster. The following table describes the account types and mapping types that you can configure for the Default Access Identity parameter.
|
Account types |
Mapping types |
||
|
Cluster account |
When a CDH task runs in DataWorks, its code runs using this cluster account, regardless of who submits the task. For example, CDH tasks submitted by an Alibaba Cloud account, a RAM user with the workspace administrator role, or a RAM user with only the developer role all run using the configured cluster account. |
No Authentication |
If Default Access Identity is set to a cluster account, the Mapping Type between the Alibaba Cloud account and the cluster account defaults to No Authentication. Important
If you set Default Access Identity to a mapping account, you cannot select No Authentication as the mapping type. Otherwise, CDH tasks fail because the Alibaba Cloud account lacks an access identity. You must select Mapping to System Account, Mapping to OpenLDAP Account, or Mapping to Kerberos Account. |
|
Mapping account |
When different workspace members run CDH tasks in DataWorks, the tasks run using the CDH system account, Kerberos account, or OPEN LDAP account mapped to their Alibaba Cloud accounts (Alibaba Cloud account or RAM user). If you select Important
A CDH task submitted by an Alibaba Cloud account may fail due to a lack of an access identity in the following cases:
|
Mapping to System Account |
|
|
Mapping to OpenLDAP Account |
|
||
|
Mapping to Kerberos Account |
|
||
Prerequisites
-
You have created the required CDH cluster accounts.
-
Before you use Kerberos account mapping, make sure that the Kerberos service is enabled on the cluster.
-
Before you use OPEN LDAP account mapping, make sure that the OPEN LDAP service is enabled on the cluster.
-
A CDH computing resource is bound to the DataWorks workspace.
Step 1: Go to the account mapping page
-
Log on to the DataWorks console. After switching to the destination region, click in the left-side navigation pane. From the drop-down list, select the target workspace and click Go to Management Center.
-
In the left-side navigation pane, click Computing Resources to go to the computing resources page.
-
On the computing resources page, find the target CDH cluster and click below the cluster name.
On this page, you can configure mappings between Alibaba Cloud accounts in DataWorks and CDH cluster accounts. This determines which cluster account runs CDH tasks submitted by an Alibaba Cloud account.
Step 2: Set up cluster account mapping
This configuration determines which cluster account runs task code for CDH tasks in DataWorks. Follow these steps:
-
Select a mapping type.
You can select No Authentication, Mapping to System Account, Mapping to OpenLDAP Account, or Mapping to Kerberos Account. For more information, see Mapping types.
-
Configure the cluster account mapping.
NoteIf you select No Authentication, you do not need to configure mappings. The platform runs tasks using the cluster account specified in the basic information during cluster registration. For more information, see Bind a CDH computing resource.
System account mapping
To map an Alibaba Cloud account (Alibaba Cloud account or RAM user) to a CDH cluster system account, add the required account information.
-
Run tasks using an Alibaba Cloud account: Select an Alibaba Cloud account and configure the mapped cluster system account.
-
Run tasks using a RAM user: Select a RAM user and configure the mapped cluster system account. Two mapping relationships are supported:
-
Same-name mapping (default): Runs CDH tasks using a cluster system account with the same name as the RAM user. For example:
-
Alibaba Cloud RAM user: ram_user_1@xxx.onaliyun.com
-
Same-name cluster account: ram_user_1
After this mapping is configured, CDH tasks submitted by ram_user_1@xxx.onaliyun.com run as ram_user_1.
Note-
By default, when you run CDH tasks in DataWorks as a RAM user, DataWorks runs the tasks using the cluster system account that has the same name. You can also map the RAM user to a cluster account with a different name.
-
To prevent task failures, make sure that an account with the same name exists in the CDH cluster. You can go to the page to configure the account.
-
-
Different-name mapping: Runs CDH tasks using a cluster system account that has a different name from the mapped RAM user. Follow the on-screen instructions to configure the mapping.
-
Kerberos account mapping
Configure mappings between Alibaba Cloud accounts (Alibaba Cloud accounts or RAM users) and CDH Kerberos accounts. A Kerberos account uses the instance_name@REALM_NAME format, for example, cdn_test@HADOOP.COM.
Kerberos authentication requires a keytab file and a krb5.conf file:
-
The
krb5.conffile stores the Key Distribution Center (KDC) server configurations. -
The
keytab filestores the authentication credentials of a resource principal. The filename must follow the Kerberos account.keytab format.
Add the required account information and upload the required files as prompted on the page.
Note-
You must use this mapping type when Kerberos authentication is enabled for Hive Metastore in the CDH cluster. Otherwise, metadata retrieval will be affected.
-
If you use the Presto component and select this mapping type, you must configure the
Config.PropertiesandPresto.Jksfiles in the cluster's basic information. -
Make sure that the Kerberos service is enabled on the cluster.
OPEN LDAP account mapping
Configure mappings between Alibaba Cloud accounts (Alibaba Cloud accounts or RAM users) and CDH OPEN LDAP accounts. Add the required account information as prompted on the page.
Note-
If you use the Presto component and select this mapping type, you must configure the
Config.PropertiesandPresto.Jksfiles in the cluster's basic information. -
Make sure that the OPEN LDAP service is enabled on the cluster.
-
-
Click Complete Modification to complete the configuration. Tasks submitted by an Alibaba Cloud account will then run using its mapped cluster account.