Showing
1 changed file
with
5 additions
and
5 deletions
@@ -22,6 +22,9 @@ import java.util.concurrent.ConcurrentHashMap; | @@ -22,6 +22,9 @@ import java.util.concurrent.ConcurrentHashMap; | ||
22 | * Created by zhengyouwei on 2017/2/28. | 22 | * Created by zhengyouwei on 2017/2/28. |
23 | * <p> | 23 | * <p> |
24 | * 监控node节点 | 24 | * 监控node节点 |
25 | + * | ||
26 | + * 9615 端口是个node项目,检测cpu,内存等信息, | ||
27 | + * 需要在host主机上部署 | ||
25 | */ | 28 | */ |
26 | @Component | 29 | @Component |
27 | public class NodePm2Task { | 30 | public class NodePm2Task { |
@@ -40,9 +43,6 @@ public class NodePm2Task { | @@ -40,9 +43,6 @@ public class NodePm2Task { | ||
40 | 43 | ||
41 | @Scheduled(cron = "${cron_task_node_mem}") | 44 | @Scheduled(cron = "${cron_task_node_mem}") |
42 | public void nodePm2Info() { | 45 | public void nodePm2Info() { |
43 | - | ||
44 | - logger.info("cron_task_node_mem start"); | ||
45 | - | ||
46 | try { | 46 | try { |
47 | String projects = httpRestClientService.doGet(URL + "getProjects", null); | 47 | String projects = httpRestClientService.doGet(URL + "getProjects", null); |
48 | logger.info("cron_task_node_mem projects "+projects); | 48 | logger.info("cron_task_node_mem projects "+projects); |
@@ -63,12 +63,12 @@ public class NodePm2Task { | @@ -63,12 +63,12 @@ public class NodePm2Task { | ||
63 | List<PythonEnv> pythonEnvs = pythonProject.getEnvs(); | 63 | List<PythonEnv> pythonEnvs = pythonProject.getEnvs(); |
64 | for (PythonEnv pythonEnv : pythonEnvs) { | 64 | for (PythonEnv pythonEnv : pythonEnvs) { |
65 | for (String ip : pythonEnv.getHost_ips()) { | 65 | for (String ip : pythonEnv.getHost_ips()) { |
66 | - if (ipSet.contains(ip) || !(ip.startsWith("10") || ip.startsWith("172"))) { | 66 | + if (ipSet.contains(ip)||ip.equals("10.66.50.140") || !(ip.startsWith("10") || ip.startsWith("172"))) { |
67 | continue; | 67 | continue; |
68 | } | 68 | } |
69 | ipSet.add(ip); | 69 | ipSet.add(ip); |
70 | 70 | ||
71 | - logger.info("cron_task_node_mem for ip {} ,name {} ",ip,pythonEnv.getName()); | 71 | + //logger.info("cron_task_node_mem for ip {} ,name {} ",ip,pythonEnv.getName()); |
72 | 72 | ||
73 | String result = httpRestClientService.doGet("http://" + ip + ":9615", null); | 73 | String result = httpRestClientService.doGet("http://" + ip + ":9615", null); |
74 | if(result==null){ | 74 | if(result==null){ |
-
Please register or login to post a comment