启动spark历史服务失败问题处理

1.场景

执行启动spark历史服务器 start-history-server.sh报错

root@manager file# $SPARK_HOME/sbin/start-history-server.sh

starting org.apache.spark.deploy.history.HistoryServer, logging to /home/bigdata/spark/logs/spark-root-org.apache.spark.deploy.history.HistoryServer-1-manager.out

root@manager file# more /home/bigdata/spark/logs/spark-root-org.apache.spark.deploy.history.HistoryServer-1-manager.out

Spark Command: /usr/java/jdk1.8.0_112/bin/java -cp /home/bigdata/spark/conf/:/home/bigdata/spark/jars/*:/home/bigdata/hadoop/e

tc/hadoop/ -Dspark.deploy.recoveryMode=ZOOKEEPER -Dspark.deploy.zookeeper.url=zook_node1:2181,zook_node2:2181,zook_node3:2181

-Dspark.deploy.zookeeper.dir=/home/bigdata/zookeeper -Xmx1g org.apache.spark.deploy.history.HistoryServer

========================================

2023-09-18 16:46:29,971 INFO history.HistoryServer: Started daemon with process name: 18867@manager

2023-09-18 16:46:29,974 INFO util.SignalUtils: Registering signal handler for TERM

2023-09-18 16:46:29,975 INFO util.SignalUtils: Registering signal handler for HUP

2023-09-18 16:46:29,975 INFO util.SignalUtils: Registering signal handler for INT

2023-09-18 16:46:30,192 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-ja

va classes where applicable

2023-09-18 16:46:30,271 INFO spark.SecurityManager: Changing view acls to: root

2023-09-18 16:46:30,272 INFO spark.SecurityManager: Changing modify acls to: root

2023-09-18 16:46:30,273 INFO spark.SecurityManager: Changing view acls groups to:

2023-09-18 16:46:30,273 INFO spark.SecurityManager: Changing modify acls groups to:

2023-09-18 16:46:30,274 INFO spark.SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with vi

ew permissions: Set(root); groups with view permissions: Set(); users with modify permissions: Set(root); groups with modify

permissions: Set()

2023-09-18 16:46:30,360 INFO history.FsHistoryProvider: History server ui acls disabled; users with admin permissions: ; group

s with admin permissions:

2023-09-18 16:46:31,011 INFO util.log: Logging initialized @1850ms to org.sparkproject.jetty.util.log.Slf4jLog

2023-09-18 16:46:31,062 INFO server.Server: jetty-9.4.44.v20210927; built: 2021-09-27T23:02:44.612Z; git: 8da83308eeca865e495e

53ef315a249d63ba9332; jvm 1.8.0_112-b15

2023-09-18 16:46:31,084 INFO server.Server: Started @1924ms

2023-09-18 16:46:31,130 INFO server.AbstractConnector: Started ServerConnector@5ae76500{HTTP/1.1, (http/1.1)}{0.0.0.0:18080}

2023-09-18 16:46:31,131 INFO util.Utils: Successfully started service 'HistoryServerUI' on port 18080.

2023-09-18 16:46:31,156 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@7e094740{/,null,AVAILABLE,@Spark}

2023-09-18 16:46:31,157 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@24a1c17f{/json,null,AVAILABLE,@Spar

k}

2023-09-18 16:46:31,158 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@73511076{/api,null,AVAILABLE,@Spark

}

2023-09-18 16:46:31,167 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@514eedd8{/static,null,AVAILABLE,@Sp

ark}

2023-09-18 16:46:31,168 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@1a2e2935{/history,null,AVAILABLE,@S

park}

2023-09-18 16:46:31,170 INFO history.HistoryServer: Bound HistoryServer to 0.0.0.0, and started at http://manager:18080

Exception in thread "main" java.io.FileNotFoundException: Log directory specified does not exist: hdfs://mycluster/spark_logs

at org.apache.spark.deploy.history.FsHistoryProvider.startPolling(FsHistoryProvider.scala:291)

at org.apache.spark.deploy.history.FsHistoryProvider.initialize(FsHistoryProvider.scala:236)

at org.apache.spark.deploy.history.FsHistoryProvider.start(FsHistoryProvider.scala:413)

at org.apache.spark.deploy.history.HistoryServer$.main(HistoryServer.scala:311)

at org.apache.spark.deploy.history.HistoryServer.main(HistoryServer.scala)

Caused by: java.io.FileNotFoundException: File does not exist: hdfs://mycluster/spark_logs

at org.apache.hadoop.hdfs.DistributedFileSystem$29.doCall(DistributedFileSystem.java:1756)

at org.apache.hadoop.hdfs.DistributedFileSystem$29.doCall(DistributedFileSystem.java:1749)

at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)

at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1764)

at org.apache.spark.deploy.history.FsHistoryProvider.startPolling(FsHistoryProvider.scala:281)

... 4 more

root@manager file#

2.日志分析

关键是这一句:Log directory specified does not exist: hdfs://mycluster/spark_logs

意思是:找不到指定文件

3.解决方案

需要预先创建文件即可

root@manager conf# hadoop dfs -mkdir hdfs://mycluster/spark_logs

root@manager conf# hdfs dfs -chmod 777 /home/bigdata/spark/conf/spark_logs

4.重新启动验证

root@manager file# $SPARK_HOME/sbin/stop-history-server.sh

stopping org.apache.spark.deploy.history.HistoryServer

root@manager file# $SPARK_HOME/sbin/start-history-server.sh

starting org.apache.spark.deploy.history.HistoryServer, logging to /home/bigdata/spark/logs/spark-root-org.apache.spark.deploy.history.HistoryServer-1-manager.out

root@manager file# tail -f /home/bigdata/spark/logs/spark-root-org.apache.spark.deploy.history.HistoryServer-1-manager.out

2023-09-18 17:10:07,780 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@56102e1c{/api,null,AVAILABLE,@Spark}

2023-09-18 17:10:07,789 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@51f49060{/static,null,AVAILABLE,@Spark}

2023-09-18 17:10:07,790 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@687a762c{/history,null,AVAILABLE,@Spark}

2023-09-18 17:10:07,791 INFO history.HistoryServer: Bound HistoryServer to 0.0.0.0, and started at http://manager:18080

2023-09-18 17:10:07,952 INFO history.FsHistoryProvider: Parsing hdfs://mycluster/spark_logs/local-1695027842090.zstd for listing data...

2023-09-18 17:10:07,952 INFO history.FsHistoryProvider: Parsing hdfs://mycluster/spark_logs/local-1695027960132.zstd for listing data...

2023-09-18 17:10:08,694 INFO history.FsHistoryProvider: Finished parsing hdfs://mycluster/spark_logs/local-1695027842090.zstd

2023-09-18 17:10:08,694 INFO history.FsHistoryProvider: Finished parsing hdfs://mycluster/spark_logs/local-1695027960132.zstd

2023-09-18 17:10:08,700 INFO history.FsHistoryProvider: Parsing hdfs://mycluster/spark_logs/local-1695027671578.zstd.inprogress for listing data...

2023-09-18 17:10:08,863 INFO history.FsHistoryProvider: Finished parsing hdfs://mycluster/spark_logs/local-1695027671578.zstd.inprogress

相关推荐
Decay__20 分钟前
04_MySQL DBA 日常运维手册 —— 会话管理、锁与阻塞、事务监控、慢查询与日志巡检
运维·数据库·sql·mysql·架构
江华森2 小时前
数据中心基础设施运维实战:概述与实验环境搭建
运维
迪菲赫尔曼2 小时前
【基础篇 11】把官方源码放到服务器:版本、解压层级和安装位置,一次弄清楚
运维·服务器·开发语言·人工智能·python·yolo·目标检测
重生之高冷汉堡包2 小时前
跨境电商运营团队如何安全交接店铺账号?多账号权限管理指南
大数据
玩AI的奶茶2 小时前
MiniMax H3 出 30 秒长片:显存账、拼接法和一次的成本
大数据·人工智能·ai·gpu算力·算力租赁
SelectDB3 小时前
Doris Arrow Flight SQL 高速读取协议实战:与 Snowflake 客户端取数链路对照
大数据·数据库·数据分析
by209993 小时前
Linux GCC/G++ 编译与 Makefile 构建
linux·运维·服务器·经验分享
爱签AI电子合同3 小时前
电子合同全维度实测与选型指南
大数据·人工智能
AI办公探索者3 小时前
从SaaS到本地部署:大模型推理成本优化与8888元私有化方案的技术解析
大数据·人工智能
螺丝钉tina4 小时前
[Playwright][08] Upload 模块自动化:如何设计真实业务测试用例?
运维·自动化·测试用例