【DataSophon】Yarn配置历史服务器JobHistory和Spark集成historyServer

news/2024/9/18 11:05:27/ 标签: spark, HistoryServer, Spark, YARN, jobhistory

目录

一、概述

1.1历史服务器JobHistory

1.2 Spark历史服务器HistoryServer

二、集成配置


一、概述


1.1历史服务器JobHistory


为了查看程序的历史运行情况,需要配置一下历史服务器。方便在xxxx:8088查看历史任务运行日志信息。

1.2 Spark历史服务器HistoryServer


HistoryServer服务可以让用户通过Spark UI界面,查看历史应用(已经执行完的应用)的执行细节,比如job信息、stage信息、task信息等,该功能是基于spark eventlogs日志文件的,所以必须打开eventlogs日志开关。方便在xxxx:8088查看历史任务运行日志信息。


二、集成配置


yarn-site.xml

<property><name>yarn.log.server.url</name><value>http://xxxxx:19888/jobhistory/logs</value>
</property>

mapred-site.xml

 <property><name>mapreduce.jobhistory.address</name><value>xxxxx:10020</value></property><property><name>mapreduce.jobhistory.webapp.address</name><value>xxxxx19888</value></property>

如下是YARN完整的service_ddl.json

cat YARN/service_ddl.json

