code: protected void initialize() throws IOException {
      // set service-level authorization security policy
      if (serviceAuthEnabled =
          getConf().getBoolean(
              ServiceAuthorizationManager.SERVICE_AUTHORIZATION_CONFIG, false)) {
        PolicyProvider policyProvider =
          (PolicyProvider)(ReflectionUtils.newInstance(
              getConf().getClass(PolicyProvider.POLICY_PROVIDER_CONFIG,
                  HDFSPolicyProvider.class, PolicyProvider.class),
              getConf()));
        SecurityUtil.setPolicy(new ConfiguredPolicy(getConf(), policyProvider));
      }
  
      // This is a check that the port is free
      // create a socket and bind to it, throw exception if port is busy
      // This has to be done before we are reading Namesystem not to waste time and fail fast
      NetUtils.isSocketBindable(getClientProtocolAddress(getConf()));
      NetUtils.isSocketBindable(getDNProtocolAddress(getConf()));
      NetUtils.isSocketBindable(getHttpServerAddress(getConf()));
  
      long serverVersion = ClientProtocol.versionID;
      this.clientProtocolMethodsFingerprint = ProtocolSignature
          .getMethodsSigFingerPrint(ClientProtocol.class, serverVersion);
  
      myMetrics = new NameNodeMetrics(getConf(), this);
  
      this.clusterName = getConf().get(FSConstants.DFS_CLUSTER_NAME);
      this.namesystem = new FSNamesystem(this, getConf());
      // HACK: from removal of FSNamesystem.getFSNamesystem().
      JspHelper.fsn = this.namesystem;
  
      this.startDNServer();
      startHttpServer(getConf());
    }
docs: Initialize name-node.