public TubeMQResult addNewCluster(AddClusterReq req) {
        // 1. validate params
        if (!req.legal()) {
            return TubeMQResult.errorResult(TubeMQErrorConst.PARAM_ILLEGAL);
        }
        List<MasterEntry> masterEntries = req.getMasterEntries();
        for (MasterEntry masterEntry : masterEntries) {
            TubeMQResult checkResult = masterService.checkMasterNodeStatus(masterEntry.getIp(),
                    masterEntry.getWebPort());
            if (checkResult.getErrCode() != SUCCESS_CODE) {
                return TubeMQResult.errorResult("please check master ip and webPort");
            }
        }

        // 2. add cluster and master node
        clusterService.addClusterAndMasterNode(req);
        return new TubeMQResult();
    }
add a new cluster, should provide a master node
inlong-tubemq/tubemq-manager/src/main/java/org/apache/inlong/tubemq/manager/controller/cluster/ClusterController.java