public static void main(String[] args) { Config config = new Config(); config.setLiteMember(true); HazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance(config); Cluster cluster = hazelcastInstance.getCluster(); cluster.promoteLocalLiteMember(); } }
@Override public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception { JsonObject result = new JsonObject(); try { mcs.getHazelcastInstance().getCluster().promoteLocalLiteMember(); result.add("success", true); } catch (IllegalStateException e) { result.add("success", false); result.add("message", e.getMessage()); } out.add("result", result); }
@Override public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception { JsonObject result = new JsonObject(); try { mcs.getHazelcastInstance().getCluster().promoteLocalLiteMember(); result.add("success", true); } catch (IllegalStateException e) { result.add("success", false); result.add("message", e.getMessage()); } out.add("result", result); }