hadoop2.0 ha failover 遇到的问题

最近在测试hadoop2.0 的ha,当failover的时候,standby namenode 会同步active namenode的edit日志。

如果edit文件比较多的时候,standby namenode会频繁的访问journalnode,由于没有同步带宽没有限制,standby namenode会将journalnode的带宽占完,导致active namenode 无法访问journalnode,到了timeout的时间就会导致activenamenode挂掉。 active  namenode的日志如下:

192.168.24.71:8485: Call From l-datalogm2.data.cn1/192.168.24.73 to l-datalog3.data.cn1:8485 failed on connection exception: java.net.ConnectException: Connection refused; 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:223)
        at org.apache.hadoop.hdfs.qjournal.client.AsyncLoggerSet.waitForWriteQuorum(AsyncLoggerSet.java:142)
        at org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager.selectInputStreams(QuorumJournalManager.java:460)
        at org.apache.hadoop.hdfs.server.namenode.JournalSet.selectInputStreams(JournalSet.java:252)
        at org.apache.hadoop.hdfs.server.namenode.FSEditLog.selectInputStreams(FSEditLog.java:1237)
        at org.apache.hadoop.hdfs.server.namenode.FSEditLog.selectInputStreams(FSEditLog.java:1265)
        at org.apache.hadoop.hdfs.server.namenode.FSEditLog.selectInputStreams(FSEditLog.java:1249)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:609)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:264)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:787)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:568)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:443)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:491)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:684)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:669)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1254)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1320)

测试几次总是出现这个问题。

既然跟时间限制和带宽有关,那就到配置文件找这两个相关的配置。经过仔细查找,找到几个有关的配置:

        <property>
                <name>ha.failover-controller.cli-check.rpc-timeout.ms</name>
                <value>60000</value>
        </property>
        <property>
                <name>ipc.client.connect.timeout</name>
                <value>60000</value>
        </property>

//上面的是timeout相关配置,下面这个是拷贝image 和 edit文件的带宽限制,这里设置的是1M

        <property>
                <name>dfs.image.transfer.bandwidthPerSec</name>
                <value>1048576</value>
        </property>


重新启动两个namenode,再进行各种failover,问题没有再出现。keep moving!

你可能感兴趣的:(hadoop2.0 ha failover 遇到的问题)