1.[start-all.sh]

#!/usr/bin/env 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.
# # Start all spark daemons.    #启动所有守护进程
# Starts the master on this node.  #在这个节点上启动master
# Starts a worker on each node specified in conf/slaves #在conf/slaves文件下指定的节点上启动worker进程 if [ -z "${SPARK_HOME}" ]; then    #判断spark环境变量在不在
export SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)"  #如果在的话,就把环境变量导入
fi # Load the Spark configuration    #加载配置文件
. "${SPARK_HOME}/sbin/spark-config.sh"  #调用spark-config.sh脚本 # Start Master
"${SPARK_HOME}/sbin"/start-master.sh  #启动master脚本进程 # Start Workers
"${SPARK_HOME}/sbin"/start-slaves.sh  #启动slaves脚本进程

2.[start-master.sh]

#!/usr/bin/env 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.
# # Starts the master on the machine this script is executed on.  #在这个机器上执行脚本,启动master进程 if [ -z "${SPARK_HOME}" ]; then    #首先配置环境变量
export SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)"
fi # NOTE: This exact class name is matched downstream by SparkSubmit.
# Any changes need to be reflected there.
CLASS="org.apache.spark.deploy.master.Master" if [[ "$@" = *--help ]] || [[ "$@" = *-h ]]; then
echo "Usage: ./sbin/start-master.sh [options]"
pattern="Usage:"
pattern+="\|Using Spark's default log4j profile:"
pattern+="\|Registered signal handlers for" "${SPARK_HOME}"/bin/spark-class $CLASS --help >& | grep -v "$pattern" >&
exit
fi ORIGINAL_ARGS="$@" . "${SPARK_HOME}/sbin/spark-config.sh" . "${SPARK_HOME}/bin/load-spark-env.sh" if [ "$SPARK_MASTER_PORT" = "" ]; then
SPARK_MASTER_PORT=
fi if [ "$SPARK_MASTER_HOST" = "" ]; then
SPARK_MASTER_HOST=`hostname -f`
fi if [ "$SPARK_MASTER_WEBUI_PORT" = "" ]; then
SPARK_MASTER_WEBUI_PORT=
fi "${SPARK_HOME}/sbin"/spark-daemon.sh start $CLASS \
--host $SPARK_MASTER_HOST --port $SPARK_MASTER_PORT --webui-port $SPARK_MASTER_WEBUI_PORT \
$ORIGINAL_ARGS

最新文章

  1. 【C语言学习】《C Primer Plus》第11章 字符串和字符串函数
  2. centos6.5编译安装lamp开发环境
  3. H5-考试判断题
  4. RC-50221 问题解决 - netstat 查看端口占用情况
  5. C# for和 foreach 的数组遍历 比较
  6. python中string模块各属性以及函数的用法
  7. Asp.net 后台添加Meta标签方法
  8. ExtJs owner.componentLayoutCounter问题解
  9. 一款C++静态分析工具 —— CppDepend
  10. jq 点击复制div里面的内容 如果粘贴到富文本中,会将样式,里面所有的标签,文字一并粘贴进去
  11. 日志收集ELK+kafka相关博客
  12. ubuntu16.04安装Navicate
  13. 九、mybatis模糊查询2种方式
  14. LeetCode题解之Lemonade Change
  15. sql优化的方法
  16. [转载]C#中使用正则表达式验证电话号码、手机号、身份证号、数字和邮编
  17. 检查WMI协议是否通的
  18. LINQ 查询
  19. Redis学习之路(007)- Redis学习手册(实例代码)
  20. yum 卸载 error: %preun(tengine-2.1.0-1.el6.x86_64) scriptlet failed, exit status 6

热门文章

  1. linux运维、架构之路-LVS负载均衡
  2. AC自动机2
  3. [CSP-S模拟测试]:序列(构造)
  4. fengmiantu2
  5. 关于Java泛型实现原理的思考与一般用法示例总结
  6. 如何将阿里云上的RDS 备份的mysql数据还原到windows环境中
  7. charles之抓取浏览器https请求
  8. delphi编写提取exe文件的ICO图标
  9. Delphi中堆栈区别
  10. 【Unity Shader】---准确认识SubShader语义块结构、渲染状态设定、Tags标签