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
On this page
Help Center/ MapReduce Service/ Component Operation Guide (LTS) (Ankara Region)/ Using Spark/ Spark FAQ/ Why Does the Cluster Port Fail to Connect When a Client Outside the Cluster Is Installed or Used?

Why Does the Cluster Port Fail to Connect When a Client Outside the Cluster Is Installed or Used?

Updated on 2024-11-29 GMT+08:00

Question

When a client outside the cluster is installed or used, the Spark task port sometimes fails to be connected.

Exception information: Failed to bind SparkUi

Cannot assign requested address: Service 'sparkDriver' failed after 16 retries (on a random free port)! Consider explicitly setting the appropriate binding address for the service 'sparkDriver' (for example spark.driver.bindAddress for SparkDriver) to the correct binding address.

Causes

  • The network between the cluster node and the client node is disconnected.
  • The firewall on the client node is not disabled.
  • If the port is occupied, each Spark task occupies a SparkUI port. The default port number is 22600. If the port is occupied, increase the port number in sequence and try again. However, there are only 16 retries by default. After the 16 retries, this task is aborted.
  • The Spark configuration parameters on the client are incorrect.
  • The code is incorrect.

Solution

The application cannot access the IP address and port number of SparkUI. The possible causes are as follows:

  • Check whether the cluster node communicates with the client node.

    Run the following command on the client node to check whether the cluster node mapping is configured in the /etc/hosts file on the client node:

    ping SparkUI IP address

    If the IP address cannot be pinged, check the mapping configuration and network configuration.

  • Disable the firewall on the client node.

    Run the following command to check whether the function is disabled:

    systemctl status firewalld (The query command varies depending on the OS. This command uses CentOS as an example.)

    As shown in the following figure, dead indicates that the function is disabled.

    If the firewall is enabled, the communication is affected. Run the following command to disable the firewall:

    service firewalld stop (The query command varies depending on the OS. This command uses CentOS as an example.)

  • Check whether the port is occupied.

    ssh -v -p port username@ip

    If the message "Connection established" is displayed, it indicates that the connection is successful and the port is occupied.

    The Spark UI port range is determined by the spark.random.port.min and spark.random.port.max parameters in the spark-defaults.conf configuration file. If all ports in the range are used,

    No port is available and the connection fails.

    Solution: Set spark.port.maxRetries to 50 and adjust the random port range of the executor to spark.random.port.max plus 100.

  • View Spark configuration parameters:

    Run the cat spark-env.sh command on the client node to check whether the SPARK_LOCAL_HOSTNAME value is the IP address of the local host.

    This problem may occur when the client is directly copied from another node and the configuration parameters are not modified.

    Change the value of SPARK_LOCAL_HOSTNAME to the IP address of the local host.

    Note: If the cluster uses EIPs for communication, you need to add the following configuration:

    1. Add spark.driver.host=Elastic IP address of the client node to spark-default.conf.
    2. Add spark.driver.bindAddress=IP address of the local host to spark-default.conf.
    3. Add SPARK_LOCAL_HOSTNAME=Elastic IP address of the client node to spark-env.sh.
  • If the communication and configuration are normal, check the code.

    When Spark starts a task, sparkDriverEnv is created on the client and bound to DRIVER_BIND_ADDRESS. This logic does not go to the server. So, this problem occurs because sparkDriver cannot obtain the corresponding host IP address due to abnormal OS environment of the client node.

    You can run the export SPARK_LOCAL_HOSTNAME=172.0.0.1 command or set spark.driver.bindAddress to 127.0.0.1 so that the driver that submits tasks can load loopbackAddress.

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