El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Submitting a Spark Job as a Proxy User

Updated on 2024-10-09 GMT+08:00
NOTE:

This section applies only to MRS 3.3.0 and later versions.

Scenario

Submit a Spark task as the actual running user or a proxy user. This section describes how to enable the proxy user function to submit Spark tasks.

Prerequisites

The test (actual running user) and test1 (proxy user) users have been created and added to the hadoop (primary group), hive, and supergroup groups.

Submitting a Spark Task as a Proxy User in spark-beeline

  1. Modify JDBCServer instance parameters.

    Log in to FusionInsight Manager and choose Cluster > Services > Spark. Click Configurations, click All Configurations, click JDBCServer(Role), select Customization, find the spark.core-site.customized.configs parameter, and add the following custom parameters:

    Parameter

    Value

    hadoop.proxyuser.test.hosts

    *

    hadoop.proxyuser.test.groups

    *

    NOTE:
    • In the configuration, test is the actual running user.
    • The value of hadoop.proxyuser.test.hosts is *, which indicates that any proxy user can be used after user test is connected and the number of cluster nodes is not limited.
    • The value of hadoop.proxyuser.test.groups is *, which indicates that any proxy user can be used after user test is connected and the proxy user can belong to any user group.

  2. Change the values of the following parameters to switch to the JDBCServer multi-instance mode:

    Parameter

    Value

    spark.scheduler.allocation.file

    #{conf_dir}/fairscheduler.xml

    spark.thriftserver.proxy.enabled

    false

  3. Save the configuration and restart the Spark service.
  4. Log in to the Spark client node and run the following commands:

    cd Client installation directory

    source bigdata_env

    source Spark/component_env

    In security mode, additionally run the following command:

    kinit test Enter the password for authentication. (Change the password upon your first login.)

  5. Run the following Beeline commands of Spark to submit a task:

    cd /opt/client/Spark/spark/bin

    ./beeline

    !connect jdbc:hive2://IP address of the node where the ZooKeeper instance is:Port number of the ZooKeeper client,IP address of the node where the ZooKeeper instance is:Port number of the ZooKeeper client,IP address of the node where the ZooKeeper instance is:Port number of the ZooKeeper client/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=sparkthriftserver;saslQop=auth-conf;auth=KERBEROS;principal=spark2x/hadoop.hadoop.com@HADOOP.COM;hive.server2.proxy.user=test1

    Specifically:

    • IP address of the node where the ZooKeeper instance is: To obtain the IP address, on FusionInsight Manager, choose Cluster > Services > ZooKeeper and click Instance.
    • Port number of the ZooKeeper client: To obtain the port number, on FusionInsight Manager, choose Cluster > Services > ZooKeeper, click Configurations then All Configurations, and search for clientPort.
    • hive.server2.proxy.user=test1: test1 is a proxy user.

  6. Create a Spark table.

    create table sparktest1(a string,b int);

    View the created table.

    desc formatted sparktest1;

    You can see that Owner of the table is the proxy user test1, and the proxy user is successfully used.

Submitting a Spark Task as a Proxy User in spark-sql and spark-submit

  1. Modify the HDFS instance configuration. Log in to FusionInsight Manager and choose Cluster > Services > HDFS. Click Configurations then All Configurations, click HDFS(Service), select Customization, find the hdfs.core-site.customized.configs parameter, add the following custom parameters, and save the configuration:

    Parameter

    Value

    hadoop.proxyuser.test.hosts

    *

    hadoop.proxyuser.test.groups

    *

  2. Modify the Yarn instance configuration. Log in to FusionInsight Manager and choose Cluster > Services > Yarn. Click Configurations then All Configurations, click Yarn(Service), select Customization, find the yarn.core-site.customized.configs parameter, add the following custom parameters, and save the configuration:

    Parameter

    Value

    hadoop.proxyuser.test.hosts

    *

    hadoop.proxyuser.test.groups

    *

  3. Modify the SparkReource instance configuration. Log in to FusionInsight Manager and choose Cluster > Services > Spark. Click Configurations then All Configurations, click SparkResource(Role), select Customization, find the spark.core-site.customized.configs parameter, add the following custom parameters, and save the configuration:

    Parameter

    Value

    hadoop.proxyuser.test.hosts

    *

    hadoop.proxyuser.test.groups

    *

  4. Modify the Hive instance configuration. Log in to FusionInsight Manager and choose Cluster > Services > Hive. Click Configurations then All Configurations, click Hive(Service), select Customization, find the core.site.customized.configs parameter, add the following custom parameters, and save the configuration:

    Parameter

    Value

    hadoop.proxyuser.test.hosts

    *

    hadoop.proxyuser.test.groups

    *

  5. Restart the HDFS, YARN, Spark, and Hive services and update the configuration files on their clients.
  6. Log in to the Spark client node and run the following commands:

    cd Client installation directory

    source bigdata_env

    source Spark/component_env

    In security mode, additionally run the following command:

    kinit test Enter the password for authentication. (Change the password upon your first login.)

  7. Submit the spark-sql task.

    spark-sql --master yarn --proxy-user test1

  8. Create a Spark table.

    create table sparktest2(a string,b int);

    View the created table.

    desc formatted sparktest2;

    You can see that Owner of the table is the proxy user test1, and the proxy user is successfully used.

  9. Use the redelivered client to submit the spark-submit task.

    spark-submit --master yarn --class org.apache.spark.examples.SparkPi --master yarn-client --proxy-user test1 /opt/client/Spark/spark/examples/jars/spark-examples_*.jar

  10. View information about applications running in YARN.

    You can see that the running user of the task is test1, and the proxy user is successfully used.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback