You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ji...@apache.org on 2022/05/31 15:56:13 UTC

[incubator-doris-manager] branch master updated: ubuntu check jdk dependencies, jdk is not available: /root/.bash_profile (#59)

This is an automated email from the ASF dual-hosted git repository.

jiafengzheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris-manager.git


The following commit(s) were added to refs/heads/master by this push:
     new c8b3e82  ubuntu check jdk dependencies, jdk is not available: /root/.bash_profile (#59)
c8b3e82 is described below

commit c8b3e823c8e7aefd6dcece0050d96f0214a398dc
Author: caoliang-web <71...@users.noreply.github.com>
AuthorDate: Tue May 31 23:56:09 2022 +0800

    ubuntu check jdk dependencies, jdk is not available: /root/.bash_profile (#59)
---
 .../control/manager/ResourceNodeAndAgentManager.java     | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/manager/dm-server/src/main/java/org/apache/doris/stack/control/manager/ResourceNodeAndAgentManager.java b/manager/dm-server/src/main/java/org/apache/doris/stack/control/manager/ResourceNodeAndAgentManager.java
index 15cca47..502ef2f 100644
--- a/manager/dm-server/src/main/java/org/apache/doris/stack/control/manager/ResourceNodeAndAgentManager.java
+++ b/manager/dm-server/src/main/java/org/apache/doris/stack/control/manager/ResourceNodeAndAgentManager.java
@@ -44,6 +44,7 @@ import java.io.File;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.nio.file.Paths;
+import java.util.Locale;
 import java.util.concurrent.CompletableFuture;
 
 @Slf4j
@@ -343,6 +344,21 @@ public class ResourceNodeAndAgentManager {
 
         //check jdk
         // JDK_CHECK stage
+        final String checkSystem = "cat /etc/os-release";
+        ssh.setCommand(checkSystem);
+        if (!ssh.run()) {
+            log.error("View system failures", ssh.getErrorResponse());
+            return;
+        }
+        if (ssh.getStdoutResponse().toLowerCase(Locale.ROOT).contains("ubuntu")) {
+            final String mkdirBashProfile = "if test -f ~/.bash_profile;then echo ok;else touch ~/.bash_profile;fi";
+            ssh.setCommand(mkdirBashProfile);
+            if (!ssh.run()) {
+                log.error("Create file fail", ssh.getErrorResponse());
+                return;
+            }
+        }
+        log.info("Create .bash_profile successfully");
         final String checkJavaHome = "source /etc/profile && source ~/.bash_profile && java -version && echo $JAVA_HOME";
         ssh.setCommand(checkJavaHome);
         if (!ssh.run()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org