-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Improvement][api] https://github.com/datavane/datasophon/issues/364 Improvement #397
Open
liu-hai
wants to merge
29
commits into
datavane:dev
Choose a base branch
from
liu-hai:dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 23 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
8853fb2
first commit datasophon-init
1a30b96
first commit datasophon-init
a74e8ca
first commit datasophon-init
159afb6
first commit datasophon-init2
617701e
first commit logs
1753a82
Merge branch 'datavane:dev' into dev
liu-hai 2ea4654
commit README.md
620406e
Merge remote-tracking branch 'upstream/dev' into dev
4e0a5a7
Merge remote-tracking branch 'origin/dev' into dev
80ec89a
Merge branch 'datavane:dev' into dev
liu-hai 269fc9a
README.md format optimization
b373096
Merge branch 'datavane:dev' into dev
liu-hai a16544a
Added the node initialization capability
3412ac0
Merge branch 'datavane:dev' into dev
liu-hai e33f0de
Merge branch 'datavane:dev' into dev
liu-hai 131e657
Merge branch 'datavane:dev' into dev
liu-hai 991e162
[Improvement][Api] https://github.com/datavane/datasophon/issues/364 完善
liu-hai c9bbccd
Merge branch 'datavane:dev' into dev
liu-hai f692171
[Improvement][datasophon-init] 流程完善
liu-hai 7d777f7
[Improvement][datasophon-init] 流程完善
liu-hai e4224fc
Merge branch 'datavane:dev' into dev
liu-hai 2b96f11
Merge branch 'datavane:dev' into dev
liu-hai 82f6348
Merge branch 'datavane:dev' into dev
liu-hai c26deea
Merge branch 'datavane:dev' into dev
liu-hai 3200a96
Merge branch 'datavane:dev' into dev
liu-hai c6af30e
Merge branch 'datavane:dev' into dev
liu-hai 08d5f6e
Merge branch 'datavane:dev' into dev
liu-hai 670d817
Merge branch 'datavane:dev' into dev
liu-hai 46a021a
Merge branch 'datavane:dev' into dev
liu-hai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
datasophon-service/src/main/java/com/datasophon/api/utils/ExecuteShellScriptUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.datasophon.api.utils; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.io.InputStreamReader; | ||
|
||
import com.datasophon.api.master.DispatcherWorkerActor; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class ExecuteShellScriptUtils { | ||
private static final Logger logger = LoggerFactory.getLogger(ExecuteShellScriptUtils.class); | ||
public static int executeShellScript(String shellScriptPath,String params) throws IOException, InterruptedException { | ||
logger.info("start executeShellScript:{}", shellScriptPath); | ||
ProcessBuilder pb = new ProcessBuilder("sh",shellScriptPath,params); | ||
//pb.inheritIO(); | ||
Process p = pb.start(); | ||
/*BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream())); | ||
String line; | ||
while ((line = reader.readLine()) != null){ | ||
System.out.println(line); | ||
}*/ | ||
return p.waitFor(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# example: sh init-jdk.sh | ||
# instal and config jdk env | ||
workmd5="$1" | ||
if [ $UID -ne 0 ]; then | ||
echo Non root user. Please run as root. | ||
exit 1 | ||
fi | ||
if [ -L $0 ]; then | ||
BASE_DIR=$(dirname $(readlink $0)) | ||
else | ||
BASE_DIR=$(dirname $0) | ||
fi | ||
BASE_PATH=$( | ||
cd ${BASE_DIR} | ||
pwd | ||
) | ||
INIT_PATH=$(dirname "${BASE_PATH}") | ||
echo "INIT_PATH: ${INIT_PATH}" | ||
|
||
cp /opt/datasophon/DDP/packages/datasophon-worker.tar.gz /opt/datasophon/ | ||
checkworkmd5=$(md5sum /opt/datasophon/DDP/packages/datasophon-worker.tar.gz | awk '{print $1}') | ||
if [ "$checkworkmd5" = "$workmd5" ]; then | ||
echo "md5效验通过" | ||
else | ||
echo "md5效验不通过" | ||
exit 1 | ||
fi | ||
tar -zxvf /opt/datasophon/datasophon-worker.tar.gz -C /opt/datasophon/ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use exists api to get hostname