Skip to content

Commit

Permalink
[Improvement][service] Remove fixed component versions (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
blackflash997997 authored Aug 12, 2024
1 parent f23bfce commit 03007d4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void onReceive(Object msg) throws Throwable {
serviceRoleInfo.setName("Prometheus");
serviceRoleInfo.setParentName("PROMETHEUS");
serviceRoleInfo.setConfigFileMap(configFileMap);
serviceRoleInfo.setDecompressPackageName("prometheus-2.17.2");
serviceRoleInfo.setDecompressPackageName("prometheus");
if (Objects.nonNull(prometheusInstance)) {
serviceRoleInfo.setHostname(prometheusInstance.getHostname());
ServiceConfigureHandler configureHandler = new ServiceConfigureHandler();
Expand Down Expand Up @@ -208,7 +208,7 @@ public void onReceive(Object msg) throws Throwable {
serviceRoleInfo.setName("Prometheus");
serviceRoleInfo.setParentName("PROMETHEUS");
serviceRoleInfo.setConfigFileMap(configFileMap);
serviceRoleInfo.setDecompressPackageName("prometheus-2.17.2");
serviceRoleInfo.setDecompressPackageName("prometheus");
serviceRoleInfo.setHostname(prometheusInstance.getHostname());
ServiceConfigureHandler configureHandler = new ServiceConfigureHandler();
ExecResult execResult = configureHandler.handlerRequest(serviceRoleInfo);
Expand Down Expand Up @@ -314,7 +314,7 @@ public void onReceive(Object msg) throws Throwable {
serviceRoleInfo.setName("Prometheus");
serviceRoleInfo.setParentName("PROMETHEUS");
serviceRoleInfo.setConfigFileMap(configFileMap);
serviceRoleInfo.setDecompressPackageName("prometheus-2.17.2");
serviceRoleInfo.setDecompressPackageName("prometheus");
serviceRoleInfo.setHostname(prometheusInstance.getHostname());
ServiceConfigureHandler configureHandler = new ServiceConfigureHandler();
ExecResult execResult = configureHandler.handlerRequest(serviceRoleInfo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public Result refreshQueues(Integer clusterId) throws Exception {
serviceRoleInfo.setName("ResourceManager");
serviceRoleInfo.setParentName("YARN");
serviceRoleInfo.setConfigFileMap(configFileMap);
serviceRoleInfo.setDecompressPackageName("hadoop-3.3.6");
serviceRoleInfo.setDecompressPackageName("hadoop");
serviceRoleInfo.setHostname(roleInstanceEntity.getHostname());
ServiceConfigureHandler configureHandler = new ServiceConfigureHandler();
ExecResult execResult = configureHandler.handlerRequest(serviceRoleInfo);
Expand All @@ -144,7 +144,7 @@ public Result refreshQueues(Integer clusterId) throws Exception {
ExecuteCmdCommand command = new ExecuteCmdCommand();
Timeout timeout = new Timeout(Duration.create(180, TimeUnit.SECONDS));
ArrayList<String> commands = new ArrayList<>();
commands.add(Constants.INSTALL_PATH + "/hadoop-3.3.6/bin/yarn");
commands.add(Constants.INSTALL_PATH + "/hadoop/bin/yarn");
commands.add("rmadmin");
commands.add("-refreshQueues");
command.setCommands(commands);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,15 +479,15 @@ public static void hdfsEcMethond(Integer serviceInstanceId, ClusterServiceRoleIn
Timeout timeout = new Timeout(Duration.create(180, TimeUnit.SECONDS));
FileOperateCommand fileOperateCommand = new FileOperateCommand();
fileOperateCommand.setLines(list);
fileOperateCommand.setPath(Constants.INSTALL_PATH + "/hadoop-3.3.6/etc/hadoop/" + type);
fileOperateCommand.setPath(Constants.INSTALL_PATH + "/hadoop/etc/hadoop/" + type);
Future<Object> future = Patterns.ask(actorSelection, fileOperateCommand, timeout);
ExecResult fileOperateResult = (ExecResult) Await.result(future, timeout.duration());
if (Objects.nonNull(fileOperateResult) && fileOperateResult.getExecResult()) {
logger.info("write {} success in namenode {}", type, namenode.getHostname());
// 刷新白名单
ExecuteCmdCommand command = new ExecuteCmdCommand();
ArrayList<String> commands = new ArrayList<>();
commands.add(Constants.INSTALL_PATH + "/hadoop-3.3.6/bin/hdfs");
commands.add(Constants.INSTALL_PATH + "/hadoop/bin/hdfs");
commands.add("dfsadmin");
commands.add("-refreshNodes");
command.setCommands(commands);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static void generatePromAlertFile(Generators generators, List<AlertItem>
data.put("itemList", configs);
data.put("serviceName", serviceName);
// 3.产生输出
processOut(generators, template, data, "prometheus-2.17.2");
processOut(generators, template, data, "prometheus");
}

public static void generatePromScrapeConfig(Generators generators, List<ServiceConfig> configs,
Expand Down

0 comments on commit 03007d4

Please sign in to comment.