<div dir="ltr">Hey Tristan!<div><br></div><div>Comments inlined.</div><div><br></div><div>Thanks</div><div>Sebastian</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 26, 2016 at 9:50 AM, Tristan Tarrant <span dir="ltr"><<a href="mailto:ttarrant@redhat.com" target="_blank">ttarrant@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="">On 26/07/16 07:10, Sebastian Laskawiec wrote:<br>
> Dear Community,<br>
><br>
> I'd like to ask you for help. I'm currently sketching a design for a<br>
> REST health check endpoint for Infinispan and I'm trying to imagine<br>
> possible use cases.<br>
</span>The health-check should be implemented as an MBean initially, with the<br>
ability to expose it via alternative implementations later. The server<br>
RESTful endpoint should be registered with the management interface via<br>
a special handler.<br></blockquote><div><br></div><div>Yes, I think it's a good idea. We could even use tools like Jolokia [1] to expose MBeans through REST interface (it can be added to standalone.conf to the bootstrap classpath). Alternatively we could use JDK embedded HTTP Server [2].</div><div><br></div><div>The only restriction that comes into my mind is that we shouldn't allow duplicated domains when exposing MBeans through REST interface. Otherwise it will be very hard to construct proper paths for the endpoint.</div><div><br></div><div>[1] <a href="https://jolokia.org/">https://jolokia.org/</a></div><div>[2] <a href="https://docs.oracle.com/javase/8/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/HttpServer.html">https://docs.oracle.com/javase/8/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/HttpServer.html</a></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
A cache and cachemanager's health is determined by a combination of<br>
parameters and we probably should allow for a user-pluggable checker. We<br>
already expose a number of statuses already, although obviously this<br>
would be an aggregate.<br></blockquote><div><br></div><div>Could you please elaborate more on that? How do we expose this information? Are you referring to Infinispan Stats [3]?</div><div><br></div><div>I also though about supporting queries somehow. An imaginary example from the top of my head could look like the following:</div><div><br></div><div>http://$ISPN/_health?cluster.nodes=3&MyCacheManager.MyCache.status=DEGRADED //<-- This would return 200 OK if we have 3 nodes and given cache is in degraded mode.</div><div>http://$ISPN/_health?cluster.nodes=3&MyCacheManager.rebalance=IN_PROGRESS //<-- Checks if we have 3 nodes and rebalance is in proress<br></div><div><br></div><div>[3] <a href="https://github.com/infinispan/infinispan/tree/8.2.x/core/src/main/java/org/infinispan/stats">https://github.com/infinispan/infinispan/tree/8.2.x/core/src/main/java/org/infinispan/stats</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<span class=""><br>
><br>
> Could you please give me a hand and tell me what functionalities are<br>
> important for you? Would you like to be able to check status per-cache<br>
> or maybe a red (not healthy), green (healthy), yellow (healthy,<br>
> rebalance in progress) cluster status is sufficient? What kind of<br>
> information do you expect to be there?<br>
</span>I wouldn't want this to be overly complex: a simple OK, KO should be<br>
sufficient. Additional detail may be optionally present, but not a<br>
requirement.<br></blockquote><div><br></div><div>I think we will need at least a 3rd state - yellow or something like this. This would mean that a rebalance is in progress of a node is joining/leaving. In other words - the cluster accepts requests but don't touch the nodes!</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<span class=""><font color="#888888"><br>
<br>
Tristan<br>
<br>
--<br>
Tristan Tarrant<br>
Infinispan Lead<br>
JBoss, a division of Red Hat<br>
</font></span><div class=""><div class="h5"><br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</div></div></blockquote></div><br></div></div>