{"name": "YARN","label": "YARN","description": "分布式资源调度与管理平台","version": "3.3.3","sortNum": 2,"dependencies":["HDFS"],"packageName": "hadoop-3.3.3.tar.gz","decompressPackageName": "hadoop-3.3.3","roles": [{"name": "ResourceManager","label": "ResourceManager","roleType": "master","cardinality": "1","runAs": {"user": "yarn","group": "hadoop"},"sortNum": 1,"logFile": "logs/hadoop-yarn-resourcemanager-${host}.log","jmxPort": 9323,"startRunner": {"timeout": "60","program": "control_hadoop.sh","args": ["start","resourcemanager"]},"stopRunner": {"timeout": "600","program": "control_hadoop.sh","args": ["stop","resourcemanager"]},"statusRunner": {"timeout": "60","program": "control_hadoop.sh","args": ["status","resourcemanager"]},"restartRunner": {"timeout": "60","program": "control_hadoop.sh","args": ["restart","resourcemanager"]},"externalLink": {"name": "ResourceManager UI","label": "ResourceManager UI","url": "http://${host}:8088/ui2"}},{"name": "NodeManager","label": "NodeManager","roleType": "worker","cardinality": "1","runAs": {"user": "yarn","group": "hadoop"},"sortNum": 2,"logFile": "logs/hadoop-yarn-nodemanager-${host}.log","jmxPort": 9324,"startRunner": {"timeout": "60","program": "control_hadoop.sh","args": ["start","nodemanager"]},"stopRunner": {"timeout": "600","program": "control_hadoop.sh","args": ["stop","nodemanager"]},"statusRunner": {"timeout": "60","program": "control_hadoop.sh","args": ["status","nodemanager"]}},{"name": "HistoryServer","label": "HistoryServer","roleType": "master","cardinality": "1","runAs": {"user": "mapred","group": "hadoop"},"sortNum": 3,"logFile": "logs/hadoop-mapred-historyserver-${host}.log","jmxPort": 9325,"startRunner": {"timeout": "60","program": "control_hadoop.sh","args": ["start","historyserver"]},"stopRunner": {"timeout": "600","program": "control_hadoop.sh","args": ["stop","historyserver"]},"statusRunner": {"timeout": "60","program": "control_hadoop.sh","args": ["status","historyserver"]}},{"name": "YarnClient","label": "YarnClient","roleType": "client","cardinality": "1","runAs": {"user": "yarn","group": "hadoop"}}],"configWriter": {"generators": [{"filename": "yarn-site.xml","configFormat": "xml","outputDirectory": "etc/hadoop/","includeParams": ["yarn.nodemanager.resource.cpu-vcores","yarn.nodemanager.resource.memory-mb","yarn.scheduler.minimum-allocation-mb","yarn.scheduler.minimum-allocation-vcores","yarn.log.server.url","yarn.nodemanager.aux-services","yarn.log-aggregation-enable","yarn.resourcemanager.ha.enabled","yarn.resourcemanager.hostname","yarn.resourcemanager.address","yarn.resourcemanager.webapp.address","yarn.resourcemanager.scheduler.address","yarn.resourcemanager.resource-tracker.address","yarn.resourcemanager.store.class","yarn.application.classpath","yarn.nodemanager.local-dirs","yarn.nodemanager.log-dirs","yarn.nodemanager.address","yarn.nodemanager.resource.count-logical-processors-as-cores","yarn.nodemanager.resource.detect-hardware-capabilities","yarn.nodemanager.resource.pcores-vcores-multiplier","yarn.resourcemanager.am.max-attempts","yarn.node-labels.enabled","yarn.node-labels.fs-store.root-dir","yarn.resourcemanager.principal","yarn.resourcemanager.keytab","yarn.nodemanager.principal","yarn.nodemanager.keytab","yarn.nodemanager.container-executor.class","yarn.nodemanager.linux-container-executor.group","yarn.nodemanager.linux-container-executor.path","custom.yarn.site.xml"]},{"filename": "mapred-site.xml","configFormat": "xml","outputDirectory": "etc/hadoop/","includeParams": ["mapreduce.jobhistory.keytab","mapreduce.jobhistory.principal","mapreduce.cluster.local.dir","mapreduce.jobhistory.address","mapreduce.jobhistory.webapp.address","custom.mapred.site.xml"]}]},"parameters": [{"name": "yarn.node-labels.fs-store.root-dir","label": "Node Label存储目录","description": "Node Label存储目录","required": true,"type": "input","value": "hdfs://${dfs.nameservices}/user/yarn/nodeLabels","configurableInWizard": true,"hidden": false,"defaultValue": "hdfs://${dfs.nameservices}/user/yarn/nodeLabels"},{"name": "yarn.nodemanager.resource.cpu-vcores","label": "nodemanager虚拟核数","description": "nodemanager虚拟核数","required": true,"type": "input","value": "","configurableInWizard": true,"hidden": false,"defaultValue": "-1"},{"name": "yarn.nodemanager.resource.memory-mb","label": "Nodemanaer节点上YARN可使用的物理内存总量","description": "Nodemanaer节点上YARN可使用的物理内存总量","required": true,"type": "input","value": "","configurableInWizard": true,"hidden": false,"defaultValue": "2048"},{"name": "yarn.scheduler.minimum-allocation-mb","label": "最小可分配容器的大小","description": "最小可分配容器的大小","required": true,"type": "input","value": "","configurableInWizard": true,"hidden": false,"defaultValue": "1024"}, {"name": "yarn.scheduler.minimum-allocation-vcores","label": "nodemanager最小虚拟核数","description": "nodemanager最小虚拟核数","required": true,"type": "input","value": "","configurableInWizard": true,"hidden": false,"defaultValue": "1"},{"name": "yarn.nodemanager.resource.count-logical-processors-as-cores","label": "是否将物理核数作为虚拟核数","description": "是否将物理核数作为虚拟核数","required": true,"type": "switch","value": "","configurableInWizard": true,"hidden": false,"defaultValue": true},{"name": "yarn.nodemanager.resource.detect-hardware-capabilities","label": "是否让yarn自己检测硬件进行配置","description": "是否让yarn自己检测硬件进行配置","required": true,"type": "switch","value": "","configurableInWizard": true,"hidden": false,"defaultValue": true},{"name": "yarn.nodemanager.resource.pcores-vcores-multiplier","label": "虚拟核数与物理核数比例","description": "","required": true,"type": "input","value": "","configurableInWizard": true,"hidden": false,"defaultValue": "0.75"},{"name": "yarn.resourcemanager.am.max-attempts","label": "AM重试次数","description": "","required": true,"type": "input","value": "","configurableInWizard": true,"hidden": false,"defaultValue": "4"},{"name": "yarn.nodemanager.aux-services","label": "yarn服务机制","description": "yarn服务机制","required": true,"type": "input","value": "mapreduce_shuffle","configurableInWizard": true,"hidden": false,"defaultValue": "mapreduce_shuffle"},{"name": "yarn.log-aggregation-enable","label": "是否开启yarn日志聚合","description": "开启yarn日志聚合","required": true,"type": "switch","value":"","configurableInWizard": true,"hidden": false,"defaultValue": true},{"name": "yarn.resourcemanager.ha.enabled","label": "是否启用resourcemanager ha","description": "是否启用resourcemanager ha","configType": "ha","required": true,"type": "switch","value":"","configurableInWizard": true,"hidden": false,"defaultValue": false},{"name": "yarn.resourcemanager.hostname","label": "rm主机名","description": "","configType": "ha","required": true,"type": "input","value":"","configurableInWizard": true,"hidden": false,"defaultValue": "${host}"},{"name": "yarn.resourcemanager.webapp.address","label": "rm web地址","description": "","required": true,"type": "input","value":"","configurableInWizard": true,"hidden": false,"defaultValue": "${host}:8088"},{"name": "yarn.resourcemanager.address","label": "ResourceManager对客户端暴露的地址rm","description": "","required": true,"type": "input","value":"","configurableInWizard": true,"hidden": true,"defaultValue": "${host}:8032"},{"name": "yarn.resourcemanager.scheduler.address","label": "ResourceManager对ApplicationMaster暴露的访问地址rm","description": "","required": true,"type": "input","value":"","configurableInWizard": true,"hidden": true,"defaultValue": "${host}:8030"},{"name": "yarn.resourcemanager.resource-tracker.address","label": "ResourceManager对NodeManager暴露的地址rm","description": "","configType": "ha","required": true,"type": "input","value":"","configurableInWizard": true,"hidden": true,"defaultValue": "${host}:8031"},{"name": "yarn.resourcemanager.store.class","label": "yarn状态信息存储类","description": "","configType": "ha","required": true,"type": "input","value":"","configurableInWizard": true,"hidden": false,"defaultValue": "org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore"},{"name": "yarn.nodemanager.address","label": "nodemanager地址","description": "","required": true,"type": "input","value":"","configurableInWizard": true,"hidden": false,"defaultValue": "0.0.0.0:45454"},{"name": "yarn.log.server.url","label": "historyserver地址","description": "","required": true,"type": "input","value":"","configurableInWizard": true,"hidden": false,"defaultValue": "http://${historyserverHost}:19888/jobhistory/logs"},{"name": "yarn.log-aggregation.retain-seconds","label": "日志保留时长","description": "","required": true,"type": "input","value":"","configurableInWizard": true,"hidden": false,"defaultValue": "2592000"},{"name": "yarn.nodemanager.remote-app-log-dir","label": "日志保留位置","description": "","required": true,"type": "input","value":"","configurableInWizard": true,"hidden": false,"defaultValue": "hdfs://${dfs.nameservices}/user/yarn/yarn-logs/"},{"name": "yarn.nodemanager.local-dirs","label": "NodeManager本地存储目录","description": "NodeManager本地存储目录,可配置多个,按逗号分隔","required": true,"configType": "path","separator": ",","type": "multiple","value": ["/data/nm"],"configurableInWizard": true,"hidden": false,"defaultValue": ""},{"name": "yarn.nodemanager.log-dirs","label": "NodeManager日志存储目录","description": "NodeManager日志存储目录,可配置多个,按逗号分隔","required": true,"configType": "path","separator": ",","type": "multiple","value": ["/data/nm/userlogs"],"configurableInWizard": true,"hidden": false,"defaultValue": ""},{"name": "mapreduce.cluster.local.dir","label": "MapReduce本地存储目录","description": "MapReduce本地存储目录","required": true,"configType": "path","separator": ",","type": "input","value": "/data/mapred/local","configurableInWizard": true,"hidden": false,"defaultValue": "/data/mapred/local"},{"name": "mapreduce.jobhistory.address","label": "MapReduceJobHistoryServer地址","description": "MapReduceJobHistoryServer地址","required": true,"type": "input","value":"","configurableInWizard": true,"hidden": false,"defaultValue": "${host}:10020"},{"name": "mapreduce.jobhistory.webapp.address","label": "MapReduceJobHistoryServerWeb-UI地址","description": "MapReduceJobHistoryServerWeb-UI地址","required": true,"type": "input","value":"","configurableInWizard": true,"hidden": false,"defaultValue": "${host}:19888"},{"name": "yarn.application.classpath","label": "yarn应用程序加载的classpath","description": "yarn应用程序加载的classpath","required": true,"separator": ",","type": "multiple","value":["${HADOOP_HOME}/etc/hadoop","${HADOOP_HOME}/share/hadoop/common/lib/*","${HADOOP_HOME}/share/hadoop/common/*","${HADOOP_HOME}/share/hadoop/hdfs","${HADOOP_HOME}/share/hadoop/hdfs/lib/*","${HADOOP_HOME}/share/hadoop/hdfs/*","${HADOOP_HOME}/share/hadoop/mapreduce/lib/*","${HADOOP_HOME}/share/hadoop/mapreduce/*","${HADOOP_HOME}/share/hadoop/yarn","${HADOOP_HOME}/share/hadoop/yarn/lib/*","${HADOOP_HOME}/share/hadoop/yarn/*"],"configurableInWizard": true,"hidden": false,"defaultValue": ["${HADOOP_HOME}/etc/hadoop","${HADOOP_HOME}/share/hadoop/common/lib/*","${HADOOP_HOME}/share/hadoop/common/*","${HADOOP_HOME}/share/hadoop/hdfs","${HADOOP_HOME}/share/hadoop/hdfs/lib/*","${HADOOP_HOME}/share/hadoop/hdfs/*","${HADOOP_HOME}/share/hadoop/mapreduce/lib/*","${HADOOP_HOME}/share/hadoop/mapreduce/*","${HADOOP_HOME}/share/hadoop/yarn","${HADOOP_HOME}/share/hadoop/yarn/lib/*","${HADOOP_HOME}/share/hadoop/yarn/*"]},{"name": "yarn.resourcemanager.principal","label": "ResourceManager服务的Kerberos主体","description": "","required": false,"configType": "kb","configWithKerberos": true,"type": "input","value": "rm/_HOST@HADOOP.COM","configurableInWizard": true,"hidden": true,"defaultValue": "rm/_HOST@HADOOP.COM"},{"name": "yarn.resourcemanager.keytab","label": "ResourceManager服务的Kerberos密钥文件路径","description": "","required": false,"configType": "kb","configWithKerberos": true,"type": "input","value": "/etc/security/keytab/rm.service.keytab","configurableInWizard": true,"hidden": true,"defaultValue": "/etc/security/keytab/rm.service.keytab"},{"name": "yarn.nodemanager.principal","label": "NodeManager服务的Kerberos主体","description": "","required": false,"configType": "kb","configWithKerberos": true,"type": "input","value": "nm/_HOST@HADOOP.COM","configurableInWizard": true,"hidden": true,"defaultValue": "nm/_HOST@HADOOP.COM"},{"name": "yarn.nodemanager.keytab","label": "NodeManager服务的Kerberos密钥文件路径","description": "","required": false,"configType": "kb","configWithKerberos": true,"type": "input","value": "/etc/security/keytab/nm.service.keytab","configurableInWizard": true,"hidden": true,"defaultValue": "/etc/security/keytab/nm.service.keytab"},{"name": "mapreduce.jobhistory.principal","label": "JobHistory服务的Kerberos主体","description": "","required": false,"configType": "kb","configWithKerberos": true,"type": "input","value": "jhs/_HOST@HADOOP.COM","configurableInWizard": true,"hidden": true,"defaultValue": "jhs/_HOST@HADOOP.COM"},{"name": "mapreduce.jobhistory.keytab","label": "JobHistory服务的Kerberos密钥文件路径","description": "","required": false,"configType": "kb","configWithKerberos": true,"type": "input","value": "/etc/security/keytab/jhs.service.keytab","configurableInWizard": true,"hidden": true,"defaultValue": "/etc/security/keytab/jhs.service.keytab"},{"name": "yarn.nodemanager.container-executor.class","label": "使用LinuxContainerExecutor管理Container","description": "","required": false,"configType": "kb","configWithKerberos": true,"type": "input","value": "org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor","configurableInWizard": true,"hidden": true,"defaultValue": "org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor"},{"name": "yarn.nodemanager.linux-container-executor.group","label": "NodeManager的启动用户的所属组","description": "","required": false,"configType": "kb","configWithKerberos": true,"type": "input","value": "hadoop","configurableInWizard": true,"hidden": true,"defaultValue": "hadoop"},{"name": "yarn.nodemanager.linux-container-executor.path","label": "LinuxContainerExecutor脚本路径","description": "","required": false,"configType": "kb","configWithKerberos": true,"type": "input","value": "${HADOOP_HOME}/bin/container-executor","configurableInWizard": true,"hidden": true,"defaultValue": "${HADOOP_HOME}/bin/container-executor"},{"name": "yarn.node-labels.enabled","label": "启用YARN标签调度","description": "开启 YARN Node Labels","required": true,"type": "switch","value": "","configurableInWizard": true,"hidden": false,"defaultValue": false},{"name": "enableKerberos","label": "启用Kerberos认证","description": "启用Kerberos认证","required": true,"type": "switch","value": false,"configurableInWizard": true,"hidden": false,"defaultValue": false},{"name": "custom.yarn.site.xml","label": "自定义配置yarn-site.xml","description": "自定义配置","configType": "custom","required": false,"type": "multipleWithKey","value": [],"configurableInWizard": true,"hidden": false,"defaultValue": ""},{"name": "custom.mapred.site.xml","label": "自定义配置mapred-site.xml","description": "自定义配置","configType": "custom","required": false,"type": "multipleWithKey","value": [],"configurableInWizard": true,"hidden": false,"defaultValue": ""}]
}

