1. 程式人生 > >Address already in use: Service 'SparkUI' failed after 16 retries

Address already in use: Service 'SparkUI' failed after 16 retries

java.net.BindException: Address already in use: Service 'SparkUI' failed after 16 retries!
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

錯誤原因:

Spark任務提交時會佔用一個SparkUI埠,預設為4040,如果被佔用則依次遞增埠重試。但是有個預設重試次數,為16次。16次重試都失敗後,會放棄該任務的執行。

解決方案:

加上引數:-- conf.set(“spark.port.maxRetries”,“100”)