From 5070063bf009013926ef3c411ae606f5d29b4e3a Mon Sep 17 00:00:00 2001 From: youys <1272586223@qq.com> Date: Thu, 25 Aug 2022 16:24:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/net/educoder/service/CloudHostService.java | 4 +++- src/main/java/net/educoder/util/JCloudUtil.java | 3 ++- src/main/resources/application.yml | 6 +----- 3 files changed, 6 insertions(+), 7 deletions(-) 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;"