[agent-go] - bug fixs
This commit is contained in:
@@ -55,6 +55,9 @@ func (op *AgentOsOperator) Exec(baseFuncName string, funcArgs ...string) (bool,
|
||||
case "shutdownFirewall":
|
||||
resultOk, errorLog = op.shutdownFirewallExec()
|
||||
break
|
||||
case "MODIFY_SYSCONFIG":
|
||||
resultOk, errorLog = op.modifySystemConfigExec()
|
||||
break
|
||||
case "modifyHostname":
|
||||
resultOk, errorLog = op.modifyHostnameExec(funcArgs)
|
||||
break
|
||||
|
||||
@@ -322,9 +322,18 @@ func uniformAgentServerName(agentInfo *a_status.AgentInfo, agentServerInfo *a_ag
|
||||
|
||||
var numS string
|
||||
if agentServerInfo.ServerIPInV4 != "" {
|
||||
// 使用IP最为Agent的序号代码
|
||||
split := strings.Split(agentServerInfo.ServerIPInV4, ".")
|
||||
numS = split[3]
|
||||
|
||||
// 归一化长度为 003 123 234
|
||||
parseInt, err := strconv.ParseInt(numS, 10, 64)
|
||||
if err != nil {
|
||||
log.WarnF("parse server ip to int error ! => %v", err)
|
||||
}
|
||||
numS = fmt.Sprintf("%03d", parseInt)
|
||||
} else {
|
||||
// 没有IP信息,随机生成一个
|
||||
// Seed the random number generator
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
|
||||
|
||||
@@ -16,6 +16,10 @@ public enum BaseFunctionEnum {
|
||||
"关闭虚拟内存"
|
||||
),
|
||||
|
||||
MODIFY_SYSCONFIG(
|
||||
"MODIFY_SYSCONFIG",
|
||||
"修改系统配置"
|
||||
),
|
||||
|
||||
DISABLE_SELINUX(
|
||||
"DISABLE_SELINUX",
|
||||
|
||||
@@ -157,6 +157,9 @@ public class BaseFuncScheduler {
|
||||
agentTopicName,
|
||||
durationBaseFunc
|
||||
);
|
||||
|
||||
// remove
|
||||
baseFuncArgList.remove(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -97,6 +97,11 @@ mybatis-plus:
|
||||
# mapper-locations: classpath*:/real-mappers/**/*.xml
|
||||
|
||||
octopus:
|
||||
notify:
|
||||
# 消息通知的URL地址
|
||||
pusher_url: http://192.168.35.71:8080
|
||||
# 发送消息的密钥 不需要使用
|
||||
access_token: tk_zvdb67fwj1hrjivkq3ga9z7u63av5
|
||||
message:
|
||||
# agent boot up default common exchange
|
||||
init_exchange: InitExchange
|
||||
@@ -9,7 +9,7 @@ spring:
|
||||
allow-circular-references: true
|
||||
allow-bean-definition-overriding: true
|
||||
rabbitmq:
|
||||
host: 10.250.0.100
|
||||
host: 42.192.52.227
|
||||
port: 20672
|
||||
username: boge
|
||||
password: boge8tingH
|
||||
@@ -24,7 +24,7 @@ spring:
|
||||
max-interval: 65000
|
||||
initial-interval: 2000
|
||||
redis:
|
||||
host: 10.250.0.100
|
||||
host: 42.192.52.227
|
||||
port: 21370
|
||||
database: 0
|
||||
password: boge8tingH
|
||||
@@ -46,7 +46,7 @@ spring:
|
||||
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://10.250.0.100:21306/octopus_server?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://42.192.52.227:21306/octopus_server?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
||||
username: boge
|
||||
password: boge8tingH
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
|
||||
@@ -50,7 +50,8 @@ public class TestBaseFuncScheduler {
|
||||
// Long projectServerId = 1764575895186030593L;// 上海雷视联动
|
||||
// Long projectServerId = 1777152043483353089L;// 吉林移动
|
||||
// Long projectServerId = 1765654823726669826L;// 资阳公安
|
||||
Long projectServerId = 1778681124701483009L;// 北京通感
|
||||
// Long projectServerId = 1778681124701483009L;// 北京通感
|
||||
Long projectServerId = 1788026824445317122L;// 新疆移动
|
||||
// Long projectServerId = 1773619219367120898L; // 内网35-71项目
|
||||
|
||||
|
||||
@@ -60,7 +61,8 @@ public class TestBaseFuncScheduler {
|
||||
// String masterNodeServerName = "Shanghai-amd64-09"; // cgga
|
||||
// String masterNodeServerName = "Chengdu-amd64-51"; // 吉林移动
|
||||
// String masterNodeServerName = "Chengdu-amd64-51"; // 吉林移动
|
||||
String masterNodeServerName = "Chengdu-amd64-10"; // 北京通感
|
||||
// String masterNodeServerName = "Chengdu-amd64-10"; // 北京通感
|
||||
String masterNodeServerName = "Chengdu-amd64-14"; // 新疆移动
|
||||
// String masterNodeServerName = "Ziyang-amd64-61"; // 资阳公安
|
||||
|
||||
ProjectServerVO projectServerVO = coreProjectServerService.projectServerOne(projectServerId);
|
||||
@@ -81,12 +83,14 @@ public class TestBaseFuncScheduler {
|
||||
|
||||
|
||||
List<BaseFunctionEnum> masterNodeProcedure = List.of(
|
||||
BaseFunctionEnum.DISABLE_SWAP,
|
||||
BaseFunctionEnum.DISABLE_SELINUX,
|
||||
BaseFunctionEnum.SHUTDOWN_FIREWALL,
|
||||
BaseFunctionEnum.INSTALL_DOCKER,
|
||||
BaseFunctionEnum.INSTALL_DEFAULT_SSH_KEY,
|
||||
BaseFunctionEnum.INSTALL_DOCKER_COMPOSE,
|
||||
// BaseFunctionEnum.DISABLE_SWAP,
|
||||
// BaseFunctionEnum.DISABLE_SELINUX,
|
||||
// BaseFunctionEnum.MODIFY_SYSCONFIG,
|
||||
// BaseFunctionEnum.SHUTDOWN_FIREWALL,
|
||||
// BaseFunctionEnum.INSTALL_DOCKER,
|
||||
// BaseFunctionEnum.INSTALL_DEFAULT_SSH_KEY,
|
||||
// BaseFunctionEnum.INSTALL_DOCKER_COMPOSE,
|
||||
// BaseFunctionEnum.INSTALL_NFS_SERVER_ONLINE,
|
||||
BaseFunctionEnum.MODIFY_DOCKER_CONFIG,
|
||||
BaseFunctionEnum.INSTALL_HARBOR
|
||||
);
|
||||
@@ -94,10 +98,12 @@ public class TestBaseFuncScheduler {
|
||||
List<BaseFunctionEnum> agentNodeProcedure = List.of(
|
||||
BaseFunctionEnum.DISABLE_SWAP,
|
||||
BaseFunctionEnum.INSTALL_DEFAULT_SSH_KEY,
|
||||
BaseFunctionEnum.MODIFY_SYSCONFIG,
|
||||
BaseFunctionEnum.DISABLE_SELINUX,
|
||||
BaseFunctionEnum.SHUTDOWN_FIREWALL,
|
||||
BaseFunctionEnum.INSTALL_DOCKER,
|
||||
BaseFunctionEnum.INSTALL_DOCKER_COMPOSE,
|
||||
BaseFunctionEnum.INSTALL_NFS_ONLINE,
|
||||
BaseFunctionEnum.MODIFY_DOCKER_CONFIG
|
||||
);
|
||||
|
||||
@@ -116,7 +122,7 @@ public class TestBaseFuncScheduler {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
// baseFuncScheduler.runProcedure(projectDeployContext);
|
||||
baseFuncScheduler.runProcedure(projectDeployContext);
|
||||
|
||||
// 只能支持 带端口的HarborHost 默认为8033
|
||||
// harborFuncScheduler.runProcedure(projectDeployContext);
|
||||
@@ -144,7 +150,7 @@ public class TestBaseFuncScheduler {
|
||||
);
|
||||
projectDeployContext.setMasterAppProcedure(appFunctionEnumList);
|
||||
|
||||
appFuncScheduler.runProcedure(projectDeployContext);
|
||||
// appFuncScheduler.runProcedure(projectDeployContext);
|
||||
|
||||
|
||||
masterNodeProcedure = List.of(BaseFunctionEnum.CHRONY_TO_MASTER);
|
||||
|
||||
@@ -38,13 +38,13 @@ public class TestImageSyncScheduler {
|
||||
public void runImageSync() {
|
||||
|
||||
ArrayList<String> CmiiAppNameList = new ArrayList<>(List.of(
|
||||
// "cmii-uav-process:5.4.0-041901"1
|
||||
// "cmii-uav-process:5.3.0-050601"
|
||||
));
|
||||
|
||||
ArrayList<String> ImageFullNameList = new ArrayList<>(List.of(
|
||||
// "harbor.cdcyy.com.cn/cmii/cmii-live-operator:5.2.0",
|
||||
// "harbor.cdcyy.com.cn/cmii/cmii/srs:v5.0.195"
|
||||
"harbor.cdcyy.com.cn/cmii/cmii-uav-platform:5.3.0-cqly-042902"
|
||||
"harbor.cdcyy.com.cn/cmii/cmii-uav-platform:5.3.0-cqly-050702"
|
||||
));
|
||||
|
||||
Boolean downloadAndCompressOnly = false;
|
||||
|
||||
Reference in New Issue
Block a user