HDFS的DataNode服务用root权限启动后在用Hadoop用户启动报错处理

Posted 江南独孤客

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HDFS的DataNode服务用root权限启动后在用Hadoop用户启动报错处理相关的知识,希望对你有一定的参考价值。

报错日志

org.apache.hadoop.hdfs.qjournal.client.QuorumException: Got too many exceptions to achieve quorum size 2/3. 3 exceptions thrown:
10.4.151.60:8485: Call From master1/10.4.151.58 to slave1:8485 failed on connection exception: java.net.ConnectException: 拒绝连接; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
10.4.151.63:8485: Call From master1/10.4.151.58 to slave3:8485 failed on connection exception: java.net.ConnectException: 拒绝连接; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
10.4.151.62:8485: Call From master1/10.4.151.58 to slave2:8485 failed on connection exception: java.net.ConnectException: 拒绝连接; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
at org.apache.hadoop.hdfs.qjournal.client.QuorumException.create(QuorumException.java:81)
at org.apache.hadoop.hdfs.qjournal.client.QuorumCall.rethrowException(QuorumCall.java:286)
at org.apache.hadoop.hdfs.qjournal.client.AsyncLoggerSet.waitForWriteQuorum(AsyncLoggerSet.java:142)
at org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager.createNewUniqueEpoch(QuorumJournalManager.java:183)
at org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager.recoverUnfinalizedSegments(QuorumJournalManager.java:436)
at org.apache.hadoop.hdfs.server.namenode.JournalSet$8.apply(JournalSet.java:624)
at org.apache.hadoop.hdfs.server.namenode.JournalSet.mapJournalsAndReportErrors(JournalSet.java:393)
at org.apache.hadoop.hdfs.server.namenode.JournalSet.recoverUnfinalizedSegments(JournalSet.java:621)
at org.apache.hadoop.hdfs.server.namenode.FSEditLog.recoverUnclosedStreams(FSEditLog.java:1490)

原因:

上午不小心用root权限启动之后,在停掉用hadoop账号启动就报了如上的错误

org.apache.hadoop.hdfs.qjournal.client.QuorumException: Got too many exceptions to achieve quorum size 2/3. 3 exceptions thrown:
10.4.151.60:8485: Call From master1/10.4.151.58 to slave1:8485 failed on connection exception: java.net.ConnectException: 拒绝连接

大致意思是报错太多,无法全部显示,namenode拒绝连接。

问题分析:

因为是通过root权限启动了之后,Datanode服务及日志下的权限全部变成了root权限,所以在hadoop用户下无法启动

解决方案:

chmod -R hadoop:hadoop /etc/hadoop/* 
hadoop-daemon.sh start datanode

hadoop的hdfs的datanode服务就会正常启动了。


以上是关于HDFS的DataNode服务用root权限启动后在用Hadoop用户启动报错处理的主要内容,如果未能解决你的问题,请参考以下文章

HDFS格式化namenode后启动集群datanode不启动

hdfs datanode不回收本地磁盘空间,如果在关闭一段时间后重新启动

HDFS 客户端读写操作详情

HDFS中DataNode工作机制

Hadoop之HDFS(DataNode) (面试开发重点)

Hadoop集群改名导致无法启动DataNode