📄 cluster-tags.xtp
字号:
<document><header> <title>cluster: Cluster tag configuration</title> <version>Resin 3.1</version> <description> <p>Each <cluster> contains a set of <a href="virtual-host.xtp">virtualhosts</a> served by a collection of <<a href="server-tags.xtp">server</a>>s. The cluster provides<a href="resin-clustering.xtp">load-balancing</a>and <a href="config-sessions.xtp">distributed sessions</a> for scalabilityand reliability.</p> </description></header><body><localtoc/><s1 title="See Also"><ul><li>See the <a href="index-tags.xtp">index</a> for a list of all the tags.</li><li>See <a href="webapp-tags.xtp">Web Application</a> configuration for web.xml (Servlet) configuration.</li><li>See <a href="server-tags.xtp">Server tags</a> for ports, threads, and JVM configuration.</li><li>See <a href="config-env.xtp">Resource</a> configuration for resources: classloader, databases, connectors, and resources.</li><li>See <a href="config-log.xtp">Log</a> configuration for access log configuration, java.util.logging, and stdout/stderr logging.</li></ul></s1><defun title="<access-log>"><p><access-log> configures a HTTP access log for all virtual hostsin the cluster.See <a href="host-tags.xtp#%3caccess-log%3d">access-log</a>in the <host> tag for more information.</p></defun><defun title="<cache>" version="Resin 3.1"><parents>cluster</parents><p><cache> configures the proxy cache (requires Resin Professional). Theproxy cache improves performance by caching the output of servlets,jsp and php pages. For database-heavy pages, this caching can improveperformance and reduce database load by several orders of magnitude.</p><p>The proxy cache uses a combination of a memory cache and a disk-basedcache to save large amounts of data with little overhead.</p><p>Management of the proxy cache uses the<a href="javadoc|com.caucho.management.server.ProxyCacheMXBean">ProxyCacheMXBean</a>.</p><deftable title="<cache> Attributes"><tr> <th>Attribute</th> <th>Description</th> <th>Default</th></tr><tr><td>path</td> <td>Path to the persistent cache files.</td> <td>cache/</td></tr><tr><td>disk-size</td> <td>Maximum size of the cache saved on disk.</td> <td>1024M</td></tr><tr><td>enable</td> <td>Enables the proxy cache.</td> <td>true</td></tr><tr><td>enable-range</td> <td>Enables support for the HTTP Range header.</td> <td>true</td></tr><tr><td>entries</td> <td>Maximum number of pages stored in the cache.</td> <td>8192</td></tr><tr><td>max-entry-size</td> <td>Largest page size allowed in the cache.</td> <td>1M</td></tr><tr><td>memory-size</td> <td>Maximum heap memory used to cache blocks.</td> <td>8M</td></tr><tr><td>rewrite-vary-as-private</td> <td>Rewrite Vary headers as Cache-Control: private to avoid browserand proxy-cache bugs (particularly IE).</td> <td>false</td></tr></deftable><def title="<cache> schema">element cache { disk-size? & enable? & enable-range? & entries? & path? & max-entry-size? & memory-size? & rewrite-vary-as-private?}</def><example title="Example: enabling proxy cache"><resin xmlns="http://caucho.com/ns/resin"> <cluster id="web-tier"> <cache entries="16384" disk-size="2G" memory-size="256M"/> <server id="a" address="192.168.0.10"/> <host host-name="www.foo.com"> </cluster></resin></example></defun><defun title="<cluster>" version="Resin 3.1"><parents>resin</parents><p><cluster> configures a set of identically-configured servers.The cluster typically configures a set of <server>s, each with someports, and a set of virtual <host>s.</p><p>Only one <cluster> is active in any on server. At runtime,the <cluster> is selected by the <server> with <var>id</var>matching the -server-id on the command line.</p><deftable title="<cluster> Attributes"><tr> <th>Attribute</th> <th>Description</th> <th>Default</th></tr><tr> <td>id</td> <td>The cluster identifier.</td> <td>required</td></tr><tr> <td><a href="host-tags.xtp#access-log">access-log</a></td> <td>An access-log shared for all virtual hosts.</td> <td></td></tr><tr> <td><a href="#cache">cache</a></td> <td>Proxy cache for HTTP-cacheable results.</td> <td></td></tr><tr> <td><a href="#connection-error-page">connection-error-page</a></td> <td>IIS error page to use when isapi_srun to Resin connection fails</td> <td></td></tr><tr> <td><a href="host-tags.xtp#ear-default">ear-default</a></td> <td>default values for deployed ear files</td> <td></td></tr><tr> <td><a href="#error-page">error-page</a></td> <td>Custom error-page when virtual-hosts fail to match</td> <td></td></tr><tr> <td>host</td> <td>Configures a virtual host</td> <td></td></tr><tr> <td>host-default</td> <td>Configures defaults to apply to all virtual hosts</td> <td></td></tr><tr> <td>host-deploy</td> <td>Automatic host deployment based on a deployment directory</td> <td></td></tr><tr> <td>ignore-client-disconnect</td> <td>Ignores socket exceptions thrown because browser clients have prematurely disconnected</td> <td>false</td></tr><tr> <td>invocation-cache-size</td> <td>Size of the system-wide URL to servlet invocation mapping cache</td> <td>16384</td></tr><tr> <td>invocation-cache-max-url-length</td> <td>Maximum URL length saved in the invocation cache</td> <td>256</td></tr><tr> <td>machine</td> <td>Configuration for grouping <server> onto physical machines</td> <td></td></tr><tr> <td>persistent-store</td> <td>Configures the distributed/persistent store</td> <td></td></tr><tr> <td>ping</td> <td>Periodic checking of server URLs to verify server activity</td> <td></td></tr><tr> <td>redeploy-mode</td> <td>"automatic" or "manual"</td> <td>automatic</td></tr><tr> <td><a href="env-tags.xtp#resin:choose">resin:choose</a></td> <td>Conditional configuration based on EL expressions</td> <td></td></tr><tr> <td><a href="env-tags.xtp#resin:import">resin:import</a></td> <td>Imports a custom cluster.xml files for a configuration management </td> <td></td></tr><tr> <td><a href="env-tags.xtp#resin:if">resin:if</a></td> <td>Conditional configuration based on EL expressions</td> <td></td></tr><tr> <td>rewrite-dispatch</td> <td>rewrites and dispatches URLs using regular expressions, similar to mod_rewrite</td> <td></td></tr><tr> <td>root-directory</td> <td>The root filesystem directory for the cluster</td> <td>${resin.root}</td></tr><tr> <td><a href="server.xtp">server</a></td> <td>Configures JVM instances (servers). Each cluster needs at least one server</td> <td></td></tr><tr> <td>server-default</td> <td>Configures defaults for all server instances</td> <td></td></tr><tr> <td>server-header</td> <td>Configures the HTTP "Server: Resin/xxx" header</td> <td>Resin/Version</td></tr><tr> <td>session-cookie</td> <td>Configures the servlet cookie name</td> <td>JSESSIONID</td></tr><tr> <td>session-sticky-disable</td> <td>Disables sticky-sessions on the load balancer</td> <td>false</td></tr><tr> <td>url-character-encoding</td> <td>Configures the character encoding for URLs</td> <td>utf-8</td></tr><tr> <td>url-length-max</td> <td>Configures the maximum length of an allowed URL</td> <td>8192</td></tr><tr> <td>web-app-default</td> <td>Configures defaults to apply to all web-apps in the cluster</td> <td></td></tr></deftable><def title="<cluster> schema">element cluster { attribute id { string } & <a href="env-tags.xtp">environment resources</a> & access-log? & cache? & connection-error-page? & ear-default* & error-page* & host* & host-default* & host-deploy* & ignore-client-disconnect? & invocation-cache-size? & invocation-cache-max-url-length? & machine* & persistent-store? & ping* & redeploy-mode? & resin:choose* & resin:import* & resin:if* & rewrite-dispatch? & root-directory? & server* & server-default* & server-header? & session-cookie? & session-sticky-disable? & url-character-encoding? & url-length-max? & web-app-default*}</def><example title="Example: cluster-default"><resin xmlns="http://caucho.com/ns/resin"> <cluster id="web-tier"> <server-default> <http port="8080"/> </server-default> <server id="a" address="192.168.0.10"/> <server id="b" address="192.168.0.11"/> <host host-name="www.foo.com"> ... </host> </cluster></resin></example><s2 title="rewrite-vary-as-private"><p>Because not all browsers understand the Vary header, Resin can rewriteVary to a Cache-Control: private. This rewriting will cache the pagewith the Vary in Resin's proxy cache, and also cache the page in the browser.Any other proxy caches, however, will not be able to cache the page.</p><p>The underlying issue is a limitation of browsers such as IE. When IEsees a Vary header it doesn't understand, it marks the page as uncacheable.Since IE only understands "Vary: User-Agent", this would mean IE wouldrefuse to cache gzipped pages or "Vary: Cookie" pages.</p><p>With the <rewrite-vary-as-private> tag, IE will cache the pagesince it's rewritten as "Cache-Control: private" with no Vary at all.Resin will continue to cache the page as normal.</p></s2></defun><defun title="<cluster-default>" version="Resin 3.1"><parents>resin</parents><p><cluster-default> defines default cluster configuration for all clusters in the <resin> server.</p><example title="Example: cluster-default"><resin xmlns="http://caucho.com/ns/resin"> <cluster-default> <cache entries="16384" memory-size="64M"/> </cluster-default> <cluster id="web-tier"> ... </cluster> <cluster id="app-tier"> ... </cluster></resin></example></defun><defun title="<connection-error-page>" version="Resin 3.1"><parents>cluster</parents><p><connection-error-page> specifies an error page to be usedby IIS when it can't contact an app-tier Resin. This directiveonly applies to IIS.</p><def title="connection-error-page">element connection-error-page { string}</def></defun><defun title="<development-mode-error-page>" version="Resin 3.2.0"><parents>cluster</parents><p><development-mode-error-page> enables browser error reportingwith extra information. Because it can expose internal data, it is notgenerally recommended in production systems. (The information is generallycoped to the log.</p></defun><defun title="<ear-default>" version="Resin 3.1"><parents>cluster</parents><p><ear-default> configures defaults for .ear resource,i.e. enterprise applications.</p></defun><defun title="<error-page>" version="Resin 3.1"><parents>cluster</parents><p><error-page> defines a web page to be displayed when an error occursoutside of a virtual host or web-app.Note, this is not a default error-page, i.e. ifan error occurs inside a <host> or <web-app>, the error-page forthat host or web-app will be used instead.</p><p>See <a href="webapp.xtp#error-page">webapp: error-page</a>.</p><def title="<error-page> schema">element error-page { (error-code | exception-type)? & location?}</def></defun><defun title="<host>" version="Resin 3.0"><parents>cluster</parents><p><host> configures a virtual host. Virtual hosts must beconfigured explicitly.</p><ul><li>See <a href="host-tags.xtp">host tags</a> for configuration details.</li></ul><deftable-childtags title="<host> attributes"><tr> <th>Attribute</th> <th>Description</th> <th>Default</th></tr><tr><td>id</td> <td>primary host name</td> <td>none</td></tr><tr><td>regexp</td> <td>Regular expression based host matching</td> <td>none</td></tr><tr><td>host-name</td> <td>Canonical host name</td> <td>none</td></tr><tr><td>host-alias</td> <td>Aliases matching the same host</td> <td>none</td></tr><tr><td>secure-host-name</td> <td>Host to use for a redirect to SSL</td> <td>none</td></tr><tr><td>root-directory</td> <td>Root directory for host files</td> <td>parent directory</td></tr><tr><td>startup-mode</td> <td>'automatic', 'lazy', or 'manual', see <a href="resin-tags.xtp#startup-mode">Startup and Redeploy Mode</a></td> <td>automatic</td></tr></deftable-childtags><example title="Example: explicit host"><host host-name="www.foo.com"> <host-alias>foo.com</host-alias> <host-alias>web.foo.com</host-alias> <root-directory>/opt/www/www.foo.com</root-directory> <web-app id="/" document-directory="webapps/ROOT"> </web-app> ...</host></example>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -