在HDFS HA群集中无法通过Knox访问WebHDFS UI

时间:2019-04-02 10:04:01

标签: hadoop webhdfs apache-knox

我试图在启用HDFS HA的群集上通过Knox访问webhdfs UI,但是它始终指向HA中的一个Node。

当我的Namenode1处于活动状态并且Namenode2处于StandbyState时,可以访问WebHDFS。但是当Namennode2变为活动状态并且Namenode1停止时,WebHDFS将无法访问(这里Namenode1不在待机状态,我已手动将其停止了。)

从错误看来,WebHDFS请求将发送到master-02,该请求已停止,而不是发送到Active Namenode master-03。

当我手动更改knox拓扑并在NAMENODE和HDFSUI中将master-03写入第一个URL时,Knox开始指向master-03。因此,我认为Knox网关仅指向第一个URL。

    <provider>
<role>ha</role>
<name>HaProvider</name>
<enabled>true</enabled>
<param>
<name>WEBHDFS</name>
<value>maxFailoverAttempts=3;failoverSleep=1000;maxRetryAttempts=300;retrySleep=1000;enabled=true</value>
</param>
<param>
<name>NAMENODE</name>
<value>maxFailoverAttempts=3;failoverSleep=1000;enabled=true</value>
</param>
<param>
<name>HDFSUI</name>
<value>maxFailoverAttempts=3;failoverSleep=1000;enabled=true</value>
</param>
<param>
<name>YARNUI</name>
<value>maxFailoverAttempts=3;failoverSleep=1000;enabled=true</value>
</param>
<param>
<name>RESOURCEMANAGER</name>
<value>maxFailoverAttempts=3;failoverSleep=1000;enabled=true</value>
</param>
<param>
<name>HIVE</name>
<value>maxFailoverAttempts=3;failoverSleep=1000;enabled=true</value>
</param>
<param>
<name>HBASEUI</name>
<value>maxFailoverAttempts=3;failoverSleep=1000;enabled=true</value>
</param>
</provider>

<service>
<role>WEBHDFS</role>
<url>http://master-02:50070/webhdfs/</url>
<url>http://master-03:50070/webhdfs/</url>
</service>
<service>
<role>NAMENODE</role>
<url>hdfs://master-02:8020/</url>
<url>hdfs://master-03:8020/</url>
</service>
<service>
<role>HDFSUI</role>
<url>http://master-02:50070/</url>
<url>http://master-03:50070/</url>
</service>

我在日志中遇到的错误是

2019-03-01 09:01:59,436 WARN hadoop.gateway (DefaultDispatch.java:executeOutboundRequest(147)) - Connection exception dispatching request: http://master-02:50070/dfshealth.html org.apache.http.conn.HttpHostConnectException: Connect to master-02:50070 [master-02/10.100.69.15] failed: Connection refused (Connection refused)
org.apache.http.conn.HttpHostConnectException: Connect to master-02:50070 [master-02/10.100.69.15] failed: Connection refused (Connection refused)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:159)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)

没有自动故障转移。

任何人都可以帮助我。 谢谢

0 个答案:

没有答案