From 5ae188785147b567e30277d2c32f3e86767f6ee1 Mon Sep 17 00:00:00 2001 From: zhaoxiaoyi <2498974539@qq.com> Date: Tue, 29 Aug 2023 17:47:52 +0800 Subject: [PATCH] commit content (#393) --- .../src/main/java/com/datasophon/api/enums/Status.java | 1 + .../datasophon/api/service/impl/ServiceInstallServiceImpl.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/datasophon-service/src/main/java/com/datasophon/api/enums/Status.java b/datasophon-service/src/main/java/com/datasophon/api/enums/Status.java index 9b7fee38..08845488 100644 --- a/datasophon-service/src/main/java/com/datasophon/api/enums/Status.java +++ b/datasophon-service/src/main/java/com/datasophon/api/enums/Status.java @@ -85,6 +85,7 @@ public enum Status { NEED_SAME_ROLE_GROUP(10039, "All instances of the same service on the same machine need to be within the same role group", "同一个服务在同一台机器上的所有实例需要在同一个角色组内"), + ODD_NUMBER_ARE_REQUIRED_FOR_DORISFE(10040, "The Number of DorisFE must be an odd number.", "DorisFE个数必须是奇数"), ; private final int code; diff --git a/datasophon-service/src/main/java/com/datasophon/api/service/impl/ServiceInstallServiceImpl.java b/datasophon-service/src/main/java/com/datasophon/api/service/impl/ServiceInstallServiceImpl.java index ac30dbf1..0b11e382 100644 --- a/datasophon-service/src/main/java/com/datasophon/api/service/impl/ServiceInstallServiceImpl.java +++ b/datasophon-service/src/main/java/com/datasophon/api/service/impl/ServiceInstallServiceImpl.java @@ -703,6 +703,9 @@ private void serviceValidation(ServiceRoleHostMapping serviceRoleHostMapping) { if ("ZkServer".equals(serviceRole) && (hosts.size() & 1) == 0) { throw new ServiceException(Status.ODD_NUMBER_ARE_REQUIRED_FOR_ZKSERVER.getMsg()); } + if ("DorisFE".equals(serviceRole) && (hosts.size() & 1) == 0) { + throw new ServiceException(Status.ODD_NUMBER_ARE_REQUIRED_FOR_DORISFE.getMsg()); + } } private List listServiceConfigByServiceInstance(