From 027d9e5ef0a2bd10ff704baa30211234fd1af8e3 Mon Sep 17 00:00:00 2001 From: zeekling Date: Sun, 5 Nov 2023 11:59:29 +0800 Subject: [PATCH] =?UTF-8?q?namenode=E5=90=AF=E5=8A=A8=E6=BA=90=E7=A0=81?= =?UTF-8?q?=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hdfs/nameNode启动过程.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hdfs/nameNode启动过程.md b/hdfs/nameNode启动过程.md index 829bfdf..da873ef 100644 --- a/hdfs/nameNode启动过程.md +++ b/hdfs/nameNode启动过程.md @@ -153,6 +153,7 @@ private void startCommonServices(Configuration conf) throws IOException { // 启动所有插件 for (ServicePlugin p: plugins) { try { + // 调用插件的start接口,需要插件自己实现,需要实现接口ServicePlugin p.start(this); } catch (Throwable t) { LOG.warn("ServicePlugin " + p + " could not be started", t); @@ -202,8 +203,7 @@ void startCommonServices(Configuration conf, HAContext haContext) throws IOExcep // 注册快照管理器 snapshotManager.registerMXBean(); InetSocketAddress serviceAddress = NameNode.getServiceAddress(conf, true); - this.nameNodeHostName = (serviceAddress != null) ? - serviceAddress.getHostName() : ""; + this.nameNodeHostName = (serviceAddress != null) ? serviceAddress.getHostName() : ""; } ``` @@ -219,6 +219,7 @@ void startCommonServices(Configuration conf, HAContext haContext) throws IOExcep ```java public void activate(Configuration conf, long blockTotal) { pendingReconstruction.start(); + // 初始化datanodeManager datanodeManager.activate(conf); this.redundancyThread.setName("RedundancyMonitor"); this.redundancyThread.start(); @@ -231,5 +232,3 @@ public void activate(Configuration conf, long blockTotal) { ``` - -