Hi vgrigorev,
I used your suggestion to do health check for each node. But I got memory
leak issue and exit with OOM error: java heap space.
Below is my example code:
// I create one bean to collect what I want info which include IP, hostname,
createtime and then return json string.
IgniteHealthCheckEntity healthCheck = new IgniteHealthCheckEntity();
ClusterNode node = ignite.cluster().localNode();
List<String> adresses = (List<String>)node.addresses();
String ip = adresses.get(0);
List<String> hostnames = (List<String>)node.hostNames();
String hostname = hostnames.get(0);
healthCheck.setServerIp(ip);
healthCheck.setStatus(0);
healthCheck.setServerHostname(hostname);
healthCheck.setMonitorTime(monitorTime);
healthCheck.setClientIp(clientIp);
String cacheName = "test_monitor_" + ipStr + "_"+ new Date().getTime();
IgniteCache<String, String> putCache = ignite.createCache(cacheName);
putCache.put("test", "test");
String value = putCache.get("test");
if(!"test".equals(value)) {
message = "Ignite ("+ ip +") " + "get/put value failed";
healthCheck.setMessage(message);
return JSONObject.fromObject(healthCheck).toString();
}else {
message = "OKOKOK";
healthCheck.setMessage(message);
return JSONObject.fromObject(healthCheck).toString();
}
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/