feat(cli): 增加多jdk的支持
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package com.lanyuanxiaoyao.service.cli.core;
|
package com.lanyuanxiaoyao.service.cli.core;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运行配置
|
* 运行配置
|
||||||
*
|
*
|
||||||
@@ -10,7 +12,8 @@ public class RuntimeInfo {
|
|||||||
private String signature;
|
private String signature;
|
||||||
private String user;
|
private String user;
|
||||||
private String jarPath;
|
private String jarPath;
|
||||||
private String jdkPath;
|
private String defaultJdk;
|
||||||
|
private Map<String, String> jdkPath;
|
||||||
private String logPath;
|
private String logPath;
|
||||||
private String confPath;
|
private String confPath;
|
||||||
private String dataPath;
|
private String dataPath;
|
||||||
@@ -47,11 +50,19 @@ public class RuntimeInfo {
|
|||||||
this.jarPath = jarPath;
|
this.jarPath = jarPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getJdkPath() {
|
public String getDefaultJdk() {
|
||||||
|
return defaultJdk;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefaultJdk(String defaultJdk) {
|
||||||
|
this.defaultJdk = defaultJdk;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getJdkPath() {
|
||||||
return jdkPath;
|
return jdkPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setJdkPath(String jdkPath) {
|
public void setJdkPath(Map<String, String> jdkPath) {
|
||||||
this.jdkPath = jdkPath;
|
this.jdkPath = jdkPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,7 +160,8 @@ public class RuntimeInfo {
|
|||||||
"signature='" + signature + '\'' +
|
"signature='" + signature + '\'' +
|
||||||
", user='" + user + '\'' +
|
", user='" + user + '\'' +
|
||||||
", jarPath='" + jarPath + '\'' +
|
", jarPath='" + jarPath + '\'' +
|
||||||
", jdkPath='" + jdkPath + '\'' +
|
", defaultJdk='" + defaultJdk + '\'' +
|
||||||
|
", jdkPath=" + jdkPath +
|
||||||
", logPath='" + logPath + '\'' +
|
", logPath='" + logPath + '\'' +
|
||||||
", confPath='" + confPath + '\'' +
|
", confPath='" + confPath + '\'' +
|
||||||
", dataPath='" + dataPath + '\'' +
|
", dataPath='" + dataPath + '\'' +
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public class ServiceInfo {
|
|||||||
private List<String> groups = new ArrayList<>();
|
private List<String> groups = new ArrayList<>();
|
||||||
private Integer replicas = 0;
|
private Integer replicas = 0;
|
||||||
private String sourceJar;
|
private String sourceJar;
|
||||||
|
private String jdk;
|
||||||
private List<String> classpath = new ArrayList<>();
|
private List<String> classpath = new ArrayList<>();
|
||||||
private Map<String, Object> environments = new HashMap<>();
|
private Map<String, Object> environments = new HashMap<>();
|
||||||
private Map<String, Object> arguments = new HashMap<>();
|
private Map<String, Object> arguments = new HashMap<>();
|
||||||
@@ -61,6 +62,14 @@ public class ServiceInfo {
|
|||||||
this.sourceJar = sourceJar;
|
this.sourceJar = sourceJar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getJdk() {
|
||||||
|
return jdk;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJdk(String jdk) {
|
||||||
|
this.jdk = jdk;
|
||||||
|
}
|
||||||
|
|
||||||
public List<String> getClasspath() {
|
public List<String> getClasspath() {
|
||||||
return classpath;
|
return classpath;
|
||||||
}
|
}
|
||||||
@@ -93,6 +102,7 @@ public class ServiceInfo {
|
|||||||
", groups=" + groups +
|
", groups=" + groups +
|
||||||
", replicas=" + replicas +
|
", replicas=" + replicas +
|
||||||
", sourceJar='" + sourceJar + '\'' +
|
", sourceJar='" + sourceJar + '\'' +
|
||||||
|
", jdk=" + jdk +
|
||||||
", classpath=" + classpath +
|
", classpath=" + classpath +
|
||||||
", environments=" + environments +
|
", environments=" + environments +
|
||||||
", arguments=" + arguments +
|
", arguments=" + arguments +
|
||||||
|
|||||||
@@ -138,7 +138,8 @@ public class RunnerApplication implements ApplicationRunner {
|
|||||||
Path planPath = Paths.get(root.toString(), "deploy.plan");
|
Path planPath = Paths.get(root.toString(), "deploy.plan");
|
||||||
Map<String, List<String>> deployPlans = new HashMap<>();
|
Map<String, List<String>> deployPlans = new HashMap<>();
|
||||||
if (Files.exists(planPath) && !deployInformationProperties.getShuffler()) {
|
if (Files.exists(planPath) && !deployInformationProperties.getShuffler()) {
|
||||||
deployPlans = mapper.readValue(new String(Files.readAllBytes(planPath)), new TypeReference<Map<String, List<String>>>() {});
|
deployPlans = mapper.readValue(new String(Files.readAllBytes(planPath)), new TypeReference<Map<String, List<String>>>() {
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ServiceInfoWrapper serviceInfo : serviceInfoList) {
|
for (ServiceInfoWrapper serviceInfo : serviceInfoList) {
|
||||||
@@ -219,15 +220,6 @@ public class RunnerApplication implements ApplicationRunner {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
generateTemplate(
|
|
||||||
"cloud/stop-script.ftl",
|
|
||||||
MapUtil.builder()
|
|
||||||
.put("currentPath", absolutRootPath)
|
|
||||||
.put("runtime", runtimeInfo)
|
|
||||||
.build(),
|
|
||||||
Paths.get(root.toString(), "stop.sh")
|
|
||||||
);
|
|
||||||
|
|
||||||
generateTemplate(
|
generateTemplate(
|
||||||
"cloud/ssh-script.ftl",
|
"cloud/ssh-script.ftl",
|
||||||
MapUtil.builder()
|
MapUtil.builder()
|
||||||
@@ -338,14 +330,14 @@ public class RunnerApplication implements ApplicationRunner {
|
|||||||
Paths.get(root.toString(), "update.sh")
|
Paths.get(root.toString(), "update.sh")
|
||||||
);
|
);
|
||||||
|
|
||||||
Template stopTemplate = engine.getTemplate("cloud/stop-script.ftl");
|
generateTemplate(
|
||||||
String stopScript = stopTemplate.render(MapUtil.builder()
|
"uploader/stop.ftl",
|
||||||
|
MapUtil.builder()
|
||||||
.put("currentPath", absolutRootPath)
|
.put("currentPath", absolutRootPath)
|
||||||
.put("runtime", runtimeInfo)
|
.put("runtime", runtimeInfo)
|
||||||
.build());
|
.build(),
|
||||||
// 一个魔法操作
|
Paths.get(root.toString(), "stop.sh")
|
||||||
stopScript = stopScript.replaceAll("application_name=\".*\"", "application_name=\"service-uploader.jar\"");
|
);
|
||||||
Files.write(Paths.get(root.toString(), "stop.sh"), stopScript.getBytes());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateUpdateJar(Path root) throws IOException {
|
private void generateUpdateJar(Path root) throws IOException {
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ public class ServiceInfoWrapper {
|
|||||||
return serviceInfo.getSourceJar();
|
return serviceInfo.getSourceJar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getJdk() {
|
||||||
|
return serviceInfo.getJdk();
|
||||||
|
}
|
||||||
|
|
||||||
public List<String> getClasspath() {
|
public List<String> getClasspath() {
|
||||||
return serviceInfo.getClasspath();
|
return serviceInfo.getClasspath();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,11 @@ deploy:
|
|||||||
# 应用jar包
|
# 应用jar包
|
||||||
jar-path: /data/datalake/jars
|
jar-path: /data/datalake/jars
|
||||||
# 主机jdk根目录
|
# 主机jdk根目录
|
||||||
jdk-path: /opt/jdk8u252-b09
|
default-jdk: jdk8_arm
|
||||||
|
jdk-path:
|
||||||
|
"jdk8": /opt/jdk1.8.0_162
|
||||||
|
"jdk8_arm": /opt/jdk8u252-b09
|
||||||
|
"jdk17": /opt/jdk-17.0.15
|
||||||
# 应用日志
|
# 应用日志
|
||||||
log-path: /data/datalake/logs
|
log-path: /data/datalake/logs
|
||||||
# 应用配置
|
# 应用配置
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ deploy:
|
|||||||
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
|
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
|
||||||
"[connector.hudi.app-hdfs-path]": ${deploy.runtime.hudi.app-hdfs-path}
|
"[connector.hudi.app-hdfs-path]": ${deploy.runtime.hudi.app-hdfs-path}
|
||||||
"[connector.hudi.app-test-hdfs-path]": ${deploy.runtime.hudi.app-test-hdfs-path}
|
"[connector.hudi.app-test-hdfs-path]": ${deploy.runtime.hudi.app-test-hdfs-path}
|
||||||
"[connector.hudi.victoria-push-url]": ${deploy.runtime.hudi.victoria-push-url}
|
|
||||||
"[connector.hudi.loki-push-url]": ${deploy.runtime.hudi.loki-push-url}
|
|
||||||
arguments:
|
arguments:
|
||||||
"[spring.application.name]": service-launcher-b1
|
"[spring.application.name]": service-launcher-b1
|
||||||
"[connector.cluster.cluster]": b1
|
"[connector.cluster.cluster]": b1
|
||||||
@@ -59,8 +57,6 @@ deploy:
|
|||||||
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
|
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
|
||||||
"[connector.hudi.app-hdfs-path]": ${deploy.runtime.hudi.app-hdfs-path}
|
"[connector.hudi.app-hdfs-path]": ${deploy.runtime.hudi.app-hdfs-path}
|
||||||
"[connector.hudi.app-test-hdfs-path]": ${deploy.runtime.hudi.app-test-hdfs-path}
|
"[connector.hudi.app-test-hdfs-path]": ${deploy.runtime.hudi.app-test-hdfs-path}
|
||||||
"[connector.hudi.victoria-push-url]": ${deploy.runtime.hudi.victoria-push-url}
|
|
||||||
"[connector.hudi.loki-push-url]": ${deploy.runtime.hudi.loki-push-url}
|
|
||||||
arguments:
|
arguments:
|
||||||
"[spring.application.name]": service-launcher-a4
|
"[spring.application.name]": service-launcher-a4
|
||||||
"[connector.cluster.cluster]": a4
|
"[connector.cluster.cluster]": a4
|
||||||
@@ -80,8 +76,6 @@ deploy:
|
|||||||
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
|
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
|
||||||
"[connector.hudi.app-hdfs-path]": ${deploy.runtime.hudi.app-hdfs-path}
|
"[connector.hudi.app-hdfs-path]": ${deploy.runtime.hudi.app-hdfs-path}
|
||||||
"[connector.hudi.app-test-hdfs-path]": ${deploy.runtime.hudi.app-test-hdfs-path}
|
"[connector.hudi.app-test-hdfs-path]": ${deploy.runtime.hudi.app-test-hdfs-path}
|
||||||
"[connector.hudi.victoria-push-url]": ${deploy.runtime.hudi.victoria-push-url}
|
|
||||||
"[connector.hudi.loki-push-url]": ${deploy.runtime.hudi.loki-push-url}
|
|
||||||
arguments:
|
arguments:
|
||||||
"[spring.application.name]": service-launcher-b12
|
"[spring.application.name]": service-launcher-b12
|
||||||
"[connector.cluster.cluster]": b12
|
"[connector.cluster.cluster]": b12
|
||||||
@@ -147,7 +141,6 @@ deploy:
|
|||||||
"[connector.hadoop.kerberos-principal]": ${deploy.runtime.user}/$\{hostname}.hdp.dc@ECLD.COM
|
"[connector.hadoop.kerberos-principal]": ${deploy.runtime.user}/$\{hostname}.hdp.dc@ECLD.COM
|
||||||
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
|
"[connector.hadoop.kerberos-keytab-path]": ${deploy.runtime.kerberos-keytab-path}
|
||||||
arguments:
|
arguments:
|
||||||
"[executor.loki-push-url]": ${deploy.runtime.loki.hudi-push-url}
|
|
||||||
"[executor.task-jar-path]": ${deploy.runtime.executor.task-jar-path}
|
"[executor.task-jar-path]": ${deploy.runtime.executor.task-jar-path}
|
||||||
"[executor.task-result-path]": ${deploy.runtime.executor.task-result-path}
|
"[executor.task-result-path]": ${deploy.runtime.executor.task-result-path}
|
||||||
service-web:
|
service-web:
|
||||||
@@ -168,3 +161,10 @@ deploy:
|
|||||||
- "service"
|
- "service"
|
||||||
source-jar: service-monitor-1.0.0-SNAPSHOT.jar
|
source-jar: service-monitor-1.0.0-SNAPSHOT.jar
|
||||||
replicas: 1
|
replicas: 1
|
||||||
|
service-ai-chat:
|
||||||
|
order: 6
|
||||||
|
groups:
|
||||||
|
- "ai"
|
||||||
|
source-jar: service-ai-chat-1.0.0-SNAPSHOT.jar
|
||||||
|
jdk: "jdk17"
|
||||||
|
replicas: 1
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
mkdir -p ${runtime.jarPath}
|
mkdir -p ${runtime.jarPath}
|
||||||
curl ${runtime.downloadUrl}/service-check-1.0.0-SNAPSHOT.jar -o ${runtime.jarPath}/service-check.jar
|
curl ${runtime.downloadUrl}/service-check-1.0.0-SNAPSHOT.jar -o ${runtime.jarPath}/service-check.jar
|
||||||
${runtime.jdkPath}/bin/java -jar ${runtime.jarPath}/service-check.jar
|
${runtime.jdkPath['jdk8']}/bin/java -jar ${runtime.jarPath}/service-check.jar
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ hostname_full=`ssh $host 'hostname -f'`
|
|||||||
<#-- 获取当前时间 -->
|
<#-- 获取当前时间 -->
|
||||||
start_time=`date +%Y%m%d%H%M%S`
|
start_time=`date +%Y%m%d%H%M%S`
|
||||||
ssh $host "mkdir -p ${runtime.jarPath};curl ${runtime.downloadUrl}/${info.sourceJar} -o ${runtime.jarPath}/${info.name}.jar"
|
ssh $host "mkdir -p ${runtime.jarPath};curl ${runtime.downloadUrl}/${info.sourceJar} -o ${runtime.jarPath}/${info.name}.jar"
|
||||||
ssh $host "export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P\"Dp^A47>WSn:Wn].gs/+\"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.';nohup ${runtime.jdkPath}/bin/java <#list environments?keys as key>-D${key}=${environments[key]?string} </#list>-jar ${runtime.jarPath}/${info.name}.jar <#noparse>--deploy.datetime=${datetime} --deploy.ip=${host} --deploy.hostname=${hostname} --deploy.hostname-full=${hostname_full} --deploy.start-time=${start_time}</#noparse> --hudi-service.signature=${runtime.signature} --logging.parent=${runtime.logPath} --loki.url=${runtime.loki.servicePushUrl} --spring.cloud.zookeeper.connect-string=${runtime.zkUrl} --spring.security.meta.authority='${runtime.security.authority}' --spring.security.meta.username='${runtime.security.username}' --spring.security.meta.darkcode='${runtime.security.darkcode}' --yarn-cluster.sync-clusters=${runtime.yarn.syncClusters} --yarn-cluster.compaction-clusters=${runtime.yarn.compactionClusters} <#list arguments?keys as key>--${key}='${arguments[key]?string}' </#list>> /dev/null 2>&1 &"
|
ssh $host "export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P\"Dp^A47>WSn:Wn].gs/+\"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.';nohup ${runtime.jdkPath[info.jdk!(runtime.defaultJdk)]}/bin/java <#list environments?keys as key>-D${key}=${environments[key]?string} </#list>-jar ${runtime.jarPath}/${info.name}.jar <#noparse>--deploy.datetime=${datetime} --deploy.ip=${host} --deploy.hostname=${hostname} --deploy.hostname-full=${hostname_full} --deploy.start-time=${start_time}</#noparse> --hudi-service.signature=${runtime.signature} --logging.parent=${runtime.logPath} --spring.cloud.zookeeper.connect-string=${runtime.zkUrl} --spring.security.meta.authority='${runtime.security.authority}' --spring.security.meta.username='${runtime.security.username}' --spring.security.meta.darkcode='${runtime.security.darkcode}' --yarn-cluster.sync-clusters=${runtime.yarn.syncClusters} --yarn-cluster.compaction-clusters=${runtime.yarn.compactionClusters} <#list arguments?keys as key>--${key}='${arguments[key]?string}' </#list>> /dev/null 2>&1 &"
|
||||||
</#if>
|
</#if>
|
||||||
echo ''
|
echo ''
|
||||||
</#list>
|
</#list>
|
||||||
|
|||||||
@@ -1,7 +1,46 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
<#list hosts as host>
|
<#list hosts as host>
|
||||||
host=${host.ip}
|
|
||||||
echo "${info.name} ${host.ip} ${host.hostname} $datetime"
|
echo "${info.name} ${host.ip} ${host.hostname} $datetime"
|
||||||
ssh $host 'bash -s' < ${currentPath}/stop.sh ${runtime.jarPath}/${info.name}.jar
|
ssh ${host.ip} bash -s <<'EOF'
|
||||||
|
original_command="$0"
|
||||||
|
application_name="${runtime.jarPath}/${info.name}.jar"
|
||||||
|
|
||||||
|
function get_pid() {
|
||||||
|
ID=$(ps ef | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{ print $2 }')
|
||||||
|
if [[ -z "$ID" ]]; then
|
||||||
|
ID=$(ps aux | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{print $2}')
|
||||||
|
if [[ -z "$ID" ]]; then
|
||||||
|
ID=$(${runtime.jdkPath[info.jdk!(runtime.defaultJdk)]}/bin/jps -lmvV | grep "$application_name" | awk '{print $1}')
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo $ID
|
||||||
|
}
|
||||||
|
|
||||||
|
pid=$(get_pid)
|
||||||
|
|
||||||
|
if [[ -z "$pid" ]]; then
|
||||||
|
echo "Application is already stopped."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Stopping $pid..."
|
||||||
|
kill $pid
|
||||||
|
|
||||||
|
LOOPS=0
|
||||||
|
while (true); do
|
||||||
|
cpid=$(get_pid)
|
||||||
|
if [[ -z "$cpid" ]]; then
|
||||||
|
echo "Oook! cost:$LOOPS"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
LOOPS=$(($LOOPS+1))
|
||||||
|
if [[ $(($LOOPS%15)) -eq 0 ]]; then
|
||||||
|
echo "Wait timeout, try to force kill $pid..."
|
||||||
|
kill -9 $pid
|
||||||
|
fi
|
||||||
|
sleep 1s
|
||||||
|
done
|
||||||
|
EOF
|
||||||
|
|
||||||
</#list>
|
</#list>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
mkdir -p ${runtime.jarPath}
|
mkdir -p ${runtime.jarPath}
|
||||||
export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P\"Dp^A47>WSn:Wn].gs/+\"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.'
|
export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P\"Dp^A47>WSn:Wn].gs/+\"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.'
|
||||||
${runtime.jdkPath}/bin/java <#noparse>-Ddeploy.datetime=$(date +%Y%m%d%H%M%S) -Ddeploy.hostname=$(hostname) -Ddeploy.hostname-full=$(hostname -f) -Ddeploy.start-time=$(date +%Y%m%d%H%M%S)</#noparse> -Dlogging.parent=${runtime.logPath} -Dloki.url=${runtime.loki.servicePushUrl} -Dspring.cloud.zookeeper.connect-string=${runtime.zkUrl} -Dyarn-cluster.sync-clusters=${runtime.yarn.syncClusters} -Dyarn-cluster.compaction-clusters=${runtime.yarn.compactionClusters} -jar ${runtime.jarPath}/service-command-pro.jar<#if directly> $@</#if>
|
${runtime.jdkPath['jdk8']}/bin/java <#noparse>-Ddeploy.datetime=$(date +%Y%m%d%H%M%S) -Ddeploy.hostname=$(hostname) -Ddeploy.hostname-full=$(hostname -f) -Ddeploy.start-time=$(date +%Y%m%d%H%M%S)</#noparse> -Dlogging.parent=${runtime.logPath} -Dloki.url=${runtime.loki.servicePushUrl} -Dspring.cloud.zookeeper.connect-string=${runtime.zkUrl} -Dyarn-cluster.sync-clusters=${runtime.yarn.syncClusters} -Dyarn-cluster.compaction-clusters=${runtime.yarn.compactionClusters} -jar ${runtime.jarPath}/service-command-pro.jar<#if directly> $@</#if>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
mkdir -p ${runtime.jarPath}
|
mkdir -p ${runtime.jarPath}
|
||||||
export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P\"Dp^A47>WSn:Wn].gs/+\"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.'
|
export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P\"Dp^A47>WSn:Wn].gs/+\"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.'
|
||||||
${runtime.jdkPath}/bin/java <#noparse>-Ddeploy.datetime=$(date +%Y%m%d%H%M%S) -Ddeploy.hostname=$(hostname) -Ddeploy.hostname-full=$(hostname -f) -Ddeploy.start-time=$(date +%Y%m%d%H%M%S)</#noparse> -Dlogging.parent=${runtime.logPath} -Dloki.url=${runtime.loki.servicePushUrl} -Dspring.cloud.zookeeper.connect-string=${runtime.zkUrl} -Dyarn-cluster.sync-clusters=${runtime.yarn.syncClusters} -Dyarn-cluster.compaction-clusters=${runtime.yarn.compactionClusters} -jar ${runtime.jarPath}/service-command.jar<#if directly> $@</#if>
|
${runtime.jdkPath['jdk8']}/bin/java <#noparse>-Ddeploy.datetime=$(date +%Y%m%d%H%M%S) -Ddeploy.hostname=$(hostname) -Ddeploy.hostname-full=$(hostname -f) -Ddeploy.start-time=$(date +%Y%m%d%H%M%S)</#noparse> -Dlogging.parent=${runtime.logPath} -Dloki.url=${runtime.loki.servicePushUrl} -Dspring.cloud.zookeeper.connect-string=${runtime.zkUrl} -Dyarn-cluster.sync-clusters=${runtime.yarn.syncClusters} -Dyarn-cluster.compaction-clusters=${runtime.yarn.compactionClusters} -jar ${runtime.jarPath}/service-command.jar<#if directly> $@</#if>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
mkdir -p ${runtime.jarPath}
|
mkdir -p ${runtime.jarPath}
|
||||||
export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P"Dp^A47>WSn:Wn].gs/+"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.'
|
export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P"Dp^A47>WSn:Wn].gs/+"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.'
|
||||||
nohup ${runtime.jdkPath}/bin/java -jar ${runtime.jarPath}/service-uploader.jar <#noparse>--deploy.datetime=$(date +%Y%m%d%H%M%S) --deploy.hostname=$(hostname) --deploy.hostname-full=$(hostname -f) --deploy.start-time=$(date +%Y%m%d%H%M%S)</#noparse> --logging.parent=${runtime.logPath} --loki.url=${runtime.loki.servicePushUrl} --spring.cloud.zookeeper.connect-string=${runtime.zkUrl} --uploader.backend=local --uploader.tmp-dir=${runtime.dataPath}/uploader --spring.security.meta.authority='${runtime.security.authority}' --spring.security.meta.username='${runtime.security.username}' --spring.security.meta.darkcode='${runtime.security.darkcode}' > /dev/null 2>&1 &
|
nohup ${runtime.jdkPath['jdk8']}/bin/java -jar ${runtime.jarPath}/service-uploader.jar <#noparse>--deploy.datetime=$(date +%Y%m%d%H%M%S) --deploy.hostname=$(hostname) --deploy.hostname-full=$(hostname -f) --deploy.start-time=$(date +%Y%m%d%H%M%S)</#noparse> --logging.parent=${runtime.logPath} --loki.url=${runtime.loki.servicePushUrl} --spring.cloud.zookeeper.connect-string=${runtime.zkUrl} --uploader.backend=local --uploader.tmp-dir=${runtime.dataPath}/uploader --spring.security.meta.authority='${runtime.security.authority}' --spring.security.meta.username='${runtime.security.username}' --spring.security.meta.darkcode='${runtime.security.darkcode}' > /dev/null 2>&1 &
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
original_command="$0"
|
original_command="$0"
|
||||||
application_name="$1"
|
application_name="service-uploader.jar"
|
||||||
|
|
||||||
function get_pid() {
|
function get_pid() {
|
||||||
ID=$(ps ef | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{ print $2 }')
|
ID=$(ps ef | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{ print $2 }')
|
||||||
if [[ -z "$ID" ]]; then
|
if [[ -z "$ID" ]]; then
|
||||||
ID=$(ps aux | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{print $2}')
|
ID=$(ps aux | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{print $2}')
|
||||||
if [[ -z "$ID" ]]; then
|
if [[ -z "$ID" ]]; then
|
||||||
ID=$(${runtime.jdkPath}/bin/jps -lmvV | grep "$application_name" | awk '{print $1}')
|
ID=$(${runtime.jdkPath['jdk8']}/bin/jps -lmvV | grep "$application_name" | awk '{print $1}')
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo $ID
|
echo $ID
|
||||||
Reference in New Issue
Block a user