You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bu...@apache.org on 2017/05/09 05:51:23 UTC

svn commit: r1011899 - in /websites/staging/sling/trunk/content: ./ documentation/bundles/sling-health-check-tool.html

Author: buildbot
Date: Tue May  9 05:51:22 2017
New Revision: 1011899

Log:
Staging update by buildbot for sling

Modified:
    websites/staging/sling/trunk/content/   (props changed)
    websites/staging/sling/trunk/content/documentation/bundles/sling-health-check-tool.html

Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue May  9 05:51:22 2017
@@ -1 +1 @@
-1794314
+1794498

Modified: websites/staging/sling/trunk/content/documentation/bundles/sling-health-check-tool.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/sling-health-check-tool.html (original)
+++ websites/staging/sling/trunk/content/documentation/bundles/sling-health-check-tool.html Tue May  9 05:51:22 2017
@@ -122,13 +122,16 @@ supplying MBeans that expose the require
 <p>See also:</p>
 <ul>
 <li>Source code at  <a href="http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/healthcheck">http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/healthcheck</a></li>
-<li>adaptTo 2013 slides about Health Checks at <a href="http://www.slideshare.net/bdelacretaz/slinghc-bdelacretazadaptto2013">http://www.slideshare.net/bdelacretaz/slinghc-bdelacretazadaptto2013</a></li>
+<li>adaptTo slides about Health Checks: <a href="http://www.slideshare.net/bdelacretaz/slinghc-bdelacretazadaptto2013">Introduction</a> and <a href="https://adapt.to/content/dam/adaptto/production/presentations/2014/adaptTo2014-Sling-Health-Checks-New-And-Noteworthy-Georg-Henzler.pdf/_jcr_content/renditions/original.media_file.download_attachment.file/adaptTo2014-Sling-Health-Checks-New-And-Noteworthy-Georg-Henzler.pdf">Health Check Executor</a></li>
 </ul>
 <h2 id="use-cases">Use cases<a class="headerlink" href="#use-cases" title="Permanent link">&para;</a></h2>
-<p>Health checks can be used for various purposes, for example:</p>
+<p>Generally health checks have two high level use cases:
+<em> Operations teams checking sling instances for their internal state manually
+</em> Load balancers can query the health of a sling instance and decide to take it out or back into the list of used backends automatically</p>
+<p>The strength of Health Checks are to surface internal Sling state for external use:</p>
 <ul>
-<li>Verify that performance counters are in range.</li>
-<li>Run smoke tests at system startup and emit warnings or disable the instance if they fail.</li>
+<li>Verify that performance counters are in range</li>
+<li>Run smoke tests at system startup </li>
 <li>Check that all OSGi bundles are up and running</li>
 <li>Check that demo content has been removed from a production system</li>
 <li>Check that demo accounts are disabled</li>
@@ -173,11 +176,11 @@ can provide more info about what, if any
 </pre></div>
 
 
-<p><code>HealthCheck</code> services can be selected for execution based on their <code>hc.tags</code> multi-value service property. </p>
+<h2 id="executing-health-checks">Executing Health Checks<a class="headerlink" href="#executing-health-checks" title="Permanent link">&para;</a></h2>
+<p>Health Checks can be executed via a <a href="#webconsoleplugin">webconsole plugin</a>, the <a href="#healthcheckservlet">health check servlet</a> or via <a href="#jmxaccesstohealthchecks">JMX</a>. <code>HealthCheck</code> services can be selected for execution based on their <code>hc.tags</code> multi-value service property. </p>
 <p>The <code>HealthCheckFilter</code> utility accepts positive and negative tag parameters, so that <code>-security,sling</code> 
 selects all <code>HealthCheck</code> having the <code>sling</code> tag but not the <code>security</code> tag, for example.</p>
-<p>Besides executing them programmatically, Health checks can be executed via a webconsole plugin or via JMX, 
-as described below.</p>
+<p>For advanced use cases it is also possible to use the API directly by using the interface <code>org.apache.sling.hc.api.execution.HealthCheckExecutor</code>.</p>
 <h3 id="slinghealthcheck-annotation">SlingHealthCheck annotation<a class="headerlink" href="#slinghealthcheck-annotation" title="Permanent link">&para;</a></h3>
 <p>The <code>SlingHealthCheck</code> annotation makes it easier to specify the required <code>HealthCheck</code> service properties.</p>
 <p>Here's an example from the <code>samples</code> module - see the <code>annotations</code> module for more details.</p>
@@ -200,7 +203,7 @@ as described below.</p>
 <h2 id="health-check-bundles">Health Check bundles<a class="headerlink" href="#health-check-bundles" title="Permanent link">&para;</a></h2>
 <p>The Health Check subsystem consists of the following bundles:</p>
 <ul>
