Hadoop 启动/停止集群和节点的命令

集群 启动/停止Hadoop集群:start-all.shstop-all.sh
1) 启动NameNode, DataNode
2) 启动JournalNode, JournalNode在hdfs-site.xml中指定edits log存储的位置,主备NameNode共享数据,方便同步
3) 启动DFSZKFailoverController, HA会启用ZooKeeper Failover Controller
4) 启动YARN守护进程ResourceManager, NodeManager
启动/停止HDFS集群:start-dfs.shstop-dfs.sh
1) 启动NameNode, DataNode
2) 启动JournalNode, JournalNode在hdfs-site.xml中指定edits log存储的位置,主备NameNode共享数据,方便同步
3) 启动DFSZKFailoverController, HA会启用ZooKeeper Failover Controller
启动/停止YARN集群:start-yarn.shstop-yarn.sh
据说如果ResourceManager和NameNode不在同一台机器上,那NameNode上无法直接使用start-yarn.sh启动ResourceManager,但NodeManager可以启动,ResourceManager需要在ResourceManager节点上启动,这一点待考证


节点 启动NameNode: hadoop-daemon.sh start namenode
启动DataNode: hadoop-daemon.sh start datanode
启动JournalNode节点: hadoop-daemon.sh start journalnode
启动zkfc节点:hadoop-daemon.sh start zkfc
启动ResourceManager: yarn-daemon.sh start resourcemanager
启动NodeManager: yarn-daemon.sh start nodemanager
启动ZooKeeper节点:zkServer.sh start启动QuorumPeerMain进程
查看ZooKeeper节点状态:zkServer.sh status查看leader和follower状态
格式化HDFS: hdfs namenode -format
格式化ZKFC:hdfs zkfc -formatZK
查看NameNode和DataNode信息: hdfs dfsadmin -report
查看高可用NameNode状态: hdfs haadmin -getServiceState nn1 (active/standby)


Web界面端口 NameNode 50070
DataNode 50075
ResourceManager 8088
NodeManager 8042
更多端口参考



安装,查看等常用命令
查看进程:jps
kill进程:kill -9 pid
内容追加到文件:echo content > file, 如 echo 1 > myid
SSH拷贝:scp,如scp -r /usr/local/hadoop master:/usr/local
关闭防火墙:
查看状态systemctl status firewalld
关闭防火墙systemctl stop firewalld
开机禁用防火墙systemctl disable firewalld
配置免登录:
ssh-keygen -t rsa
ssh-copy-id -i host01


【Hadoop 启动/停止集群和节点的命令】Hadoop Shell命令

    推荐阅读