Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Spark bind on port 0. Attempting port 1 problem Resolution

Shulou Source: shulou.com Published: 2022-06-03 04:57:04 11月25日 Update

Linux running spark local bind on port 0. Attempting port 1

2016-11-01 16:04:56 [org.apache.spark.util.Utils]-[WARN] - Service 'sparkDriver' could not bind on port 0. Attempting port 1.

2016-11-01 16:04:56 [org.apache.spark.SparkContext]-[ERROR] - Error initializing SparkContext.

java.net.BindException: Can't assign requested address: Service 'sparkDriver' failed after 16 retries! Consider explicitly setting the appropriate port for the service 'sparkDriver' (for example spark.ui.port for SparkUI) to an available port or increasing spark.port.maxRetries.

The reason is that the IP address corresponding to the host cannot be found, not the port binding is incorrect.

Add the following code to hosts

127.0.0.1 hostname

The username here is written according to the actual situation, so that spark local can find the local corresponding ip, and the startup is successful.

Tags: Problem success host code reason address actual situation user user name port add run Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MySQL OPPO Reno Xiaomi Redmi