...
|
...
|
@@ -350,6 +350,47 @@ public class CloudToolServiceImpl implements CloudToolService { |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
public BaseResponse updateNginxConfig(AutoScalingInfoReq infoReq){
|
|
|
BaseResponse response=new BaseResponse();
|
|
|
StringBuilder commond = new StringBuilder();
|
|
|
commond.append("sh /home/master/ops-sh/");
|
|
|
if("java".equalsIgnoreCase(infoReq.getNginxType())){
|
|
|
commond.append("java-nginx.sh ");
|
|
|
}else{
|
|
|
commond.append("pch5-nginx.sh ");////要有空格
|
|
|
}
|
|
|
String cloud = "aws";
|
|
|
if(2==infoReq.getCloudType()){
|
|
|
cloud="qcloud";
|
|
|
}
|
|
|
commond.append("\""+cloud+"\"");
|
|
|
String ips=infoReq.getNewInstanceIps();
|
|
|
commond.append(" ");
|
|
|
|
|
|
|
|
|
String allips="";
|
|
|
for(String ip:ips.split(",")){
|
|
|
if(allips.length()>0){
|
|
|
allips += " ";
|
|
|
}
|
|
|
allips += ip;
|
|
|
}
|
|
|
commond.append("\"");
|
|
|
commond.append(allips);
|
|
|
commond.append("\"");
|
|
|
logger.error(" - begin - updateNginxConfig- sql"+commond.toString());
|
|
|
response.setMessage(commond.toString());
|
|
|
try{
|
|
|
CommodUtil.exe(commond.toString());
|
|
|
}catch (Exception e){
|
|
|
logger.error(" - CloudToolServiceImpl - updateNginxConfig- error", e);
|
|
|
response.setCode(300);
|
|
|
response.setMessage(e.getMessage());
|
|
|
}
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
public String buildMoName(String prename,String environment) {
|
|
|
if(environment.equals("aws")){
|
|
|
prename += "_aws_";
|
...
|
...
|
|