发布于2021-05-29 20:46 阅读(862) 评论(0) 点赞(13) 收藏(1)
vim /etc/profile配置后生效source /etc/profile
export JAVA_HOME=/opt/lagou/servers/jdk1.8.0_231
export PATH=$JAVA_HOME/bin:$PATH##HADOOP_HOME
export HADOOP_HOME=/opt/lagou/servers/hadoop-2.9.2
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin
注意
[root@linux121 hadoop-2.9.2]$ hadoop namenode -format
格式化后创建的文件:/opt/lagou/servers/hadoop-2.9.2/data/tmp/dfs/name/current
1、单节点启动
启动HDFS
在linux101上启动NameNode
在linux101、linux102以及linux103上分别启动DataNode
[root@Linux101 hadoop-2.9.2]# hadoop-daemon.sh start namenode
[root@Linux101 hadoop-2.9.2]# hadoop-daemon.sh start datanode
停止
[root@Linux101 hadoop-2.9.2]# hadoop-daemon.sh stop datanode[root@Linux101 hadoop-2.9.2]# hadoop-daemon.sh stop namenode
- [root@Linux101 ~]# cd /opt/lagou/servers/hadoop-2.9.2/
- [root@Linux101 hadoop-2.9.2]# hadoop-daemon.sh start namenode
- starting namenode, logging to /opt/lagou/servers/hadoop-2.9.2/logs/hadoop-root-namenode-Linux101.out
- [root@Linux101 hadoop-2.9.2]# jps
- 4176 Jps
- 4099 NameNode
- [root@Linux101 hadoop-2.9.2]# hadoop-daemon.sh start datanode
- starting datanode, logging to /opt/lagou/servers/hadoop-2.9.2/logs/hadoop-root-datanode-Linux101.out
- [root@Linux101 hadoop-2.9.2]# jps
- 4209 DataNode
- 4099 NameNode
- 4291 Jps
web页面访问 通过IP访问
http://192.168.2.128:50070/dfshealth.html#tab-overview
启动Yarn
在103启动Yarn resourcemanager
分别在101 102 启动 nodemanager
yarn-daemon.sh start resourcemanager 在103启动
yarn-daemon.sh start nodemanager 分别在101 102 启动
停止
[root@Linux103 hadoop-2.9.2]# yarn-daemon.sh stop resourcemanager
[root@Linux101 hadoop-2.9.2]# yarn-daemon.sh stop nodemanager
- [root@Linux103 servers]# yarn-daemon.sh start resourcemanager
- starting resourcemanager, logging to /opt/lagou/servers/hadoop-2.9.2/logs/yarn-root-resourcemanager-Linux103.out
- [root@Linux103 servers]# jps
- 2432 Jps
- 1878 DataNode
- 2214 ResourceManager
2、集群群起
第一次启动需要格式化
hadoop namenode -format
- [root@linux101 hadoop-2.9.2]# sbin/start-dfs.sh
- Starting namenodes on [linux101]
- linux101: starting namenode, logging to /opt/lagou/servers/hadoop-2.9.2/logs/hadoop-root-namenode-linux101.out
- linux102: starting datanode, logging to /opt/lagou/servers/hadoop-2.9.2/logs/hadoop-root-datanode-linux102.out
- linux103: starting datanode, logging to /opt/lagou/servers/hadoop-2.9.2/logs/hadoop-root-datanode-linux103.out
- linux101: starting datanode, logging to /opt/lagou/servers/hadoop-2.9.2/logs/hadoop-root-datanode-linux101.out
- Starting secondary namenodes [linux103]
- linux103: starting secondarynamenode, logging to /opt/lagou/servers/hadoop-2.9.2/logs/hadoop-root-secondarynamenode-linux103.out
- [root@linux101 hadoop-2.9.2]# jps
- 2689 DataNode
- 2900 Jps
- 2556 NameNode
- [root@linux102 hadoop-2.9.2]# jps
- 1777 DataNode
- 1859 Jps
- [root@linux103 servers]# jps
- 2019 Jps
- 1975 SecondaryNameNode
- 1868 DataNode
停止HDFS
stop-dfs.sh
- [root@linux103 hadoop-2.9.2]# sbin/start-yarn.sh
- [root@linux103 hadoop-2.9.2]# jps
- 2646 ResourceManager
- 1975 SecondaryNameNode
- 1868 DataNode
- 2942 NodeManager
- 3054 Jps
- [root@linux102 hadoop-2.9.2]# jps
- 1777 DataNode
- 2103 NodeManager
- 2239 Jps
- [root@linux101 hadoop-2.9.2]# jps
- 2689 DataNode
- 2978 NodeManager
- 3090 Jps
- 2556 NameNode
停止YARN
stop-yarn.sh
原文链接:https://blog.csdn.net/weixin_41496763/article/details/117303192
作者:我是小豆丁
链接:http://www.javaheidong.com/blog/article/207221/fb185dd412272e60eef0/
来源:java黑洞网
任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任
昵称:
评论内容:(最多支持255个字符)
---无人问津也好,技不如人也罢,你都要试着安静下来,去做自己该做的事,而不是让内心的烦躁、焦虑,坏掉你本来就不多的热情和定力
Copyright © 2018-2021 java黑洞网 All Rights Reserved 版权所有,并保留所有权利。京ICP备18063182号-2
投诉与举报,广告合作请联系vgs_info@163.com或QQ3083709327
免责声明:网站文章均由用户上传,仅供读者学习交流使用,禁止用做商业用途。若文章涉及色情,反动,侵权等违法信息,请向我们举报,一经核实我们会立即删除!