Showing
1 changed file
with
5 additions
and
10 deletions
monitor-service-awstools/src/main/java/com/monitor/cloudtools/service/impl/CloudToolServiceImpl.java
@@ -353,22 +353,17 @@ public class CloudToolServiceImpl implements CloudToolService { | @@ -353,22 +353,17 @@ public class CloudToolServiceImpl implements CloudToolService { | ||
353 | 353 | ||
354 | public BaseResponse updateNginxConfig(AutoScalingInfoReq infoReq){ | 354 | public BaseResponse updateNginxConfig(AutoScalingInfoReq infoReq){ |
355 | BaseResponse response=new BaseResponse(); | 355 | BaseResponse response=new BaseResponse(); |
356 | - StringBuilder commond = new StringBuilder(); | ||
357 | - commond.append("sh /home/master/ops-sh/"); | ||
358 | - if("java".equalsIgnoreCase(infoReq.getNginxType())){ | ||
359 | - commond.append("java-nginx.sh "); | ||
360 | - }else{ | ||
361 | - commond.append("pch5-nginx.sh ");////要有空格 | 356 | + String commond = "ssh master@172.31.16.167 sh /home/master/nginx-sync/update-java-nginx.sh"; |
357 | + if(!"java".equalsIgnoreCase(infoReq.getNginxType())){ | ||
358 | + commond = "ssh master@172.31.16.167 sh /home/master/nginx-sync/update-pch5-nginx.sh"; | ||
362 | } | 359 | } |
363 | String cloud = "aws"; | 360 | String cloud = "aws"; |
364 | if(2==infoReq.getCloudType()){ | 361 | if(2==infoReq.getCloudType()){ |
365 | cloud="qcloud"; | 362 | cloud="qcloud"; |
366 | } | 363 | } |
367 | - commond.append(cloud); | ||
368 | - commond.append(" ");////要有空格 | ||
369 | - commond.append(infoReq.getNewInstanceIps()); | 364 | + commond = commond +" "+cloud+" "+infoReq.getNewInstanceIps(); |
370 | 365 | ||
371 | - logger.error(" - begin - updateNginxConfig- "+commond.toString()); | 366 | + logger.error(" - begin - updateNginxConfig is "+commond); |
372 | response.setMessage(commond.toString()); | 367 | response.setMessage(commond.toString()); |
373 | try{ | 368 | try{ |
374 | CommodUtil.exe(commond.toString()); | 369 | CommodUtil.exe(commond.toString()); |
-
Please register or login to post a comment