如下是SPARK3完整的service_ddl.json

cat SPARK3/service_ddl.json

{"name": "SPARK3","label": "Spark3","description": "分布式计算系统","version": "3.1.3","sortNum": 7,"dependencies":[],"packageName": "spark-3.1.3.tar.gz","decompressPackageName": "spark-3.1.3","roles": [{"name": "SparkClient3","label": "SparkClient3","roleType": "client","cardinality": "1","logFile": "logs/hadoop-${user}-datanode-${host}.log"},{"name": "SparkHistoryServer","label": "SparkHistoryServer","roleType": "master","runAs": {"user": "hdfs","group": "hadoop"},"cardinality": 1,"logFile": "logs/spark-HistoryServer-${host}.out","jmxPort": 9094,"startRunner": {"timeout": "60","program": "control_histroy_server.sh","args": ["start","histroyserver"]},"stopRunner": {"timeout": "600","program": "control_histroy_server.sh","args": ["stop","histroyserver"]},"statusRunner": {"timeout": "60","program": "control_histroy_server.sh","args": ["status","histroyserver"]},"restartRunner": {"timeout": "60","program": "control_histroy_server.sh","args": ["restart","histroyserver"]},"externalLink": {"name": "SparkHistoryServer Ui","label": "SparkHistoryServer Ui","url": "http://${host}:18081"}}],"configWriter": {"generators": [{"filename": "spark-env.sh","configFormat": "custom","templateName": "spark-env.ftl","outputDirectory": "conf","includeParams": ["SPARK_DIST_CLASSPATH","HADOOP_CONF_DIR","YARN_CONF_DIR","custom.spark.env.sh"]},{"filename": "spark-defaults.conf","configFormat": "properties2","outputDirectory": "conf","includeParams": ["spark.eventLog.dir","spark.history.fs.logDirectory","spark.eventLog.enabled","spark.master","spark.history.ui.port","spark.yarn.historyServer.address","spark.yarn.queue","spark.history.fs.cleaner.enabled","spark.history.fs.cleaner.interval","spark.history.fs.cleaner.maxAge","custom.spark.defaults.conf"]}]},"parameters": [{"name": "spark.eventLog.dir","label": "eventLog输出的hdfs路径","description": "eventLog输出的hdfs路径","required": true,"type": "input","value":"","configurableInWizard": true,"hidden": false,"defaultValue": "hdfs://${host}:8020/spark3-history"},{"name": "spark.history.fs.logDirectory","label": "Spark历史日志HDFS目录","description": "Spark历史日志HDFS目录","required": true,"type": "input","value":"","configurableInWizard": true,"hidden": false,"defaultValue": "hdfs://${host}:8020/spark3-history"},{"name": "spark.eventLog.enabled","label": "开启spark事件日志","description": "开启spark事件日志","required": true,"type": "input","value": "","configurableInWizard": true,"hidden": false,"defaultValue": "true"},{"name": "spark.master","label": "开启sparkmaster","description": "开启sparkmaster","required": true,"type": "input","value": "","configurableInWizard": true,"hidden": false,"defaultValue": "yarn"},{"name": "spark.history.ui.port","label": "sparkhistoryweb端口","description": "sparkhistoryweb端口","required": true,"type": "input","value": "18081","configurableInWizard": true,"hidden": false,"defaultValue": "18081"},{"name": "spark.yarn.queue","label": "指定提交到Yarn的资源池","description": "指定提交到Yarn的资源池","required": true,"type": "input","value": "","configurableInWizard": true,"hidden": false,"defaultValue": "default"},{"name": "spark.yarn.historyServer.address","label": "application的日志访问地址","description": "application的日志访问地址","required": true,"type": "input","value":"","configurableInWizard": true,"hidden": false,"defaultValue": "${host}:18081"},{"name": "spark.history.fs.cleaner.enabled","label": "sparkhistory日志是否定时清除","description": "sparkhistory日志是否定时清除","required": true,"type": "input","value": "","configurableInWizard": true,"hidden": false,"defaultValue": "true"},{"name": "spark.history.fs.cleaner.interval","label": "history-server的日志检查间隔","description": "history-server的日志检查间隔","required": true,"type": "input","value": "","configurableInWizard": true,"hidden": false,"defaultValue": "1d"},{"name": "spark.history.fs.cleaner.maxAge","label": "history-server日志生命周期","description": "history-server日志生命周期","required": true,"type": "input","value": "","configurableInWizard": true,"hidden": false,"defaultValue": "30d"},{"name": "SPARK_DIST_CLASSPATH","label": "spark加载Classpath路径","description": "","required": true,"configType": "map","type": "input","value": "","configurableInWizard": true,"hidden": false,"defaultValue": "$(${HADOOP_HOME}/bin/hadoop classpath)"},{"name": "HADOOP_CONF_DIR","label": "Hadoop配置文件目录","description": "","configType": "map","required": true,"type": "input","value": "","configurableInWizard": true,"hidden": false,"defaultValue": "${HADOOP_HOME}/etc/hadoop"},{"name": "YARN_CONF_DIR","label": "Yarn配置文件目录","description": "","configType": "map","required": true,"type": "input","value": "","configurableInWizard": true,"hidden": false,"defaultValue": "${HADOOP_HOME}/etc/hadoop"},{"name": "custom.spark.env.sh","label": "自定义配置spark-env.sh","description": "自定义配置spark-env.sh","configType": "custom","required": false,"type": "multipleWithKey","value": [{"SPARK_CLASSPATH":"${INSTALL_PATH}/spark-3.1.3/carbonlib/*"}],"configurableInWizard": true,"hidden": false,"defaultValue": ""},{"name": "custom.spark.defaults.conf","label": "自定义配置spark-defaults.conf","description": "自定义配置","configType": "custom","required": false,"type": "multipleWithKey","value": [],"configurableInWizard": true,"hidden": false,"defaultValue": ""}]
}