-<li>The only required bundle is <code>org.apache.sling.hc.core</code> which provides the API, some utility classes and some generally useful <code>HealthCheck</code> services. </li>
+<li>The only required bundles are <code>org.apache.sling.hc.api</code> which provides the API and <code>org.apache.sling.hc.core</code> which provides some utility classes and some generally useful <code>HealthCheck</code> services (e.g. the health check executor)</li>
 <li><code>org.apache.sling.hc.support</code> provides more Sling-specific <code>HealthCheck</code> services.</li>
 <li><code>org.apache.sling.hc.webconsole</code> provides the Webconsole plugin described below.</li>
 <li><code>org.apache.sling.junit.healthcheck</code> provides a <code>HealthCheck</code> service that executes JUnit tests in the server-side OSGi context.</li>
@@ -219,6 +222,7 @@ as described below.</p>
 <ul>
 <li><code>SlingRequestStatusHealthCheck</code> checks the HTTP status of Sling requests.  </li>
 <li><code>DefaultLoginsHealthCheck</code> can be used to verify that the default Sling logins fail.  </li>
+<li><code>ThreadUsageHealthCheck</code> can be used to monitor for deadlocks using JRE ThreadMXBean (see <a href="https://issues.apache.org/jira/browse/SLING-6698">SLING-6698</a> )</li>
 </ul>
 <p>A bridge to server-side OSGi-aware JUnit tests is provided by the <code>JUnitHealthCheck</code>, from 
 the <code>org.apache.sling.junit.healthcheck</code> bundle.</p>
@@ -321,9 +325,9 @@ domain <code>org.apache.sling.healthchec
 <p>The MBean gives access to the <code>Result</code> and the log, as shown on the screenshot below.   </p>
 <p>See the example configurations of the <code>org.apache.sling.hc.samples</code> for more details.</p>
 <p><img alt="JConsole showing Sling Health Check MBeans" src="jconsole-hc.jpg" /></p>
-<h2 id="health-checks-servlet">Health Checks Servlet<a class="headerlink" href="#health-checks-servlet" title="Permanent link">&para;</a></h2>
+<h2 id="health-check-servlet">Health Check Servlet<a class="headerlink" href="#health-check-servlet" title="Permanent link">&para;</a></h2>
 <p>Starting with version 1.2.4 of the <code>org.apache.sling.hc.core</code> bundle, a flexible Health Checks execution servlet is available. It provides
-similar features to the Web Console plugin described above, with output in HTML, JSON, JSONP and TXT formats.</p>
+similar features to the Web Console plugin described above, with output in HTML, JSON (plain or jsonp) and TXT (concise or verbose) formats (see HTML format rendering page for more documentation).</p>
 <p>The Health Checks Servlet is disabled by default, to enable it create an OSGi configuration like</p>
 <div class="codehilite"><pre><span class="n">PID</span> <span class="p">=</span> <span class="n">org</span><span class="p">.</span><span class="n">apache</span><span class="p">.</span><span class="n">sling</span><span class="p">.</span><span class="n">hc</span><span class="p">.</span><span class="n">core</span><span class="p">.</span><span class="n">impl</span><span class="p">.</span><span class="n">servlet</span><span class="p">.</span><span class="n">HealthCheckExecutorServlet</span>
 <span class="n">servletPath</span> <span class="p">=</span> <span class="o">/</span><span class="n">system</span><span class="o">/</span><span class="n">health</span>
@@ -331,9 +335,8 @@ similar features to the Web Console plug
 
 
 <p>which specifies the servlet's base path. That URL then returns an HTML page, by default with the results of all active health checks and
-with instructions at the end of the page about URL parameters which can be used to select specific Health Checks and control their execution
-and output format.</p>
-<p>Note that by design <strong>the Health Checks Servlet doesn't do any access control by itself</strong> to ensure it can detect unhealthy states of the authentication itself. Make sure the configured path is only accessible to relevant infranstructure and operations people. Usually all <code>/system/*</code> paths are only accessible from a local network and not routed to the Internet.</p>
+with instructions at the end of the page about URL parameters which can be used to select specific Health Checks and control their execution and output format.</p>
+<p>Note that by design <strong>the Health Checks Servlet doesn't do any access control by itself</strong> to ensure it can detect unhealthy states of the authentication itself. Make sure the configured path is only accessible to relevant infrastructure and operations people. Usually all <code>/system/*</code> paths are only accessible from a local network and not routed to the Internet.</p>
 <h2 id="health-checks-as-server-side-junit-tests">Health Checks as server-side JUnit tests<a class="headerlink" href="#health-checks-as-server-side-junit-tests" title="Permanent link">&para;</a></h2>
 <p>The <code>org.apache.sling.hc.junit.bridge</code> bundle makes selected Health Checks available as server-side JUnit tests. </p>
 <p>It requires the <code>org.apache.sling.junit.core bundle</code> which provides the server-side JUnit tests infrastructure.</p>
@@ -346,7 +349,7 @@ to run the corresponding Health Checks.<
 <p>To run the Health Check tests at build time, see the <a href="http://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests">testing/samples/integration-tests</a>
 sample module.</p>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1765416 by ghenzler on Tue, 18 Oct 2016 11:36:54 +0000
+        Rev. 1794498 by ghenzler on Tue, 9 May 2017 05:51:04 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project