1 格式化:
Hadoop Startup
To start a Hadoop cluster you will need to start both the HDFS and YARN cluster.
The first time you bring up HDFS, it must be formatted. Format a new distributed filesystem as hdfs:
[hdfs]$ $HADOOP_PREFIX/bin/hdfs namenode -format <cluster_name>
即:./hdfs namenode -format
2.启动hdfs: start-dfs.sh
通过50070端口访问datanode
3.启动yarn: start-yarn.sh
yarn管理的资源指内存/CPU等
通过8088端口访问yarn上运行的程序。
4.mr-jobhistory-daemon.sh start historyserver
查看job history server 上运行过的job
5.关闭: stop-yarn.sh/stop-dfs.sh/mr-jobhistory-daemon.sh stop historyserver
关闭hdfs慢是因为作为文件管理系统有很多元数据。
6.为什么不用stat-all.sh?
(1)分别启动时,如果发生问题,可以很快定位到问题所在
(2)如运行spark,直接启动yarn即可,不需要启动hdfs。