Authored by qinchao

nginx自动伸缩

... ... @@ -353,22 +353,17 @@ 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 commond = "ssh master@172.31.16.167 sh /home/master/nginx-sync/update-java-nginx.sh";
if(!"java".equalsIgnoreCase(infoReq.getNginxType())){
commond = "ssh master@172.31.16.167 sh /home/master/nginx-sync/update-pch5-nginx.sh";
}
String cloud = "aws";
if(2==infoReq.getCloudType()){
cloud="qcloud";
}
commond.append(cloud);
commond.append(" ");////要有空格
commond.append(infoReq.getNewInstanceIps());
commond = commond +" "+cloud+" "+infoReq.getNewInstanceIps();
logger.error(" - begin - updateNginxConfig- "+commond.toString());
logger.error(" - begin - updateNginxConfig is "+commond);
response.setMessage(commond.toString());
try{
CommodUtil.exe(commond.toString());
... ...