启动nebula-metad报错

nebula 版本:3.4.0
部署方式: 分布式
安装方式: RPM
是否上生产环境:N

报错信息如下
[root@bogon nebula]# vi nebula-metad.ERROR
[root@bogon nebula]# vi logs/nebula-metad.ERROR
Log file created at: 2023/06/01 10:40:25
Running on machine: bogon
Running duration (h:mm:ss): 0:00:00
Log line format: [IWEF]yyyymmdd hh:mm:ss.uuuuuu threadid file:line] msg
E20230601 10:40:25.736531 24625 MetaDaemonInit.cpp:183] Retry too many times
E20230601 10:40:25.736936 24625 MetaDaemon.cpp:164] Init god user failed

把配置文件贴一下。

改了啥
INFO有啥日志
代码就这么几行nebula/MetaDaemonInit.cpp at 6415db56c5fdcf1d1c29a15ec273865d2eccbb27 · vesoft-inc/nebula · GitHub

nebula::cpp2::ErrorCode initGodUser(nebula::kvstore::KVStore* kvstore,
                                    const nebula::HostAddr& localhost) {
  const int kMaxRetryTime = FLAGS_raft_heartbeat_interval_secs * 3;
  constexpr int kRetryInterval = 1;
  int retryTime = 0;
  // Both leader & follower need to wait all reading ok.
  // leader init need to retry writing if leader changed.
  while (true) {
    retryTime += kRetryInterval;
    if (retryTime > kMaxRetryTime) {
      LOG(ERROR) << "Retry too many times";
      return nebula::cpp2::ErrorCode::E_RETRY_EXHAUSTED;
    }
    auto ret = kvstore->partLeader(nebula::kDefaultSpaceId, nebula::kDefaultPartId);
    if (!nebula::ok(ret)) {
      LOG(ERROR) << "Part leader get failed";
      return nebula::error(ret);
    }
    bool isLeader = nebula::value(ret) == localhost;
    LOG(INFO) << "Check root user";  // follower need to wait reading all ok, too.
    auto checkRet = nebula::meta::RootUserMan::isGodExists(kvstore, isLeader);
    if (!nebula::ok(checkRet)) {
      auto retCode = nebula::error(checkRet);
      if (retCode == nebula::cpp2::ErrorCode::E_LEADER_CHANGED) {
        LOG(INFO) << "Leader changed, retry";
        sleep(kRetryInterval);
        continue;
      }
      LOG(ERROR) << "Parser God Role error:" << apache::thrift::util::enumNameSafe(retCode);
      return nebula::error(checkRet);
    }
    if (isLeader) {
      auto existGod = nebula::value(checkRet);
      if (!existGod) {
        auto initGod = nebula::meta::RootUserMan::initRootUser(kvstore);
        if (initGod != nebula::cpp2::ErrorCode::SUCCEEDED) {
          if (initGod != nebula::cpp2::ErrorCode::E_LEADER_CHANGED) {
            LOG(ERROR) << "Init God Role error:" << apache::thrift::util::enumNameSafe(initGod);
            return initGod;
          } else {
            LOG(INFO) << "Leader changed, retry";
            sleep(kRetryInterval);
            continue;
          }
        }
      }
    }
    break;
  }
  return nebula::cpp2::ErrorCode::SUCCEEDED;
}

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。