Configuring a LakeFormation Data Connection for an Existing Cluster
This topic describes how to interconnect existing clusters of MRS 3.3.0-LTS or later with LakeFormation.
Prerequisites
- Kerberos authentication has been enabled for the MRS cluster, and the cluster version is MRS 3.3.0-LTS or later.
- The MRS cluster has decoupled storage and compute enabled, with data stored in Object Storage Service (OBS).
- The cluster and the LakeFormation instance must be deployed in the same region. The cluster and the LakeFormation data connection must be in the same VPC.
- The cluster must include components such as Hadoop, Ranger, Hive, and Guardian, with Spark and Flink being optional.
- The Ranger component should have at least one PolicySync (PSC) instance that is deployed on the same node as the RangerAdmin instance, and the Guardian component should have a minimum of two TokenServer (TS) instances.
- If Spark is added after the LakeFormation data connection is configured, it is necessary to disassociate the LakeFormation data connection from Hive and reconfigure it for Spark.
- IAM users have been synchronized on the MRS console, and all services are normal.
- Ranger authentication has been enabled for Hive and Spark components within the MRS cluster.
Interconnecting the MRS Cluster with LakeFormation
- Log in to the MRS console.
- Choose Active Clusters.
- Click the name of the desired MRS cluster to enter the Dashboard tab.
- Click Manage on the right of Data Connection to go to the data connection configuration page.
- Click Configure LakeFormation Data Connection, select the LakeFormation data connection ID recorded in Creating a LakeFormation Connection from the drop-down list, and click OK. (If there is already a local database connection of Hive, you do not need to unbind it.)
To configure a LakeFormation data connection, contact technical support to apply for whitelist access.
- Click Select Agency next to Agency and select the name of the agency created in Creating an ECS/BMS Agency.
If the current MRS cluster has been bound to an agency, check whether the permission policy of the original agency needs to be retained. If yes, add the agency to the agency created in Creating an ECS/BMS Agency and bind the agency to the MRS cluster. (The agency permission does not take effect immediately.)
- Log in to MRS Manager.
For details about how to log in to FusionInsight Manager, see Accessing MRS Manager.
- Configure the Guardian component.
- On MRS Manager, choose Cluster > Services > Guardian, and click Configurations and then All Configurations. Search for and modify the following parameters, and click Save.
Table 1 Guardian parameters Parameter
Definition
Value
token.server.access.iam.domain.id
Account ID of the user who accesses IAM
Obtain the account ID by referring to Obtaining the Account ID.
xxx
token.server.access.iam.project.id
Project ID of the user who accesses IAM
Obtain the project ID by referring to Obtaining the Account ID.
xxx
token.server.access.label.agency.name
Name of an IAM agency. The agency must have the permission to access OBS.
Set the value to the name of the agency created in Creating an Agency for Interconnecting with OBS.
visit_obs_agency
fs.obs.delegation.token.providers
Name of the class that generates delegation.token. The default value is empty.
Select both the following parameters:
- com.huawei.mrs.dt.MRSDelegationTokenProvider
- com.huawei.mrs.dt.GuardianDTProvider
com.huawei.mrs.dt.MRSDelegationTokenProvider,com.huawei.mrs.dt.GuardianDTProvider
fs.obs.guardian.accesslabel.enabled
Whether to enable AccessLabel on OBS, which allows Guardian to connect to OBS.
true
fs.obs.guardian.enabled
Whether to enable Guardian.
true
- On the Dashboard tab page of the Guardian service, choose More > Restart Service.
- On MRS Manager, choose Cluster > Services > Guardian, and click Configurations and then All Configurations. Search for and modify the following parameters, and click Save.
- Interconnect Hive with the OBS file system.
- Log in to MRS Manager, choose Cluster > Services > Hive, and click Configurations and then All Configurations.
- In the navigation pane, choose HiveServer > Customization. Add the following parameters to the custom parameters.
Table 2 Custom HiveServer parameters Parameter
Description
Example Value
hive.server.customized.configs
- Add the hive.metastore.warehouse.dir parameter.
- Set this parameter to the OBS storage path of the Hive catalog, which is obtained in Creating a LakeFormation Instance.
- Name: hive.metastore.warehouse.dir
- Value: obs://lakeformation-test/hive
hive.metastore.customized.configs
This parameter is required for clusters of MRS 3.3.1 or later.
- Add the hive.metastore.warehouse.dir parameter.
- Set this parameter to the OBS storage path of the Hive catalog, which is obtained in Creating a LakeFormation Instance.
- Name: hive.metastore.warehouse.dir
- Value: obs://lakeformation-test/hive
- Click Save.
- Interconnect Spark with the OBS file system. If your cluster does not have the Spark component, skip this step.
- Log in to MRS Manager, choose Cluster > Services > Spark, and click Configurations and then All Configurations.
- In the navigation pane, choose JDBCServer > Customization. Add custom parameters and set them by referring to the following table.
Table 3 Spark parameters Parameter
Value
spark.hive-site.customized.configs
- Parameter: hive.metastore.warehouse.dir
- Value: Set this parameter to the OBS storage path of the Hive catalog, which is obtained in Creating a LakeFormation Instance. For example, obs://lakeformation-test/hive.
- In the navigation pane, choose SparkResource > Customization. Set parameters by referring to Table 3.
- Click Save.
- On the Components tab page of the MRS cluster, check whether there are components whose configurations have expired. If there are, click Restart in the Operation column to restart these components.
- Download and reinstall the complete MRS cluster client. For details, see Installing a Client.
- Update the built-in client configuration file of the cluster to submit jobs on the management console.
On the dashboard page of the MRS cluster, obtain the EIP, use this IP address to log in to a Master node, and run the following commands to update the built-in client of the cluster:
su - omm
sh /opt/executor/bin/refresh-client-config.sh
- Log in to the node where the client is installed and check the database on the Hive client to verify that the interconnection is successful.
source Client installation path//bigdata_env
kinit Component service user
beeline
show databases;desc database default;
!q
- On the Spark client, check the database to verify that the interconnection is successful. If your cluster does not have the Spark component, skip this step.
source Client installation path//Spark/component_env
spark-sql
show databases;desc database default;
Helpful Links
After LakeFormation is interconnected, you can configure Hive parameters so that when you view databases or tables in the Hive client, or retrieve metadata using the JDBC getMetaData API, only databases and tables accessible to the current user are displayed. Unauthorized databases and tables will not be displayed. For details, see Configuring Database and Table Visibility When Hive Is Connected to LakeFormation.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot