{"record":{"id":"474730a73d4b80fa","repo":"alibaba/canal","slug":"server-474730","errorCode":null,"errorMessage":"集群模式不允许指定server启动","messagePattern":"集群模式不允许指定server启动","errorType":"validation","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"admin/admin-web/src/main/java/com/alibaba/otter/canal/admin/service/impl/CanalInstanceServiceImpl.java","lineNumber":285,"sourceCode":"        } else {\n            if (nodeId == null) {\n                return false;\n            }\n            nodeServer = NodeServer.find.byId(nodeId);\n        }\n        if (nodeServer == null) {\n            return false;\n        }\n        CanalInstanceConfig canalInstanceConfig = CanalInstanceConfig.find.byId(id);\n        if (canalInstanceConfig == null) {\n            return false;\n        }\n        Boolean result = null;\n        if (\"start\".equals(option)) {\n            if (nodeServer.getClusterId() == null) { // 非集群模式\n                return instanceOperation(id, \"start\");\n            } else {\n                throw new ServiceException(\"集群模式不允许指定server启动\");\n            }\n        } else if (\"stop\".equals(option)) {\n            if (nodeServer.getClusterId() != null) {\n                // 集群模式,通知主动释放\n                result = SimpleAdminConnectors.execute(nodeServer.getIp(),\n                    nodeServer.getAdminPort(),\n                    adminConnector -> adminConnector.releaseInstance(canalInstanceConfig.getName()));\n            } else { // 非集群模式下直接将状态置为0\n                return instanceOperation(id, \"stop\");\n            }\n        } else {\n            return false;\n        }\n\n        if (result == null) {\n            result = false;\n        }\n        return result;","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/admin/admin-web/src/main/java/com/alibaba/otter/canal/admin/service/impl/CanalInstanceServiceImpl.java#L267-L303","documentation":"Thrown by the instance start/stop operation when 'start' is requested on an instance whose nodeServer has a non-null clusterId. Cluster-mode instances are managed by the cluster (load balancing), so starting via a specific server is disallowed.","triggerScenarios":"POST a 'start' option for an instance attached to a cluster-mode server (nodeServer.getClusterId() != null). The start branch sees cluster mode and throws 'cluster mode does not allow starting on a specific server'.","commonSituations":"UI/operator manually starting an instance that belongs to a cluster; instance was migrated to cluster mode but operator still uses standalone start semantics; misconfiguration of server as standalone when it's in a cluster.","solutions":["For cluster-mode instances, start via the cluster mechanism (the cluster will schedule it), not per-server start.","Reassign the instance to a standalone server (serverId, clusterId null) if per-server start is required.","Stop is allowed in cluster mode (releases the instance), so use stop+cluster-reschedule instead of start.","Verify nodeServer.clusterId reflects the intended deployment mode."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"NodeServer server = NodeServer.find.byId(serverId);\nif (\"start\".equals(option) && server != null && server.getClusterId() != null) {\n    throw new IllegalStateException(\"Cannot start a cluster-mode instance on a specific server\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["For cluster-mode instances, use cluster scheduling instead of per-server start.","Verify nodeServer.clusterId reflects the intended deployment mode before acting.","Use stop (allowed in cluster mode) + cluster reschedule instead of manual start."],"tags":["canal-admin","instance-management","cluster-mode","business-rule"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}