diff --git a/src/main/java/net/educoder/service/CloudHostService.java b/src/main/java/net/educoder/service/CloudHostService.java index 4cc1fe0..6a1b321 100644 --- a/src/main/java/net/educoder/service/CloudHostService.java +++ b/src/main/java/net/educoder/service/CloudHostService.java @@ -73,7 +73,9 @@ public class CloudHostService { apiToken = refreshApiToken(); } // 创建云主机 - CreateCloudHostDto createCloudHostDto = JCloudUtil.oneStepCreateCloudHost(apiToken, imageId, nextNetworkId()); + String networkId = nextNetworkId(); + log.info("创建云主机:port:{}, networkId:{}", port, networkId); + CreateCloudHostDto createCloudHostDto = JCloudUtil.oneStepCreateCloudHost(apiToken, imageId, networkId); // 内网穿透 intranetThrough(port, createCloudHostDto.getUsername(), createCloudHostDto.getPassword(), createCloudHostDto.getFloatingIp()); diff --git a/src/main/java/net/educoder/util/JCloudUtil.java b/src/main/java/net/educoder/util/JCloudUtil.java index 14680e1..9e74093 100644 --- a/src/main/java/net/educoder/util/JCloudUtil.java +++ b/src/main/java/net/educoder/util/JCloudUtil.java @@ -416,8 +416,9 @@ public class JCloudUtil { log.error("serverId:{}云主机重新构建失败", serverId); throw new BusinessException("云主机重新构建失败"); } + log.info("重置云主机成功:serverId:{},", resetCloudHostParam.getServerId()); - SleepUtil.sleep(30 * 1000); + SleepUtil.sleep(50 * 1000); log.info("oneStepRebuildCloudHost 开始执行修改云主机:{} 密码", serverId); boolean changePwdStatus = changePassword(apiToken, serverId, "Educoder123"); if (!changePwdStatus) { diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index c275a64..736186e 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -11,8 +11,4 @@ jcloud: frpc: host: 39.104.50.181 template: "[common]\nserver_addr = {param1}\nserver_port = 7000\n[ssh{param2}]\ntype = tcp\nlocal_ip = 127.0.0.1\nlocal_port = 22\nremote_port = {param2}" - networkIds: "f41ece4b-ff14-4444-8d1d-c730779a0df2; - d393c438-d0e1-4489-9642-e3d32db7e704;b4e26904-c9b9-4620-bd94-1945562d535e; - 0dc4f41b-7e13-4e9d-b771-252c4ea5d851;8958554d-0fc3-4c8c-a288-69fc6e06cd13; - 3b598368-0f93-430e-9dec-c73f2930fddc;284f9866-0d6b-4306-a7fe-177afaac18c5; - b7204f48-06be-4216-83da-f631711fd3c9;3302992e-0143-4e06-9d11-78abe8881c5f;" + networkIds: "f41ece4b-ff14-4444-8d1d-c730779a0df2;d393c438-d0e1-4489-9642-e3d32db7e704;b4e26904-c9b9-4620-bd94-1945562d535e;0dc4f41b-7e13-4e9d-b771-252c4ea5d851;8958554d-0fc3-4c8c-a288-69fc6e06cd13;3b598368-0f93-430e-9dec-c73f2930fddc;284f9866-0d6b-4306-a7fe-177afaac18c5;b7204f48-06be-4216-83da-f631711fd3c9;3302992e-0143-4e06-9d11-78abe8881c5f;"