|
|
|
@ -8,7 +8,9 @@ import net.educoder.model.dto.CreateCloudHostDto;
|
|
|
|
|
import net.educoder.model.param.ResetCloudHostParam;
|
|
|
|
|
import net.educoder.util.JCloudUtil;
|
|
|
|
|
import net.educoder.util.ShellUtil;
|
|
|
|
|
import net.educoder.util.SleepUtil;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.commons.lang3.ThreadUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
@ -144,6 +146,8 @@ public class CloudHostService {
|
|
|
|
|
* @param floatingIp
|
|
|
|
|
*/
|
|
|
|
|
private void intranetThrough(int port, String username, String password, String floatingIp) {
|
|
|
|
|
// 休眠一下是有时候出现这个问题 connect to host 10.119.5.5 port 22: No route to host
|
|
|
|
|
SleepUtil.sleep(3 * 1000);
|
|
|
|
|
String template = frpcTemplate.replaceAll("\\{param1}", frpcHost).replaceAll("\\{param2}", String.valueOf(port));
|
|
|
|
|
|
|
|
|
|
// 通过浮动ip+port 连接ssh执行脚本
|
|
|
|
|