脚本分析start-all.sh

  1)首先进入/soft/Hadoop/sbin目录

Hadoop公开课:完全分布式脚本分析_分布式

  2)nano start-all.sh

Hadoop公开课:完全分布式脚本分析_分布式_02

  sbin/start-all.sh主要做的事情:

  1) libexec/hadoop-config.sh

  2) start-dfs.sh

  3) start-yarn.sh

  3)cat libexec/hadoop-config.sh hadoop_conf_dir =etc/hadoop

Hadoop公开课:完全分布式脚本分析_分布式_03

  4)cat sbin/start-dfs.sh

Hadoop公开课:完全分布式脚本分析_完全_04

  sbin/start-dfs.sh的作用:

  1)libexec/hadoop-config.sh

  2)sbin/hadoop-daemons.sh --config .. --hostname .. start namenode ...

  3)sbin/hadoop-daemons.sh --config .. --hostname .. start datanode ...

  4)sbin/hadoop-daemons.sh --config .. --hostname .. start sescondarynamenode ...

  5)sbin/hadoop-daemons.sh --config .. --hostname .. start zkfc ...//

  5)cat sbin/start-yarn.sh

Hadoop公开课:完全分布式脚本分析_分布式_05

  libexec/yarn-config.sh作用

  sbin/yarn-daemon.sh start resourcemanager

  sbin/yarn-daemons.sh start nodemanager

  6)cat sbin/hadoop-daemons.sh

Hadoop公开课:完全分布式脚本分析_Hadoop_06

  sbin/hadoop-daemons.sh的作用:

  libexec/hadoop-config.sh

  slaves

  hadoop-daemon.sh

  7)cat sbin/hadoop-daemon.sh

Hadoop公开课:完全分布式脚本分析_Hadoop_07

Hadoop公开课:完全分布式脚本分析_Hadoop_08

  sbin/hadoop-daemon.sh的作用

  libexec/hadoop-config.sh

  bin/hdfs ...

  8)sbin/yarn-daemon.sh


Hadoop公开课:完全分布式脚本分析_完全_09

Hadoop公开课:完全分布式脚本分析_Hadoop_10

  sbin/yarn-daemon.sh作用

  libexec/yarn-config.sh

  bin/yarn

  Start-all.sh ===config.sh----start-dfs.sh 和start-yarn.sh

  Start-dfs.sh -----config.sh----(namenode,send,datanode)

  Stop-dfs.sh------config---------------------------------------

  hadoop-daemon.sh ----------->