当前位置: 代码迷 >> 综合 >> spark历史服务器配置(standalone)
  详细解决方案

spark历史服务器配置(standalone)

热度:14   发布时间:2023-10-19 10:05:58.0

环境:spark2.1.1
standlone模式安装:spark集群安装配置笔记(standalone模式)
1、修改conf/spark-default.conf文件(mv spark-defaults.conf.template spark-defaults.conf)如下

#open the log services
spark.eventLog.enabled           true
#set the work directory of log server
spark.eventLog.dir               hdfs://chdp11:9000/spark/jobHistory

2、在HDFS上创建好上述配置的目录:

hadoop fs -mkdir -p  /spark/jobHistory

3、修改spark-env.sh文件,添加如下配置

#ui.port=18080:WEBUI access port 18080
#retainedApplications=30 :retain number of application in memory with recent ,overflow will be save in disk
#fs.logDirectory=hdfs://chdp11:9000/spark/jobHistory":save dirrctory of running applicaton data
export SPARK_HISTORY_OPTS="
-Dspark.history.ui.port=18080
-Dspark.history.retainedApplications=30
-Dspark.history.fs.logDirectory=hdfs://chdp11:9000/spark/jobHistory"

4、分发配置文件

transFilesToAll.sh conf/spark-default.conf

5、启动历史服务

sbin/start-history-server.sh

6、执行官方求PI案例

bin/spark-submit \
--master spark://chdp11:7077 \
--class org.apache.spark.examples.SparkPi \
--executor-memory 1G \
--total-executor-cores 4 \
./examples/jars/spark-examples_2.11-2.1.1.jar \
100

7、查看历史服务

chdp11:18080

spark历史服务器配置(standalone)
spark历史服务器配置(standalone)

  相关解决方案