码迷,mamicode.com
首页 > 其他好文 > 详细

ccc

时间:2020-03-13 18:35:36      阅读:69      评论:0      收藏:0      [点我收藏+]

标签:task   voc   min   pts   nal   停止   多次   info   ids   

 


停止hadoop集群

ssh admin@node60 ‘/opt/module/hadoop-2.7.6/sbin/stop-all.sh‘;
ssh admin@node89 ‘/opt/module/hadoop-2.7.6/sbin/stop-all.sh‘;
ssh admin@node145 ‘/opt/module/hadoop-2.7.6/sbin/stop-all.sh‘;

停止顺序:job 、task、namenode、datanode、secondarynode


ssh admin@node60 ‘rm -rf /opt/module/hadoop-2.7.6/data‘;
ssh admin@node89 ‘rm -rf /opt/module/hadoop-2.7.6/data‘;
ssh admin@node145 ‘rm -rf /opt/module/hadoop-2.7.6/data‘;

启动hadoop前,需要执行几步格式化操作:
1)、启动journalnode,三台机器都要执行(仅第一次启动hadoop时,需要这一步操作,之后不再需要手动启动journalnode)
ssh admin@node60 ‘cd /opt/module/hadoop-2.7.6/sbin/;sh hadoop-daemon.sh start journalnode;‘;
ssh admin@node89 ‘cd /opt/module/hadoop-2.7.6/sbin/;sh hadoop-daemon.sh start journalnode;‘;
ssh admin@node145 ‘cd /opt/module/hadoop-2.7.6/sbin/;sh hadoop-daemon.sh start journalnode;‘;

##查看启动journalnode日志
ssh admin@node60 ‘tail -f -n 1000 /opt/module/hadoop-2.7.6/logs/hadoop-admin-journalnode-60.log‘;
ssh admin@node89 ‘tail -f -n 1000 /opt/module/hadoop-2.7.6/logs/hadoop-admin-journalnode-89.log‘;
ssh admin@node145 ‘tail -f -n 1000 /opt/module/hadoop-2.7.6/logs/hadoop-admin-journalnode-145.log‘;


ssh admin@node60 ‘tail -f -n 1000 /opt/module/hadoop-2.7.6/logs/hadoop-admin-namenode-60.log‘;
ssh admin@node89 ‘tail -f -n 1000 /opt/module/hadoop-2.7.6/logs/hadoop-admin-namenode-89.log‘;
ssh admin@node60 ‘tail -f -n 1000 /opt/module/hadoop-2.7.6/logs/hadoop-admin-zkfc-60.log‘;
ssh admin@node89 ‘tail -f -n 1000 /opt/module/hadoop-2.7.6/logs/hadoop-admin-zkfc-89.log‘;


ssh admin@node60 ‘tail -f -n 1000 /opt/module/hadoop-2.7.6/logs/yarn-admin-nodemanager-60.log‘;
ssh admin@node89 ‘tail -f -n 1000 /opt/module/hadoop-2.7.6/logs/yarn-admin-nodemanager-89.log‘;
ssh admin@node89 ‘tail -f -n 1000 /opt/module/hadoop-2.7.6/logs/yarn-admin-resourcemanager-89.log‘;

ssh admin@node145 ‘tail -f -n 1000 /opt/module/hadoop-2.7.6/logs/yarn-admin-nodemanager-145.log‘;

上述步骤完成后,接下来我们就可以启动hadoop了。

application_1584093120095_0002
问题
2020-03-13 17:15:20,059 WARN org.apache.hadoop.hdfs.server.common.Storage: Failed to add storage directory [DISK]file:/opt/module/hadoop-2.7.6/data/ha/tmp/dfs/data/
java.io.IOException: Incompatible clusterIDs in /opt/module/hadoop-2.7.6/data/ha/tmp/dfs/data: namenode clusterID = CID-1e9a7844-9d48-4d66-be81-5ee83e19a482; datanode clusterID = CID-0599cb61-c91b-453f-9821-fa32956b55c0

由于多次格式化命令所致(/opt/module/hadoop-2.7.6/bin/hdfs namenode -format)

解决方法:
停止Hadoop服务,删除/opt/module/hadoop-2.7.6/data下的所有文件,然后重新格式化,再启动就好了.

ssh admin@node60 ‘rm -rf /opt/module/hadoop-2.7.6/data‘;
ssh admin@node89 ‘rm -rf /opt/module/hadoop-2.7.6/data‘;
ssh admin@node145 ‘rm -rf /opt/module/hadoop-2.7.6/data‘;


(1) 浏览器访问http://182.61.130.60:50070
由图可知,当前hadoop-01是active节点,即namenode主节点

(2)浏览器访问http://106.12.241.89:50070

问题二
2020-03-13 18:10:55,776 INFO org.apache.hadoop.io.retry.RetryInvocationHandler: Exception while invoking registerNodeManager of class ResourceTrackerPBClientImpl over rm2 after 1 fail over attempts. Trying to fail over after sleeping for 32244ms.
java.net.ConnectException: Call From 145/0.0.0.145 to node145:8031 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused。

执行start-yarn.sh命令报错

 

ccc

标签:task   voc   min   pts   nal   停止   多次   info   ids   

原文地址:https://www.cnblogs.com/linjiqin/p/12487951.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!