Spark只启动了Master,Worker没启动的

本文记录了一次 Spark Worker 服务启动时遇到的问题及解决方案。主要问题是服务无法绑定到指定端口,通过设置 SPARK_LOCAL_IP 解决了该问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  2. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  3. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  4. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  5. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  6. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  7. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  8. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  9. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  10. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  11. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  12. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  13. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  14. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  15. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  16. 17/01/16 16:12:23 WARN Utils: Service 'sparkWorker' could not bind on port 0. Attempting port 1.  
  17. Exception in thread "main" java.net.BindException: 无法指定被请求的地址: Service 'sparkWorker' failed after 16 retries! Consider explicitly setting the appropriate port for the service 'sparkWorker' (for example spark.ui.port for SparkUI) to an available port or increasing spark.port.maxRetries.  
  18.         at sun.nio.ch.Net.bind0(Native Method)  
  19.         at sun.nio.ch.Net.bind(Net.java:433)  
  20.         at sun.nio.ch.Net.bind(Net.java:425)  
  21.         at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)  

 

 

 

spark的配置文件spark-env.sh如下

 

[html] view plain copy

  1. export JAVA_HOME=/usr/jdk1.8  
  2. export SCALA_HOME=/usr/hadoop/scala-2.11.4  
  3. export HADOOP_HOME=/usr/hadoop/hadoop2.7.3  
  4. export HADOOP_CONF_DIR=/usr/hadoop/hadoop2.7.3/etc/hadoop  
  5. export SPARK_MASTER_IP=192.168.9.200  
  6. export SPARK_WORKER_MEMORY=1g  
  7. export SPARK_WORKER_CORES=1  
  8. export SPARK_HOME=/usr/hadoop/spark-2.0.2  

在后面加上SPARK_LOCAL_IP之后三个Worker正常启动

 

[html] view plain copy

添加:

  1. export SPARK_LOCAL_IP=127.0.0.1  

 

 

转载于:https://my.oschina.net/u/2329800/blog/1826179

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值