我创建了具有一个DataNode, Activity NameNode,Standby NameNode和三个JournalNode的HA-Cluster
什么时候将文件放入HDFS会出现此错误:

put: Operation category READ is not supported in state standby

放置命令:
./hadoop fs -put golnaz.txt /user/input

NameNode日志:
at org.apache.hadoop.ipc.Client.call(Client.java:1476)
    at org.apache.hadoop.ipc.Client.call(Client.java:1407)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:229)
    at com.sun.proxy.$Proxy15.rollEditLog(Unknown Source)
    at org.apache.hadoop.hdfs.protocolPB.NamenodeProtocolTranslatorPB.rollEditLog(NamenodeProtocolTranslatorPB.java:148)
    at org.apache.hadoop.hdfs.server.namenode.ha.EditLogTailer.triggerActiveLogRoll(EditLogTailer.java:273)
    at org.apache.hadoop.hdfs.server.namenode.ha.EditLogTailer.access$600(EditLogTailer.java:61)
    at org.apache.hadoop.hdfs.server.namenode.ha.EditLogTailer$EditLogTailerThread.doWork(EditLogTailer.java:315)
    at org.apache.hadoop.hdfs.server.namenode.ha.EditLogTailer$EditLogTailerThread.access$200(EditLogTailer.java:284)
    at org.apache.hadoop.hdfs.server.namenode.ha.EditLogTailer$EditLogTailerThread$1.run(EditLogTailer.java:301)
    at org.apache.hadoop.security.SecurityUtil.doAsLoginUserOrFatal(SecurityUtil.java:415)
    at org.apache.hadoop.hdfs.server.namenode.ha.EditLogTailer$EditLogTailerThread.run(EditLogTailer.java:297)
2016-09-15 02:07:23,961 INFO org.apache.hadoop.ipc.Server: IPC Server handler 9 on 9000, call org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol.rollEditLog from 103.41.177.161:45797 Call#11403 Retry#0: org.apache.hadoop.ipc.StandbyException: Operation category JOURNAL is not supported in state standby
2016-09-15 02:07:30,547 INFO org.apache.hadoop.ipc.Server: IPC Server handler 0 on 9000, call org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol.rollEditLog from 103.41.177.160:39200 Call#11404 Retry#0: org.apache.hadoop.ipc.StandbyException: Operation category JOURNAL is not supported in state standby

SecondaryNameNode日志中的错误:
ERROR org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode: Exception in doCheckpoint
org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.ipc.StandbyException): Operation category JOURNAL is not supported in state standby

这是HDFS-Site.xml:
<configuration>
<property>
    <name>dfs.data.dir</name>
    <value>/root/hadoopstorage/data</value>
    <final>true</final>
</property>
<property>
    <name>dfs.name.dir</name>
    <value>/root/hadoopstorage/name</value>
    <final>true</final>
</property>
<property>
    <name>dfs.replication</name>
    <value>1</value>
</property>
<property>
    <name>dfs.webhdfs.enabled</name>
    <value>true</value>
</property>
<property>
    <name>dfs.nameservices</name>
    <value>ha-cluster</value>
</property>
<property>
    <name>dfs.ha.namenodes.ha-cluster</name>
    <value>NameNode,Standby</value>
</property>
<property>
    <name>dfs.namenode.rpc-address.ha-cluster.NameNode</name>
    <value>103.41.177.161:9000</value>
</property>
<property>
    <name>dfs.namenode.rpc-address.ha-cluster.Standby</name>
    <value>103.41.177.162:9000</value>
</property>
<property>
    <name>dfs.namenode.http-address.ha-cluster.NameNode</name>
    <value>103.41.177.161:50070</value>
</property>
<property>
    <name>dfs.namenode.http-address.ha-cluster.Standby</name>
    <value>103.41.177.162:50070</value>
</property>
<property>
    <name>dfs.namenode.shared.edits.dir</name>
    value>qjournal://103.41.177.161:8485;103.41.177.162:8485;103.41.177.160:8485/ha-cluster</value>
</property>
<property>
    <name>dfs.client.failover.proxy.provider.ha-cluster</name>
    <value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
</property>
<property>
    <name>dfs.ha.fencing.methods</name>
    <value>sshfence</value>
</property>
<property>
    <name>dfs.ha.fencing.ssh.private-key-files</name>
    <value>/root/.ssh/id_rsa</value>
</property>
<property>
    <name>dfs.ha.fencing.ssh.connect-timeout</name>
    <value>3000</value>
</property>
</configuration>

最佳答案

您没有提到有关自动故障转移的任何内容(ZKFC和Zookeeper)。没有它,hdfs将不会自动故障转移。

您可以尝试以下操作:通过检查namenodes控制台(或使用Administrative commands的getServiceState命令),确保两个namenode都处于备用状态。如果是这样,请使用-transitionToActive命令手动触发转换,并同时拖尾namenodes日志。如果过渡失败,请使用namenode日志更新您的帖子。

关于hadoop - 在状态待机状态下,不支持doCheckpoint:Operation类别Journal中的异常,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39504157/

10-16 05:33