[server] - 修改bug
This commit is contained in:
@@ -32,7 +32,7 @@ public class AgentOperationInfoService {
|
||||
// 需要此部分写为String, 否则无法解析
|
||||
String agentServerInfoString;
|
||||
try {
|
||||
agentServerInfoString = objectMapper.writeValueAsString(objectMapper);
|
||||
agentServerInfoString = objectMapper.writeValueAsString(agentServerInfo);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class OctopusMessageHandler {
|
||||
}
|
||||
|
||||
// Octopus Message Handler
|
||||
log.info(
|
||||
log.debug(
|
||||
"received from agent : {} ",
|
||||
octopusMessage
|
||||
);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
##### environment variables ######
|
||||
|
||||
JAVA_OPTS="-Xms128m -Xmx512m -Dfile.encoding=utf-8 --spring.profiles.active=k3s --spring.cloud.nacos.config.group=k3s --spring.cloud.nacos.config.extension-configs[0].dataId=common-k3s.yaml --spring.cloud.nacos.config.extension-configs[0].group=k3s"
|
||||
JAVA_OPTS="-Xms128m -Xmx512m -Ddebug=false -Dfile.encoding=utf-8 --spring.profiles.active=k3s --spring.cloud.nacos.config.group=k3s --spring.cloud.nacos.config.extension-configs[0].dataId=common-k3s.yaml --spring.cloud.nacos.config.extension-configs[0].group=k3s"
|
||||
|
||||
DependLibFiles=(
|
||||
wdd-lib-file.sh
|
||||
@@ -341,6 +341,7 @@ InstallJDKPackage() {
|
||||
systemdAgent() {
|
||||
|
||||
# https://www.baeldung.com/linux/run-java-application-as-service
|
||||
colorEcho $BLUE "[守护]-开始设置Agent的守护进程"
|
||||
|
||||
cat >/etc/systemd/system/octopus-agent.service <<EOF
|
||||
[Unit]
|
||||
@@ -563,6 +564,16 @@ EOF
|
||||
FunctionSuccess
|
||||
}
|
||||
|
||||
#######################################
|
||||
# description
|
||||
# Globals:
|
||||
# BLUE
|
||||
# GREEN
|
||||
# PURPLE
|
||||
# RED
|
||||
# Arguments:
|
||||
# None
|
||||
#######################################
|
||||
ChangeTimeZoneAndNTP() {
|
||||
FunctionStart
|
||||
colorEcho ${BLUE} "开始使用 timedatectl 工具进行时间同步…………"
|
||||
@@ -584,6 +595,31 @@ ChangeTimeZoneAndNTP() {
|
||||
FunctionEnd
|
||||
}
|
||||
|
||||
#######################################
|
||||
# description
|
||||
# Arguments:
|
||||
# None
|
||||
#######################################
|
||||
CleanOldOctopusAgent() {
|
||||
FunctionStart
|
||||
|
||||
colorEcho $BLUE "start to kill old octopus-agent"
|
||||
|
||||
agentPid=$(ps -ef | grep -v "color="| grep -c "octopus-agent")
|
||||
if [[ $agentPid -gt 0 ]]; then
|
||||
colorEcho $BLUE "old agent existed ! start to kill"
|
||||
systemctl stop octopus-agent
|
||||
sleep 2
|
||||
systemctl disable octopus-agent
|
||||
|
||||
rm -rf /etc/systemd/system/octopus-agent.service
|
||||
|
||||
fi
|
||||
|
||||
FunctionSuccess
|
||||
FunctionEnd
|
||||
}
|
||||
|
||||
#######################################
|
||||
# description
|
||||
# Arguments:
|
||||
@@ -600,6 +636,8 @@ main() {
|
||||
|
||||
InstallJDKPackage 11
|
||||
|
||||
CleanOldOctopusAgent
|
||||
|
||||
DownloadAllFile
|
||||
|
||||
ChangeTimeZoneAndNTP
|
||||
|
||||
Reference in New Issue
Block a user