nimbus 单点故障问题
重启节点,重启顺序如下:
观察ui上,是否有两个nimbus节点,如图所示,则成功:
for (String host : seeds) {
int port = Integer.parseInt(conf.get(Config.NIMBUS_THRIFT_PORT).toString());
ClusterSummary clusterInfo;
try {
NimbusClient client = new NimbusClient(conf, host, port, null, asUser);
clusterInfo = client.getClient().getClusterInfo();
} catch (Exception e) {
LOG.warn("Ignoring exception while trying to get leader nimbus info from " + host
+ ". will retry with a different seed host.", e);
continue;
}
...
}
List<NimbusSummary> nimbuses = clusterInfo.get_nimbuses();
if (nimbuses != null) {
for (NimbusSummary nimbusSummary : nimbuses) {
if (nimbusSummary.is_isLeader()) {
try {
return new NimbusClient(conf, nimbusSummary.get_host(), nimbusSummary.get_port(), null, asUser);
} catch (TTransportException e) {
String leaderNimbus = nimbusSummary.get_host() + ":" + nimbusSummary.get_port();
throw new RuntimeException("Failed to create a nimbus client for the leader " + leaderNimbus, e);
}
}
}
throw new NimbusLeaderNotFoundException(
"Found nimbuses " + nimbuses + " none of which is elected as leader, please try " +
"again after some time.");
}
NimbusLeaderNotFoundException nimbus HA文档地址
文档中主要部分基本符合目前的代码实现,但 Nimbus state store 一节基本与目前实现不一致。文档中写道,Nimbus之间的状态同步主要靠实现 ICodeDistributor 接口实现,并且有 LocalFileSystemCodeDistributor 和 HDFSCodeDistributor 两个实现,默认是 LocalFileSystemCodeDistributor 。但目前代码(1.0.1)中,全面使用了 BlobStore 来实现nimbus以及supervisor之间的jar包同步,默认为 LocalFsBlobStore ,也有 HdfsBlobStore 。 Configuration 一节中的相关配置项也要做相应更改,原有配置并没有删除,但是已经没有使用,除此之外nimbus.min.replication.count这个配置项也没有使用。
任务发布的可能时长:
(存疑) 。
Nimbus启动时,会调用 cleanup-corrupt-topologies! 函数,该函数会:
该warning是正常现象,是访问不存在的nimbus时出现的超时现象,会自动选取下一个nimbus访问。但由于存在超时等待的问题,速度较慢,时间较长,为减少任务操作时间, 建议保证nimbus.seeds中第一个节点可用。如nimbus.seeds:[“A”,”B”]中A节点长时间不可用,请调整配置为nimbus.seeds:[”B”, “A”]