Preparing the Configuration File for Connecting Spark to the Cluster
Preparing User Information for Cluster Authentication
For an MRS cluster with Kerberos authentication enabled, prepare a user who has the operation permission on related components for program authentication.
The following Spark2x permission configuration example is for reference only. You can modify the configuration as you need.
- Log in to FusionInsight Manager.
- Choose Cluster > Services > Spark2x. On the displayed page, click More > Enable Ranger in the upper right corner. Check whether the button is grayed out.
- If it is grayed out, create a user and assign related operation rights to the user in Ranger.
- Choose System > Permission > User. On the displayed page, click Create. On the displayed page, create a machine-machine user, for example, developuser.
The developgroup group needs to be added. If you need to interconnect with Kafka, add the Kafkaadmin user group.
- Log in to the Ranger management page as the Ranger administrator rangeradmin.
- On the home page, click the component plug-in name in the HADOOP SQL area, for example, Hive.
- Click in the Action column of the row containing the all - database, table, column policy.
- In the Allow Conditions area, add an allow condition. Select the user created in 2.a for Select User, and select Select All for Permissions.
- Click Save.
- Choose System > Permission > User. On the displayed page, click Create. On the displayed page, create a machine-machine user, for example, developuser.
- If the button is available, create a user and grant related operation permissions to the user on Manager.
- Choose System > Permission > Role. On the displayed page, click Create Role.
- Enter the role name, for example, developrole.
- (Configure this parameter if HBase is installed.) In Configure Resource Permission, click the name of the desired cluster and choose HBase > HBase Scope > global, select the default option create, and click OK.
- (Configure this parameter if HBase is installed.) Edit the role. In Configure Resource Permission, click the name of the desired cluster and choose HBase > HBase Scope > global > hbase, select execute for hbase:meta, and click OK.
- Edit the role. In Configure Resource Permission, click the name of the desired cluster, choose HDFS > File System, and choose hdfs://hacluster/ > user. Select Execute for hive, and click OK.
- Edit the role. In Configure Resource Permission, click the name of the desired cluster, choose HDFS > File System and choose hdfs://hacluster/ > user > hive. Select Read, Write, and Execute for warehouse, and click OK.
- Edit the role. In Configure Resource Permission, click the name of the desired cluster, choose Hive > Hive Read Write Privileges, select the default option Create, and click OK.
- Edit the role. In Configure Resource Permission, click the name of the desired cluster, choose Yarn > Scheduler Queue > root, select the default option Submit, and click OK.
- Choose User in the navigation pane and click Create on the displayed page. Create a machine-machine user, for example, developuser.
- Add the hadoop user group to User Group.
- Add the new role created in 2.a to Role.
- Choose System > Permission > Role. On the displayed page, click Create Role.
- If it is grayed out, create a user and assign related operation rights to the user in Ranger.
- Log in to FusionInsight Manager as user admin and choose System > Permission > User. In the Operation column of developuser, choose More > Download Authentication Credential. Save the file and decompress it to obtain the user.keytab and krb5.conf files of the user.
Preparing the Configuration Files of the Running Environment
During application development, you need to prepare the environment for code running and commissioning to verify that the application is running properly.
- Scenario 1: Prepare the configuration files required for debugging in the local Windows development environment.
- Log in to FusionInsight Manager, choose Cluster > Dashboard, click More, and select Download Client. Set Select Client Type to Configuration Files Only. Select the platform type based on the type of the node where the client is to be installed (select x86_64 for the x86 architecture and aarch64 for the Arm architecture) and click OK. After the client files are packaged and generated, download the client to the local PC as prompted and decompress it.
For example, if the client file package is FusionInsight_Cluster_1_Services_Client.tar, decompress it to obtain FusionInsight_Cluster_1_Services_ClientConfig_ConfigFiles.tar. Then, decompress this file.
- Go to the *\Spark\config directory where the client configuration file is decompressed, obtain the Spark configuration files, and import all the configuration files to the configuration file directory (usually the resources folder) of the Spark sample project.
The keytab file obtained in Preparing User Information for Cluster Authentication is also stored in this directory.
- Copy the hosts file content from the decompression directory to the hosts file on the node where the client is located.
- If you need to debug the application in the local Windows environment, ensure that the local PC can communicate with the hosts listed in the hosts file.
- If your PC cannot communicate with the network plane where the MRS cluster is deployed, you can bind an EIP to access the MRS cluster.
- The local hosts file in a Windows environment is stored in, for example, C:\WINDOWS\system32\drivers\etc\hosts.
- Log in to FusionInsight Manager, choose Cluster > Dashboard, click More, and select Download Client. Set Select Client Type to Configuration Files Only. Select the platform type based on the type of the node where the client is to be installed (select x86_64 for the x86 architecture and aarch64 for the Arm architecture) and click OK. After the client files are packaged and generated, download the client to the local PC as prompted and decompress it.
- Scenario 2: Prepare the configuration files required for running the program in a Linux environment.
- Install the MRS cluster client in a directory, for example, /opt/client, on the node.
- Obtain the configuration files.
- Log in to FusionInsight Manager, click More and select Download Client in the upper right corner of Homepage. Set Select Client Type to Configuration Files Only, select Save to Path, and click OK to download the client configuration file to the active OMS node of the cluster.
- Log in to the active OMS node as user root, go to the directory where the client configuration file is stored (/tmp/FusionInsight-Client/ by default), decompress the software package, and obtain the configuration files in the *\Spark\config directory. Place all configuration files in the conf directory (for example, /opt/client /conf) where the compiled JAR package is stored for subsequent commissioning.
For example, if the client software package is FusionInsight_Cluster_1_Services_Client.tar and the download path is /tmp/FusionInsight-Client on the active OMS node, run the following commands:
cd /tmp/FusionInsight-Client
tar -xvf FusionInsight_Cluster_1_Services_Client.tar
tar -xvf FusionInsight_Cluster_1_Services_ClientConfig.tar
cd FusionInsight_Cluster_1_Services_ClientConfig
cp -r Spark/config/* /opt/client/conf
The keytab file obtained in Preparing User Information for Cluster Authentication is also stored in this directory.
- Check the network connection of the client node.
During the client installation, the system automatically configures the hosts file on the client node. You are advised to check whether the /etc/hosts file contains the host names of the nodes in the cluster. If they are not contained, manually copy the content in the hosts file in the decompression directory to the hosts file on the node where the client is deployed.
Feedback
Was this page helpful?
Provide feedbackThank 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