sparhistroyServer启停脚本

cat spark-3.1.3/control_histroy_server.sh

#!/bin/bash
#
#  Licensed to the Apache Software Foundation (ASF) under one or more
#  contributor license agreements.  See the NOTICE file distributed with
#  this work for additional information regarding copyright ownership.
#  The ASF licenses this file to You under the Apache License, Version 2.0
#  (the "License"); you may not use this file except in compliance with
#  the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#usage="Usage: start.sh (start|stop|status|restart) <command> "# if no args specified, show usage
if [ $# -le 1 ]; thenecho $usageexit 1
fi
startStop=$1
shift
command=$1
SH_DIR=`dirname $0`
export LOG_DIR=$SH_DIR/logs
export PID_DIR=$SH_DIR/pidexport HOSTNAME=`hostname`if [ ! -d "$LOG_DIR" ]; thenmkdir $LOG_DIR
fisource  /etc/profile.d/datasophon-env.sh
# 创建日志路径
sudo -u hdfs /opt/datasophon/hdfs/bin/hdfs  dfs -test -d /spark3-history
if [ $? -ne 0 ] ;thensource /etc/profile.d/datasophon-env.shsudo -u hdfs /opt/datasophon/hdfs/bin/hdfs  dfs -mkdir -p  /spark3-historysudo -u hdfs /opt/datasophon/hdfs/bin/hdfs  dfs -chown -R hdfs:hadoop /spark3-history/sudo -u hdfs /opt/datasophon/hdfs/bin/hdfs  dfs -chmod -R 777  /spark3-history/fistart(){[ -w "$PID_DIR" ] ||  mkdir -p "$PID_DIR"ifOrNot=`ps -ef |grep HistoryServer | grep spark |grep -v "grep" |wc -l`if [ 1 == $ifOrNot ]thenecho "$command is  running "exit 1elseecho "$command  is not running"fiecho starting $command, loggingexec_command="$SH_DIR/sbin/start-history-server.sh"echo " $exec_command"$exec_command}
stop(){ifOrNot=`ps -ef |grep HistoryServer | grep spark |grep -v "grep" |wc -l`if [ 1 == $ifOrNot ];thenifStop=`jps | grep -E 'HistoryServer' | grep  -v 'Job*' | awk   '{print $1}'`if [ ! -z $ifStop ]; thenecho "stop $command  "kill -9 $ifStopfielseecho "$command  is not running"exit 1fi}
status(){ifOrNot=`ps -ef |grep HistoryServer | grep spark |grep -v "grep" |wc -l`if [ 1 == $ifOrNot ]thenecho "$command is  running "elseecho "$command  is not running"exit 1fi
}
restart(){stopsleep 10start
}
case $startStop in(start)start;;(stop)stop;;(status)status;;(restart)restart;;(*)echo $usageexit 1;;
esacecho "End $startStop $command."

spark重新打包我们部署安装

选择SparkhistoryServer安装节点

选择Sparkclient

服务配置

安装完成

安装完后的spark-defaults.conf 配置文件

cat spark3/conf/spark-defaults.conf


spark.eventLog.dir hdfs://windp-aio:8020/spark3-history
spark.history.fs.logDirectory hdfs://windp-aio:8020/spark3-history
spark.eventLog.enabled true
spark.master yarn
spark.history.ui.port 18081
spark.yarn.historyServer.address windp-aio:18081
spark.yarn.queue default
spark.history.fs.cleaner.enabled true
spark.history.fs.cleaner.interval 1d
spark.history.fs.cleaner.maxAge 30d

datasophon页面

提交spark-examples测试任务

spark-submit \
--class org.apache.spark.examples.SparkPi \
--master yarn \
--executor-memory 1G \
--num-executors 2 \
/opt/datasophon/spark3/examples/jars/spark-examples_2.12-3.1.3.jar \
10

查看YARN

查看SPARK

至此集成完成。 


http://www.ppmy.cn/news/1525266.html

相关文章

llvm后端之函数栈帧

llvm后端之函数栈帧 引言1 目标扩展实现1.1 emitPrologue和emitEpilogue1.2 storeRegToStackSlot和loadRegFromStackSlot 2 寄存器存栈与恢复 引言 llvm后端在物理寄存器分配后、指令发射前会调用PEI这个pass来生成函数栈帧的创建与销毁。 1 目标扩展实现 在target下&#x…

大舍传媒-日本媒体发稿推荐今日东京tokyotoday

大舍传媒-日本媒体发稿推荐今日东京tokyotoday 在当今这个信息爆炸的时代&#xff0c;新闻传播的速度与广度已经成为衡量其影响力的重要指标。对于希望在国际舞台上发声的企业、组织乃至个人来说&#xff0c;掌握在海外媒体平台上发布新闻内容的技巧显得尤为重要。大舍传媒&am…

第五章,java超市会员管理系统(后端)

高级编程 第五章,java超市会员管理系统(后端) 一,项目概述 本项目旨在开发一个超市会员管理系统,帮助超市管理会员信息、积分、优惠活动等。系统将提供用户友好的界面,方便超市员工进行日常操作。 二,功能需求 积分积累积分兑换查询剩余积分开卡(送100积分)退出系…

java重点学习-线程的并发安全(2)

九 线程的并发安全 9.7 ReentrantLock的实现原理 ReentrantLock表示支持重新进入的锁&#xff0c;调用lock方法获取了锁之后&#xff0c;再次调用 lock&#xff0c;是不会再阻塞ReentrantLock主要利用CASAQS队列来实现支持公平锁和非公平锁&#xff0c;在提供的构造器的中无参…

[LitCTF 2024]SAS - Serializing Authentication

题目提示反序列化 源码 <?phpclass User {public $username;public $password;function __construct($username, $password) {$this->username $username;$this->password $password;}function isValid() { return $this->username admin && $this-&g…

Python数据处理利器,pivot与melt让表格变得灵活

大家好&#xff0c;在数据分析和处理过程中&#xff0c;数据的重塑是一个非常常见且重要的操作。数据重塑能够从不同的角度观察数据&#xff0c;以更符合分析需求的方式来呈现数据。在Python的Pandas库中&#xff0c;pivot和melt是两种强大的数据重塑工具&#xff0c;能够轻松地…

软件测试学习笔记丨Postman实战练习

本文转自测试人社区&#xff0c;原文链接&#xff1a;https://ceshiren.com/t/topic/32096#h-22 二、实战练习 2.1 宠物商店接口文档分析 接口文档&#xff1a;http://petstore.swagger.io &#xff0c;这是宠物商店接口的 swagger 文档。 2.1.1 什么是 swagger Swagger 是…

数学基础 -- 线性代数之奇异值

奇异值与其应用 1. 奇异值定义 对于任意的矩阵 A A A&#xff08;可以是方阵或非方阵&#xff09;&#xff0c;存在三个矩阵 U U U、 Σ \Sigma Σ 和 V V V&#xff0c;使得&#xff1a; A U Σ V T A U \Sigma V^T AUΣVT 其中&#xff1a; U U U 是一个 m m m \ti…

使用 BentoML快速实现Llama-3推理服务

介绍 近年来&#xff0c;开源大模型如雨后春笋般涌现&#xff0c;为自然语言处理领域带来了革命性的变化。从文本生成到代码编写&#xff0c;从机器翻译到问答系统&#xff0c;开源大模型展现出惊人的能力&#xff0c;吸引了越来越多的开发者和企业投身其中。 然而&#xff0…

lvs命令介绍

华子目录 lvs命令介绍lvs软件ipvsadm相关信息ipvsadm命令lvs集群中的增删改管理集群服务lvs中的增删改增加单个删除全部删除清空计数器修改实例 管理集群中RS的增删改增加删除修改 lvs命令介绍 lvs软件ipvsadm相关信息 程序包&#xff1a;ipvsadm服务名&#xff1a;ipvsadm.s…

LDR6020,单C口OTG,充放一体新潮流!

PD&#xff08;Power Delivery&#xff09;芯片实现单Type-C接口输入和输出OTG&#xff08;On-The-Go&#xff09;功能&#xff0c;主要是通过支持USB Power Delivery规范和OTG功能的特定硬件和软件设计来实现的。以下是对这一过程的具体解释&#xff1a; 一、PD芯片基础功能 …

vue3 动态 svg 图标使用

前言 在做后台管理系统中,我们经常会用到很多图标,比如左侧菜单栏的图标 当然这里 element-ui 或者 element-plus 组件库都会提供图标 但是在有些情况下 element-ui 或者 element-plus 组件库提供的图标满足不了我们的需求时,这个时候我们就需要自己去网上找一些素材或者…

【Tools】Prompt Engineering简介

摇来摇去摇碎点点的金黄 伸手牵来一片梦的霞光 南方的小巷推开多情的门窗 年轻和我们歌唱 摇来摇去摇着温柔的阳光 轻轻托起一件梦的衣裳 古老的都市每天都改变模样 &#x1f3b5; 方芳《摇太阳》 大模型中的Prompt Engineering是指为了提高大模型在特定任…

Python教程(二十) : 十分钟入门【PyQt6】

文章目录 专栏列表环境准备1 安装 Python2 安装 PyQt6 创建 PyQt6 项目1 创建项目目录2 创建主 Python 文件 代码书写测试流程1 导入 PyQt6 模块2 创建主窗口类3 创建应用程序实例并运行 核心解析&#xff1a;PyQt6 中的模块示例代码&#xff1a; PyQt6 常用的控件1. QPushButt…

python selenium 显示等待 + EC

python selenium 显示等待 EC expected_conditions是selenium的一个模块&#xff0c;主要用于对页面元素的加载进行判断&#xff0c;包括元素是否存在&#xff0c;可点击等等。 presence_of_element_located(locator)方法&#xff1a;判断一个元素存在于页面中&#xff0c;存…

OpenHarmony(鸿蒙南向开发)——轻量系统芯片移植指南(二)

往期知识点记录&#xff1a; 鸿蒙&#xff08;HarmonyOS&#xff09;应用层开发&#xff08;北向&#xff09;知识点汇总 鸿蒙&#xff08;OpenHarmony&#xff09;南向开发保姆级知识点汇总~ OpenHarmony&#xff08;鸿蒙南向开发&#xff09;——轻量系统芯片移植指南(一) Op…

2024-09-11 gdb

回顾 静态库安装指令 sudo yum install -y glibc-static sudo yum install -y libstdc-staticLinux调试器&#xff1a;gdb debug->添加调试信息 release->取消调试信息 gcc/g默认是release&#xff0c;debug&#xff1a;-g 1. gdb的基本命令 l(list) 10 main code.c…

无人机动力系统设计之电调芯片参数选型

无人机动力系统设计之电调芯片参数选型 1. 源由2. 关键因素2.1 电压范围2.2 电流处理能力2.3 控制方式2.4 PWM输出与分辨率2.5 通讯接口2.6 保护功能2.7 支持霍尔传感器与无传感器模式2.8 集成度与外围器件2.9 效率与散热2.10 市场供应与成本 3. 因素阐述3.1 PWM工作频率3.1.1 …

开源FormCreate低代码表单组件的配置项和事件的详解

在使用开源FormCreate低代码表单时&#xff0c;您可以通过各种 props 来定制表单的行为和外观。这些参数允许您控制表单的生成规则、配置选项、双向数据绑定等&#xff0c;为复杂的表单场景提供了强大的支持。 源码地址: Github | Gitee FormCreate组件Props 以下是常用的 pr…

Ubuntu 安装最新 Google Chrome 浏览器

谷歌浏览器使用简单并且用户友好&#xff0c;使用它浏览互联网愉悦至极。许多用户喜欢 Chrome&#xff0c;因为它加载网页又快又流畅。Chrome 提供强大的安全功能&#xff0c;帮助用户保持在线安全。Google Chrome 官方提供了一个 Debian 软件包存储库&#xff0c;基于 Debian …